How to use only tab (not space) in vim

前端 未结 1 630
庸人自扰
庸人自扰 2021-01-31 07:05

I prefer to use tab than white space(may be a little different from most of others)

But I found, when I hit Enter at the end of li

1条回答
  •  被撕碎了的回忆
    2021-01-31 07:24

    The settings you are looking for are:

    set autoindent
    set noexpandtab
    set tabstop=4
    set shiftwidth=4
    

    As single line:

    set autoindent noexpandtab tabstop=4 shiftwidth=4
    

    autoindent can be replaced with smartindent or cindent, depending upon your tastes. Also look at filetype plugin indent on.

    http://vim.wikia.com/wiki/Indenting_source_code

    0 讨论(0)
提交回复
热议问题