Replace tabs with spaces in vim

前端 未结 11 1054
青春惊慌失措
青春惊慌失措 2020-12-02 03:38

I would like to convert tab to spaces in gVim. I added the following line to my _vimrc:

set tabstop=2

It works to stop at two

11条回答
  •  执念已碎
    2020-12-02 03:51

    This worked for me:

    you can see tabs with first doing this:

    :set list
    

    then to make it possible to replace tabs then do this:

    :set expandtab
    

    then

    :retab
    

    now all tabs have been replaced with spaces you can then go back to normal viewing like this :

    :set nolist
    

提交回复
热议问题