Vim: Change tabs to spaces and set how many spaces on tab press

When you press tab in vim, you normally get a tab character inserted in your text.

You can turn this off via set expandtab. When you press tab now, you get spaces.

To alter how many spaces you get on tab press, issue set tabstop=4.

Finally, to alter how to spaces you get when you indent text with >, issue set shiftwidth=4.


Edit on github
comments powered by Disqus
Click me