如何在power shell添加vim實(shí)現(xiàn)代碼示例
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文件中。
# 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í)有所幫助,也希望大家多多支持本站。
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。