Enable soft tabs in Vim

Posted Almost 13 years ago. Visible to the public.

If you want to enforce soft tabs (spaces instead of tabstops) in Vim put this into your ~/.vimrc (Linux) or C:\Users\<Username>\_vimrc (Windows):

set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab

You can also call those commands in a running Vim instance (using ":set ...") to switch on soft tabs temporarily.

On a side note: remember the :mkvimrc command Show archive.org snapshot that saves active settings to a vimrc file.

Arne Hartherz
Last edit
Over 11 years ago
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2011-06-02 10:42)