windows10 安装配置vim8.2安装64位vim当python安装的是64位,那么一定要下载和安装64位的vim,因为有些插件会用到python的dll,否者,可能会出现问题。现在大家的电脑应该都是64位了,建议大家统一64位。 64位vim windows下载路径https://github.com/vim/vim-win32-installer/releases选择gvim_8.2***_x64.exe 64位python3.8
安装vim,假设安装在D:\Software\Vim\下下载vim-plug这个插件https://github.com/junegunn/vim-plug/blob/master/plug.vim保存到~\vimfiles\autoload\这个目录下,如果没有就先创建
修改vim配置文件,windows下是~\_vimrc" Vim with all enhancementssource $VIMRUNTIME/vimrc_example.vimsource ~\vimfiles\autoload\plug.vim" 之后通过vim-plug安装的插件就会安装到`~\vimfiles\plugged`这个目录下" vim-plug的README上说,要避免使用`plugin`这个目录的名称,防止和vim标准的插件混淆call plug#begin('~\vimfiles\plugged') " Shorthand notation; fetches https://github.com/junegunn/vim-easy-alignPlug 'junegunn/vim-easy-align'" Any valid git URL is allowedPlug 'https://github.com/junegunn/vim-github-dashboard.git'" Multiple Plug commands can be written in a single line using | separatorsPlug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'" On-demand loadingPlug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }" Using a non-master branchPlug 'rdnetto/YCM-Generator', { 'branch': 'stable' }" markdown-previewPlug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }call plug#end()" 设置配色方案colorscheme morning" 字体类型和大小set guifont=Consolas:h12set nuset relativenumber" 换行时,自动缩进4列; 使用`<`或者`>`缩进时,缩进4列set shiftwidth=4 set tabstop=4" 把输入的tab字符替换空格,具体空格数,跟tabstop设置的值有关expandtab" 会影响到Backspace键删除多个空格和删除tab字符的行为set softtabstop=4set fileencodings=utf-8,chinese,latin-1set encoding=utf-8set belloff=allsyntax onif has("win32")set fileencoding=chineseelseset fileencoding=utf-8endif" 解决菜单乱码source $VIMRUNTIME/delmenu.vimsource $VIMRUNTIME/menu.vim" Use the internal diff if available." Otherwise use the special 'diffexpr' for Windows.if &diffopt !~# 'internal'set diffexpr=MyDiff()endiffunction MyDiff()let opt = '-a --binary 'if &diffopt =~ 'icase' | let opt = opt . '-i ' | endifif &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endiflet arg1 = v:fname_inif arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endiflet arg1 = substitute(arg1, '!', '\!', 'g')let arg2 = v:fname_newif arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endiflet arg2 = substitute(arg2, '!', '\!', 'g')let arg3 = v:fname_outif arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endiflet arg3 = substitute(arg3, '!', '\!', 'g')if $VIMRUNTIME =~ ' ' if &sh =~ '\<cmd' if empty(&shellxquote) let l:shxq_sav = '' set shellxquote& endif let cmd = '"' . $VIMRUNTIME . '\diff"' else let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' endifelse let cmd = $VIMRUNTIME . '\diff'endiflet cmd = substitute(cmd, '!', '\!', 'g')silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3if exists('l:shxq_sav') let &shellxquote=l:shxq_savendifendfunction然后执行:PlugInstall 安装这些插件,过程有点慢,如果等不了,可以先把插件download下来, 直接放在~\vimfiles\plugged\这个目录下
...