1、去Vim官網(wǎng)下載適合操作系統(tǒng)的可執(zhí)行文件
地址:https://www.vim.org/download.php#pc
2、找到Vim文件夾中的vimrc文件進(jìn)行修改,增加下面這4行。
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,chinese,cp936
3、在C:\Windows\System32\WindowsPowerShell\v1.0目錄下新建profile.ps1文件,復(fù)制下面的代碼到profile.ps1文件中。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# There's usually much more than this in my profile! $SCRIPTPATH = "C:\Program Files (x86)\Vim" $VIMPATH = $SCRIPTPATH + "\vim80\vim.exe" Set-Alias vi $VIMPATH Set-Alias vim $VIMPATH # for editing your PowerShell profile Function Edit-Profile { vim $profile } # for editing your Vim settings Function Edit-Vimrc { vim $home\_vimrc } |
4、重啟Shell,執(zhí)行Set-ExecutionPolicy RemoteSigned命令修改模式就可以了。
Set-ExecutionPolicy RemoteSigned
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。