Actually I set these options in my vimrc:

set tabstop=4
set expandtab

But everywhere I saw (esp in vim.wikia) they set different tab option as mine. like:

set shiftwidth=4
set softtabstop=4
set softtabstop=4

And I am confused, Are they same in function? Is there any difference between these tab options in vim behaviour? Please let me know how I can set my tab options comfortably.

  • 2
    Why don't you read the help section for each option? :help 'tabstop', :help 'shiftwidth', etc. Vim's help docs are pretty good.
    – B Layer
    Nov 14, 2017 at 1:06

1 Answer 1


This article may help you clear the idea.

set softtabstop=4 will makes backspace 4 spaces as a tab.

  • thanks. But I guess the expandtab do it too...
    – Cy8099
    Nov 15, 2017 at 12:31
  • Yes, expandtab make tab as series of spaces, other options base on expandtab. Nov 15, 2017 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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