Vim Auto Indent with newline

前端 未结 6 1109
礼貌的吻别
礼貌的吻别 2021-02-01 13:18

How do I get vim to place the cursor within the braces starting on a new line, ie with | denoting the cursor position :

class {
  |
}

right now

6条回答
  •  被撕碎了的回忆
    2021-02-01 14:19

    Put this in your .vimrc :

    imap  k
    

    Assuming autoindent and smartindent are set correctly, typing Ctrl + Return between braces will put your cursor where you want it to be.

提交回复
热议问题