1、下載安裝Vim
ftp直接下載:
ftp://ftp.vim.org/pub/vim/pc/gvim74.exe
官網下載:
https://www.vim.org/download.php#pc
下載後明確自己的Vim的文件位置。
2、以管理員的身份運行PowerShell
執行Set-ExecutionPolicy RemoteSigned命令,在對話框中選擇Y,如下:
-
Set-ExecutionPolicy RemoteSigned
3、在C:\Windows\System32\WindowsPowerShell\v1.0目錄下新建Microsoft.PowerShell_profile.ps1文件
可以使用記事本打開此Microsoft.PowerShell_profile.ps1文件進行編輯
set-alias vim "C:/Program Files/Git/usr/bin/vim.exe"
#將vim.exe文件位置修改爲自己的位置
# To edit the Powershell Profile
# (Not that I'll remember this)
Function Edit-Profile
{
vim $profile
}
# To edit Vim settings
Function Edit-Vimrc
{
vim $HOME\_vimrc
}