PowerShell: Vim Editor

Vim which is default Linux Text Editor, is very handy when come to editing text file and I would like to have the same text editor in my Windows 10 workstations when dealing with PowerShell

Please refer to the following steps to install and enable vim as my text editor in PowerShell instead of using NotePad

  1. Download and install vim7.4 for Windows

vim7.4 for Windows

  1. Refer to the following PowerShell to set the alias for vim
#To verify whether PowerShell Profile had been created
$profile
#Creating a new PowerShell Profile
new-item -path $profile -itemtype file -force
#Open the PowerShell Profile
notepad $profile
#Set the Alias for vim and save it
set-alias vim "C:/Program Files (x86)/Vim/vim74/.\vim.exe"

  1. Close and open again a new PowerShell console with the following command to edit the hostfile without using NotePad

vim C:\Windows\System32\drivers\etc\hosts

PowerShell Syntax Highlight in vim 

  1. Download and extract the following to C:\Program Files (x86)\Vim\vimfiles

PowerShell Syntax Highligh

  1. Open PowerShell Script (.ps1) and you can see the following.

PowerShell-VIM.jpg

Reference Links

  1. VIM
  2. PowerShell Profile
  3. vim tutorials
  4. PowerShell Syntax Highlight
Share This