PowerShell使用vim
- 下载安装Windows下的vim;
- 设置PowerShell环境,能使用“allow scripts to run”,步骤如下:
Set-ExecutionPolicy RemoteSigned
提示输入Y
- 使用new-item命令,创建PowerShell的配置文件Profile
new-item -path $profile -itemtype file -force
- 编辑profile(notepad $profile),添加相关的alias
set-alias vim "D:/software/Vim/vim80/./vim.exe"
# To edit the Powershell Profile
# (Not that I'll remember this)
Function Edit-Profile
{
vim $profile
}
# To edit Vim settings
Function Edit-Vimrc
{
vim $HOME\_vimrc
}
- 重启powershell
vim编码问题提
gvim安装目录下的_vimrc文件中,添加如下配置:
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim7.1在windows下的编码设置。By Huadong.Liu
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif
"解决菜单乱码
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
"解决consle输出乱码
language messages zh_CN.utf-8