Michael
Michael

Reputation: 522

Is there any way to autoindent a section of text in vimscript?

I'd like to autoindent a range of lines in a Vim plugin I'm writing, but there doesn't seem to be an easy way. Short of an actual vimscript command, I've been looking for ex-mode commands I could use to trigger autoindenting, but I haven't found a way there either.

Is there any way to trigger the autoindentation of a range of lines in Vim, besides hitting just hitting "="?

Upvotes: 0

Views: 176

Answers (1)

Kent
Kent

Reputation: 195289

why can't you use =? you could do

:normal! 3G=10G

to auto-indent 3,10 lines

Upvotes: 3

Related Questions