Editing files in a Windows PowerShell console with vim

One of things I like about using Linux is that I can quickly edit files in the shell with vi. Say what you will about the user experience of vi (yeah okay its clunky as hell and impossible to save/close) but it generally gets the job done. In the Windows console, there is no native method to directly edit (and I mean type not write text via Add-Content) a file without leaving the shell, whether that be cmd or PowerShell. Sure, you can do “notepad textfile.txt” and notepad will open in the GUI, but that’s lame as hell.

With PowerShell Core on Linux and Mac, you can simple use vi while in PowerShell, which is fantastic and seems to work just like it would be bash.

For those of you who dare, you can install vim (just an updated version of vi) on Windows and it will just like it does on Linux or Mac.

To do it with Chocolatey (because thats really the only way you should be installing software IMO) just run this:

Now, I can edit files right in PowerShell:

One Response to “Editing files in a Windows PowerShell console with vim

Leave a Reply

Your email address will not be published. Required fields are marked *