Windows – How to run Vim in Windows

shellvimwindows

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?

Best Answer

When you install gVim:
Please make sure [✓] Create .bat files for command line use is checked.
It'll create several .bat files in C:\Windows\:

C:\>cd %windir%
C:\WINDOWS>dir /b *.bat
evim.bat
gview.bat
gvim.bat
gvimdiff.bat
view.bat
vim.bat
vimdiff.bat
vimtutor.bat

Notice that: C:\WINDOWS is already in the PATH environment variable.
When you type vim in command line, C:\WINDOWS\vim.bat will be launched.
If you leave the checkbox mentioned above unchecked, you need to modify PATH manually.