Now assume that you write an if statement. After typing the left brace and pressing Enter, it looks like this (auto-completion is set)
if(a < b) {
}
The effect I want is after pressing Enter
if(a < b) {
I//The cursor is here
}
How should you set up vimrc like this?
Thanks!
滿天的星座2017-05-16 16:41:40
This can be accomplished with abbreviations:
:iabbrev {i {}<esc>i<cr>O
{i
Feel free to change O
will be indented according to the current indent setting