PowerShell使用vim

PowerShell使用vim

http://www.wowotech.net/soft/vim_in_powershell.html

  1. 下载安装Windows下的vim;
  2. 设置PowerShell环境,能使用“allow scripts to run”,步骤如下:
Set-ExecutionPolicy RemoteSigned
提示输入Y
  1. 使用new-item命令,创建PowerShell的配置文件Profile
new-item -path $profile -itemtype file -force
  1. 编辑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
}
  1. 重启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

猜你喜欢

转载自my.oschina.net/u/2311195/blog/1619983