Tab key == 4 spaces and auto-indent after curly braces in Vim

后端 未结 11 1663
自闭症患者
自闭症患者 2020-11-27 09:01

How do I make vi-Vim never use tabs (converting spaces to tabs, bad!), makes the tab key == 4 spaces, and automatically indent code after curly brace blocks like Emacs does?

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 09:07

    edit your ~/.vimrc

    $ vim ~/.vimrc
    

    add following lines :

    set tabstop=4
    set shiftwidth=4
    set softtabstop=4
    set expandtab
    

提交回复
热议问题