PowerShell using vim
- Download and install vim under Windows;
- To set up the PowerShell environment, you can use "allow scripts to run", the steps are as follows:
Set-ExecutionPolicy RemoteSigned
提示输入Y
- Use the new-item command to create a PowerShell configuration file Profile
new-item -path $profile -itemtype file -force
- Edit the profile (notepad $profile) and add the relevant 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
}
- restart powershell
vim encoding problem
In the _vimrc file in the gvim installation directory, add the following configuration:
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 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