Monday, September 19, 2011

How to set vim tab width on Ubuntu

Create/modify the $HOME/.vimrc by adding the following lines to set the width of the tab to be 4.
set expandtab
set shiftwidth=4
set softtabstop=4
Explanation:
  • expandtab: affects what happens when you press the <TAB> key.
  • shiftwidth: affects what happens when you press >>, << or ==.
  • softtabstop: affects what happens when you press the <TAB> keys if expandtab is set.

No comments:

Post a Comment