VIM – set tab to 2 spaces

When editing files, it is recommended to substitute spaces for tabs. For instance in YAML-files this is essential for the parsing to work.

So for vim you need to set some options. I used the following and got good results:
:set tabstop=2
:set shiftwidth=2
:set expandtab

(found here: http://vim.wikia.com/wiki/Converting_tabs_to_spaces)

Hope this might help someone someday.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s