Windows – How to use a text editor WITHIN the Command Prompt in a Windows OS

command linegitvimwindows

I would like to be able to create and edit the text of a file, all from the command line. No pop-up window (like with notepad), just create the file and start editing. I know this can be done with Nano on Mac.

My current command line is "Command Prompt with Ruby and Rails," which I'm using on Windows 8. Apparently I have VIM installed, or VI. When I commit to git, I am entered into an excellent text edit space – within my current window. Great! But how do I do it if not committing anything, and just want to >make file>edit file>. Something like >vim file_name.

So the VIM command would be appreciated. If not available, what else can I install? I tried the Nano binary. I ran the nano.exe and it works, but calling >nano file_name from cmd doesn't work. I already copy-pasted the cygwin1.dll to the folder nano asks for in the readme. No luck. I'm using the WinNT/9x binary, .zip format download.

I'm using x64 Windows 8 OS.

Best Answer

Vim will work inside the Windows console window if you run it with vim.exe.

If you run it with gvim.exe then it will pop up a graphical window, kind of like Notepad would.

Therefore, you want to type the command vim or vim file_name and you should get what you want.

Make sure your $PATH is set to include the folder with vim.exe.

Related Question