edit SASS-templates in VIM

Posted: May 15, 2011 in development, how-tos

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! ;)

Advertisement

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 )

Connecting to %s