Vim tabs to spaces
When you are given a file with tabs for indentation you can
:retab and it will convert tabs to spaces*.
*Important : it convert the tabs in a file to spaces (if you have
:set expandtab directive before) or to tabs (if you have the default
I have :set expandtab, How to control number of spaces for each tab ?
You need to have set
:set expandtab. Then you can control how many spaces a tab should be replaced with, using:
:set expandtab :set tabstop=x
usually x is 4 or 2 (
How many spaces for indentation
How to control the number of spaces when using
>> for indentation
Once you have
:set expandtab set up, and you try to use
<< for indentation, you need to have the matching: