2022-01-03 enable vim on windows powershell

powershell profile setting

C:\Users\Kenny\Documents\PowerShell\profile.ps1 (current user)
Set-ExecutionPolicy RemoteSigned 管理员授权
C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 (all user)

find vim path

git 是自带vim的。
path = C:\Program Files\Git\usr\bin\vim

vimrc 配置

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

ps profile 配置:

# There's usually much more than this in my profile!
$SCRIPTPATH = "C:\Program Files\Git\usr\bin"
$VIMPATH    = $SCRIPTPATH + "\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
}

Set-ExecutionPolicy RemoteSigned 管理员授权

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容