Vim Auto Indent with newline

前端 未结 6 1108
礼貌的吻别
礼貌的吻别 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:20

    At bottom of the file, I'm using:

    # vim: ts=2 sw=2 sts=2 sr noet st ai si
    

    For example Dockerfile:

    FROM centos-7
    RUN ...
    CMD ...
    
    # vim: ts=2 sw=2 sts=2 sr noet st ai si
    

    If you want keep the indentation only, use # vim: st ai si

提交回复
热议问题