Wednesday, October 26, 2005

GVim Rocks

I always knew that VIM is a very very powerful editor than all the present non-opensource editors. But, I was using crimson editor (freeware), and before that I used editplus (shareware), because, I could not figure out one feature in gvim. That feature is, to open all the files in a single window with different tabs. Today, I figured out that feature, and it is really nice.

There is one script (minibufexpl.vim), which you can get from the following website.

You just need to put this file in plugins directory in your vim installation directory. Now, if you open any file from gvim, it would be opened in the same window in different tab.

If you press, Ctrl+TAB, it will take you to tabbed pane, and there by pressing TAB, you can move from one file to another, and if you press Enter, that file would be loaded.

If you are using this script, you cannot use :q to close one file. If you use :q first time, it will close the tabbed pane. If you use :q second time, it will close all the files, and gvim window. To close one file, goto tabbed pane by Ctrl+TAB, and then goto corresponding file by TAB, and press d. It will close that file.

By mistake, if you close the tabbed pane, you can get it by :MiniBufExplorer

The next problem was, if you open a file from explorer, I want to open that file in the window that is already opened. The solution for this problem is also very simple.
In windows explorer, Tools -> Folder Options -> File Types, select the extension of the file, and in the action, type this.

c:\Software\vim\vim63\gvim.exe --remote-silent "%1"

Of course, you have to change the path of the gvim.exe.

Then, it will open in the same window that was already opened.

There is another tip that I found today. If you put the cursor on a word, and press "*", then it will search for that word. It will also highlight the words. This is same as highlight words in eclipse or idea.

You can get many of the tips at

Use GVim, and increase your productivity.


If you are using GVIM 7.0 or latest version, you can use the command gvim.exe --remote-tab-silent "%1". Starting VIM 7.0, the tabs are in-built.

No comments:

Post a Comment