How do you run Vim in Windows?

前端 未结 4 1561
悲哀的现实
悲哀的现实 2020-12-14 14:56

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 s

4条回答
  •  -上瘾入骨i
    2020-12-14 15:18

    Just to supplement, I'm on a fairly highly controlled Windows workstation right now, and don't have access to much. Downloading the "executable installer" that I usually use did not create the bat files nor, for some reason, vim.exe, though gvim.exe was installed in the vim74 dir for me and worked fine. So though I also needed to set the PATH, that there was no bat file in C:\WiNDOWS nor any command line executable in my VIm runtime folder to call meant that callingvim from the command line (or Powershell) didn't work.

    I'm guessing some portion of the install that's creating the command-line related stuff, apparently including vim.exe, isn't recovering gracefully when you don't have admin permissions.

    Either way, the "right" thing to do appears to be to set your PATH to your vim executable folder as usual (note that this might be a little more difficult than usual if you don't have admin privs), then download the "Win32 console executable" from the usual download page that matches the version of gvim that you've already installed, dig vim.exe out of that zip you just downloaded, and place that into the same folder as gvim.exe.

    Looking on another box where the executable installer did work "fully", there's some jive in the vim.bat file that wasn't installed for me about "collect the arguments in VIMARGS for Win95" and if .%OS%==.Windows_NT goto ntaction, etc etc, but not having any of that doesn't seem to be a problem on Win7, at least. ;^)

提交回复
热议问题