Vim Tab To Space

How to change tabs to space with vim?


:set tabstop=3
:set expandtab

Note: This doesn't change the existing tab to space characters.
If you want to change all tabs to spaces in the whole file use :retab
after you set :set expandtab.


Note: Works perfect for python source


Add the above definitions to the .vimrc file.

vi ~/.vimrc

More infos:

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License