set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg1 = substitute(arg1, '!', '\!', 'g') let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg2 = substitute(arg2, '!', '\!', 'g') let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif let 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"' endif else let cmd = $VIMRUNTIME . '\diff' endif let cmd = substitute(cmd, '!', '\!', 'g') silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 if exists('l:shxq_sav') let &shellxquote=l:shxq_sav endif endfunction
"行号、颜色风格、语法支持 set nu! colorscheme desert syntax enable syntax on " 设置字体和字号 set guifont=courier_new:h10
" 设置Tab缩进4个空格 set expandtab set ts=4 set cursorline "高亮光标所在行 set cursorcolumn "突出显示当前列 set nobackup " 不要备份 set noundofile " 不生成undo文件 set noswapfile " 不创建临时交换文件 set nowritebackup set wrap " 自动换行 "不显示工具/菜单栏 set guioptions-=T "set guioptions-=m "set guioptions-=L "set guioptions-=r "set guioptions-=b " Vim 的默认寄存器和系统剪贴板共享 set clipboard+=unnamed " Lang & Encoding {{{ set fileencodings=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1,cp936 set encoding=utf-8 let$LANG = 'en_US.UTF-8' language messages zh_CN.UTF-8 "解决菜单乱码 source $VIMRUNTIME/delmenu.vim source $VIMRUNTIME/menu.vim " }}}
" for plugn 'vim-easy-align' {{{ " 对齐插件 " Start interactive EasyAlign in visual mode (e.g. vipga) xmap ga <Plug>(EasyAlign) " Start interactive EasyAlign for a motion/text object (e.g. gaip) nmap ga <Plug>(EasyAlign) "}}} "for plugn 'dense-analysis/ale' {{{ " 异步语法检查插件 "keep the sign gutter open let g:ale_sign_column_always = 1 let g:ale_sign_error = '>>' let g:ale_sign_warning = '--' "打开文件时进行检查 let g:ale_lint_on_enter = 1 " show errors or warnings in my statusline let g:airline#extensions#ale#enabled = 1 " only enable these linters let g:ale_linters = { \ 'verilog': ['iverilog'] \} "}}}