要先安装gvim

编辑C:\Program Files (x86)\Vim\_vimrc,添加

set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,chinese,cp936


在C:\WINDOWS\system32\WindowsPowerShell\v1.0中,新建文件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
}


不过这样会有执行权限的问题,再次在powershell中执行

set-executionpolicy remotesigned

就好了。

修改文件的时候多次会提示权限问题,可以先在别的地方编辑,然后在覆盖

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐