1

I'm running Windows XP and have installed gVIM...and love it.

Normally I just run gVIM and let the windowed app do all its magic, but lately I've been using the standard vim in the console as well.

The issue I'm having is with directory browsing.

In a gVIM window I can type :edit. and it will list out my current directory with files to select.

However, in VIM (in the command prompt), typing :edit. only outputs "." is a directory, and doesn't list out the current working directory as it does in gVIM.

Is there another way to do what I'd like?

** edit **

noticed that the reason that i am getting different behavior is the fact that when i run vim from the command line, it runs from c:\windows\system32, but when i run gvim it comes from c:\program files\vim....and the version in system32 has no pointer to the _vimrc file

3
  • works for me ...
    – akira
    Commented Dec 15, 2009 at 10:55
  • strange, it looks like it wants to open the directory, but there's just nothing there
    – erik
    Commented Dec 15, 2009 at 11:59
  • @espais, it sounds like for the command line it is picking up the vim.bat file instead of running the vim.exe directly. I'd take a guess that because the .bat version handles the input parameters differently, that is why it doesn't handle directory edit the way you would think.
    – pottsdl
    Commented Apr 4, 2012 at 13:48

3 Answers 3

3

Directory browsing is provided by the (installed as standard) netrw plugin. Your gvim presumably has access to that plugin but your console vim doesn't. Assuming you've installed vim in C:\vim and you're using vim 7.2, the plugin will probably be in c:\vim\vim72\plugins. Make sure you run vim from C:\vim\vim72 (by adding that directory to the start of your path).

If there is no c:\vim\vim72\vim.exe, copy the gvim.exe in the same directory but rename it as vim.exe and it should sort the rest out.

2

You can use :e FILENAME..

This is supported by the TAB Feature to complete the name.

Here is a little Cheat Sheet for the VIM

http://www.tuxfiles.org/linuxhelp/vimcheat.html

I hope this is useful!

3
  • thanks, but i know i can do that already :)...the problem is directly linked to the :edit. command
    – erik
    Commented Dec 15, 2009 at 11:58
  • :edit. opens the Directory index File! This is wrong! You have to open the normal file instead. I would prefer a list to see which files are inside and then open the file with edit! Directory Listening is safed in the . Okay? Open a File instead..
    – Fake4d
    Commented Dec 15, 2009 at 12:32
  • and what is so wrong with opening the directory index file?
    – erik
    Commented Dec 15, 2009 at 12:50
0

Since you're running vim.exe instead of gvim.exe from different places, it may also be that your VIMRUNTIME differs (:echo $VIMRUNTIME when inside vim or gvim). Furthermore, it may be that you have a .vimrc or _vimrc that gvim is picking up on (hence your gvim would be in noncompatible mode) but your vim isn't getting that benefit (and netrw doesn't work if your vim is running in vi-compatible mode).

Try :echo &cp too: get a 1, it's vi-compatible, 0 not. You want 0.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .