Is there any way to make VIM put the brackets in the right indentation? For example, whenever I type:
if (something)
do something
and then I hit enter after "do something", to have it jump back in line with the if statement? Also, when I go into insert mode, can I make it so it automatically jumps to the correct indentation level instead of staying at the beginning of the line?
For general C like languages you can do this in .vimrc
set smartindent
However vim can do better (and does like you ask for C), by enabling specific rules for various languages. To enable that I have:
filetype on
filetype plugin on
filetype indent on
For more details search for "indent" in my .vimrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With