0

Configuration in my .vimrc:

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

I have edit a file which contain tab,saved and reopen to have a look at it with set list,the tab key saved,why set expandtab can't convert tab into 4 spaces automatically?

1 Answer 1

1

why set expandtab can't convert tab into 4 spaces automatically?

Because it's not supposed to. What expandtab does, it inserts spaces when you press tab key (but Ctrl-VTab still inserts a tab).

Use :h :retab to convert existing tabs to spaces.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.