Tag Archives: vim

Let VIM locate the file for you…

A very nice feature of VIM is the ‘gf’ command (go to file), which will open the file under cursor.

However, if there is a line like this:

 import my_file

“my_file.e” won’t be opened, because vim looks for “my_file”.

This can be easily solved, by adding this to your .vimrc

:set sua=.e

And to the more interesting part…

Q: If “my_file.e” isn’t located in the current directory, how will VIM find it?

A: The same way Specman does. With ‘specman_path’!

Adding this snippet to your .vimrc will do the trick 🙂

let &path = system(“echo $SPECMAN_PATH | sed ‘s/:/,/g'”)
if strlen(&path) == 0
     let &path = “.”
endif

Advertisements

2 Comments

Filed under Specman

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 🙂

specman.vim

Just put it under:

~/.vim/indent/

And reload VI.

Of course, feedback is welcome 🙂

5 Comments

Filed under Specman