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?

showkey
  • 1,130
  • 2
  • 11
  • 30

1 Answers1

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.

Matt
  • 20,685
  • 1
  • 11
  • 24