如何在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
以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
在CentOS6.5上使用Jexus安裝部署ASP.NET MVC4和WebApi
本文主要介紹如何在CentOS6.5安裝Jexus,并介紹其常用命令以及如何創(chuàng)建和部署ASP.NET MVC4項(xiàng)目,從而實(shí)現(xiàn)跨平臺(tái)部署。2016-05-05詳解阿里云服務(wù)器添加安全組規(guī)則(圖文教程)
這篇文章主要介紹了詳解阿里云服務(wù)器添加安全組規(guī)則(圖文教程),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2020-07-07