Technology
 

Use gvim in VS.Net

From Vim Tips Wiki

(Redirected from VimTip368)

Tip 368 Previous Next created November 8, 2002 · complexity basic · author Mark Fernandes · version 5.7


This tip presumes you have both VS.Net (Developer Studio.Net) and gvim installed, and know where gvim is located on your system.

  • Create a solution in VS.Net, any project type will do.
  • In the solution explorer (View->Solution or Ctrl + R) you should see a list of files (click on the "Solution Explorer" tab if you do not see the file list).
  • Right click on any of the files and choose "Open With...", this brings up the Open With dialog.
  • Click on "Add..." this brings up the Add Program dialog.
  • Click on "Browse..." and point the Browse dialog to your gvim location.
  • You have now added gvim to the list of editors, you may also select gvim to be the default editor for that file type.

You may need to do this for all file types you wish to edit with gvim. And yes you still have VS.Net open the file in its own editor.

Of course if you want to reverse changes simply remove gvim from the list of editors and why would you want to do that?

[edit] Comments

Slightly disappointing is that VS.net opens the window in the middle of the screen and at the location and size of the its "source pane". How can I adjust where and of what size is the vim window when it opens?


VS.Net insists on opening each file in a new vim window, is there a way to force it to open each file in the same window?


in vimrc:

gui
winpos 33 0
set lines=100

You can restrict this to files of a certain type by adding the above lines to a .vim file in your ftplugin directory. For example in cpp.vim for c++ files in visual studio, php.vim to size vim for dreamweaver or whatever.


Refer to VimTip589 for more detailed description.