configuring vim to produce correct ruby indentation for jenkins
While pushing changes to Jenkins for review I noticed that I was indenting ruby code too much.. 4 spaces instead of 2 for a tab. This puzzled me as I had a .vimrc which seemed to be correct:
autocmd FileType ruby setlocal shiftwidth=2 tabstop=2 softtabstop=2
Examining the file with the vim command
:set list
showed that there were
^I
characters inserted for every place where I had inserted a tab. Simply trying to reformat using
gg=G
changed nothing. I later realized that I need to expand the tabstops to spaces
autocmd FileType ruby setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab
Then within vim
:retab
Wikia Converting Tabs to spaces Wikia VimTip 396
















