Update: New version available. It is ported to native Vim Script, and support has been added for wildcards in &path. Download. Add the file to your .vimrc, or fit it in as a plugin.

On March 27, 2008:

When you use the normal gf and <C-]> bindings, you change the buffer in the current window. There is also an option to create a new window when doing it, but there are no way to reuse windows that already show the corresponding buffer, at least not natively.

You can reuse tabs and windows (like other IDE’s) with findtab.py, which is a simple Python script consisting of three functions. To use it, add something like the following to your .vimrc:

pyfile ~/.vim/extern/findtab.py
nnoremap <M-]> :python TabTag()<Cr>
nnoremap <C-w><M-f> :python TabFile()<Cr>

I have tried to make TabFile() work like gf, supporting path, includeexpr and suffixesadd. I think TabTag() works like <C-]>. The script also supplies a general Python function called FindTag(filename). It works as you think…

  • Facebook
  • Twitter
  • Digg
  • Reddit
  • del.icio.us
  • StumbleUpon