VIM – Specman indentation

For a long time I was using VIM’s Smartindent feature while typing, and was quite satisfied.

However, last week I’ve tried to read an annoying .e file with zigzag lines. Well, I thought, I’m using VI – the Super Editor. It must have a re-indent feature, doesn’t it?

Quick Googling gave me “gg=G” keystroke. It indeed re-indented the whole file, but it made some strange decisions…

It appears that every VIM “filetype” (i.e., supported language) should have supporting indentation file, and Specman doesn’t have such!

Well, now it has 🙂


Just put it under:


And reload VI.

Of course, feedback is welcome 🙂



Filed under Specman

5 responses to “VIM – Specman indentation

  1. Adrian

    Thanks for script!
    but it looks like indentkeys also need to be defined in the same file, like following:

    setlocal indentkeys=0{,0},!^F,o,O,0),0]

  2. I’m a little bit confused here…
    Can you give an example that doesn’t indent well with the current script, and is better indented with the addition?

  3. Cambota

    Works perfectly! Thank you!

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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