Vim Tips Wiki
(Change to TipImported template + severe manual clean)
(Move categories to tip template)
Line 9: Line 9:
 
|version=6.0
 
|version=6.0
 
|rating=5/6
 
|rating=5/6
  +
|category1=Windows
  +
|category2=
 
}}
 
}}
 
There is a Windows registry setting that permits you to right click a directory in Windows Explorer to open a command prompt at that directory. I've hacked it so as to open gvim in explorer mode at that directory. You can then use the 'Explorer Mode' of gvim to navigate the directory and view or edit the files within.
 
There is a Windows registry setting that permits you to right click a directory in Windows Explorer to open a command prompt at that directory. I've hacked it so as to open gvim in explorer mode at that directory. You can then use the 'Explorer Mode' of gvim to navigate the directory and view or edit the files within.
Line 66: Line 68:
   
 
----
 
----
[[Category:Windows]]
 

Revision as of 04:47, 25 April 2008

Tip 861 Printable Monobook Previous Next

created January 23, 2005 · complexity intermediate · author corp-mule · version 6.0


There is a Windows registry setting that permits you to right click a directory in Windows Explorer to open a command prompt at that directory. I've hacked it so as to open gvim in explorer mode at that directory. You can then use the 'Explorer Mode' of gvim to navigate the directory and view or edit the files within.

REGEDIT4

[HKEY_CLASSES_ROOT\Folder\shell\GVimHere]
@="gViM Here"

[HKEY_CLASSES_ROOT\Folder\shell\GVimHere\command]
@="C:\\Program Files\\Vim\\vim63\\gvim.exe ."

Comments

I have not tested it. but noticed the cd \"%1\""

that is "changing directory" to where you are in Explorer. You need to do the same with Vim.


And what about this key

[HKEY_CLASSES_ROOT\Folder\shell\GVimHere\command]
c:\\vim\\vim63\\gvim.exe -c ":Explore" .

for win2000? tested and works good.

But only for Vim6.3 -- in my Vim7 "$VIM/plugin" directory isn't plugin "explorer.vim" present despite of that, that is mentioned in plugin/README.txt.


in Vim7, netrw.vim is used for browsing local directories. I had problems with this on WinXP, but if you

:e \vim\vim70aa\plugin\netrw.vim
/afile

and change
 .... LocalBrowse(expand("<afile>"))

to
.... LocalBrowse(expand("<amatch>"))

:wq

Now when you want to browse a local dir, :e <directory> (:e ., :e c:\, etc) it will execute LocalBrowse.

gvim.exe .

will work fine.

DrChip said that he'd apply this change to netrw.vim, so you may not have to make that change in future builds of Vim7.