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 '17 at 1:06

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 '17 at 12:31
  • Yes, expandtab make tab as series of spaces, other options base on expandtab.
    – Tuyen Pham
    Nov 15 '17 at 13:14

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.