tags:

views:

37

answers:

1

For writable buffers, is there a way to tell vim to autoindent a file on entering & exiting the buffer?

What I want is the equiv of:

1G=G

to go first line
indent ..
until last line

Thanks!

+2  A: 

You can use autocommands (:h :au), for example BufRead and maybe BufWritePre.

wRAR