Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just installed gVim, and tried using the usual "vim myfile.java" technique that usually works for linux to open up a file and edit it. But unfortunately, this doesn't seem to work. I've also tried "gvim myfile.java", but that doesn't work either.

Does anyone know how to open up vim (and use it like you do in linux) using Windows Powershell, or some other technique?

share|improve this question

migrated from programmers.stackexchange.com Apr 6 '12 at 21:31

This question came from our site for professional programmers interested in conceptual questions about software development.

1  
Maybe you could describe which install you used, as Vim has several for Windows. That would aid in getting to an answer. –  pottsdl Apr 6 '12 at 21:42
    
maybe you'll need adjust your PATH variable –  mightyuhu Apr 6 '12 at 21:46
    
Cross-posted from SO: stackoverflow.com/q/10049316 –  Chris Johnsen Apr 7 '12 at 10:10

4 Answers 4

I'm pretty sure mysysgit for windows has vim, but that shell is tailored for using Git on windows, though it does have vim as far as I am aware. Quick google search found this though. Is that what you're looking for?

Thanks for the comment Zach, alternatively to restarting after having added vim to path, you can use the SET command to load up the path to the newly installed vim e.g. set path=c:\program Files\gvim\vim9.9\vim.exe so that you can restart after a normal session

share|improve this answer
    
In the Vim installer that you link to, there is an option to add Vim to your PATH. This option is necessary if you want to launch vim/gvim from the command line. Once you have done that, you might need to reopen any command prompt windows, or log out and back in. –  Zach Apr 6 '12 at 21:41

I run gVim by clicking an icon on my desktop or by using "edit with vim" from the context menu in Windows explorer.

If you want to invoke vim from a Windows command prompt you either need to have the path to vim.exe added to %PATH% or type the full path (e.g. "c:\program Files\gvim\vim9.9\vim.exe" foo.txt

share|improve this answer

Another option is to install Cygwin (a linux-like environment for windows) with the vim package.

http://www.cygwin.com/

During installation, search for "vim" in the package manager, and install the latest version.

share|improve this answer

get the Gvim executable and install on the required system.

First, open Power shell and set alias for canonised commands (Windows 7 and above):

$ Set-alias vi "\path\to\gvim.exe"

$ Set-alias vim "\path\to\gvim.exe"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.