The problem is simple – and the answer should be as well. But it turns out, that some things in computer science are not as they might seem.
I wanted to edit a SASS-file (-> http://sass-lang.com) for a rails project. The source-file is required to have space-indenting with 2 spaces for every indentation. I caught myself using the tab key to indent everything, but then the parser simply gave me error-messages.
So I had to find a way to make vim interpret the tab key as 2 spaces – easier said then done. ![]()
A more sophisticated list of commands for vim can be found here.
The commands I used to get the results I needed were:
set expandtab set softtabstop=2 set shiftwidth=2
A note at the end: This only works for vim – not for vi!
So if you’re using vim – have fun or at least more success with this!