If I want to change the tab size, I can do that with set tabstop=<number>. I have that in my .vimrc to make it 4 instead of 8.

However, when I indent/deindent text by highlighting it then using >, it still uses the default tab size of 8. How can I make this be 4 too?


See :h >:

 >{motion}              Shift {motion} lines one 'shiftwidth' rightwards.
 >>                     Shift [count] lines one 'shiftwidth' rightwards.

So you need to set shiftwidth to affect this:

set shiftwidth=4
" or, to use the value of 'tabstop'
set shiftwidth=0
| improve this answer | |
  • Ok, I see it now, in the documentation for shiftwidth. When shiftwidth is 0, it uses the value for tab stop. All right, thanks a lot. – felwithe Apr 8 '18 at 15:31

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.