Vim keeps changing expandtab

Sometimes Vim changes expandtab settings. I want the space to always be reserved for certain types of files, but sometimes when I insert a new line, it gives me a tab.

 verb set expandtab? 

Reports that nonexpandtab was installed in this file:

 set autoindent set expandtab set shiftwidth=4 set numberwidth=4 set softtabstop=4 set smartindent autocmd FileType ruby,php,vim,jade,erb,css,scss,html,coffee,javascript setlocal expandtab sw=2 sts=2 au FileType xml exe ":silent 1,$!XMLLINT_INDENT=' ' xmllint --format --recover - 2>/dev/null" set backspace=indent,eol,start " Command to set how many spaces command! -nargs=1 SetSpace call s:SetSpace(<f-args>) function! s:SetSpace(space) setlocal expandtab sta let &sw = a:space let &sts = a:space endfunction 

Where exactly was set noexpandtab ?

Update
I notice that this problem occurs when I enter a new line, and if the line is indented with 8 spaces, then Vim is converted to a tab. How to fix it?

+6
source share
1 answer

:verbose set , unfortunately, does not capture all instances, so it cannot give any or incorrect answer.

Alternatively, you can record the full Vim session log using vim -V20vimlog . After exiting Vim, view the vimlog log vimlog for suspicious commands.

+2
source

Source: https://habr.com/ru/post/972735/


All Articles