"https://segmentfault.com/a/1190000005793581 source $VIMRUNTIME/vimrc_example.vim "source $VIMRUNTIME/mswin.vim " " behave mswin 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 arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif 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 silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 if exists('l:shxq_sav') let &shellxquote=l:shxq_sav endif endfunction set encoding=utf-8 lang messages zh_CN.UTF-8 source $VIMRUNTIME/delmenu.vim source $VIMRUNTIME/menu.vim set guifont=Source_Code_Pro:h12:cANSI set nu " 語(yǔ)法高亮 set syntax=enable set syntax=on " 自動(dòng)縮進(jìn) set autoindent " C語(yǔ)言方式縮進(jìn) set cindent " 智能縮進(jìn) set smartindent " 統(tǒng)一縮進(jìn)為4 set softtabstop=4 set shiftwidth=4 set showtabline=2 " 高亮顯示匹配的括號(hào) set showmatch " 搜索逐字符高亮和實(shí)時(shí)搜索 set hlsearch set incsearch " 匹配括號(hào)高亮的時(shí)間(單位是十分之一秒) set matchtime=5 " 顯示括號(hào)配對(duì)情況 set showmatch " 代碼折疊 " set fdm=indent " 選擇代碼折疊類型 set foldmethod=syntax " 禁止自動(dòng)折疊 set foldlevel=100 " 歷史記錄數(shù) set history=1000 " 偵測(cè)文件類型 filetype on " 為特定文件類型載入相關(guān)縮進(jìn)格式 filetype indent on " 為特定的文件類型載入對(duì)應(yīng)的插件 filetype plugin on filetype plugin indent on " 不與vi兼容 set nocp set nowrap "winmanager設(shè)置 let g:winManagerWindowLayout='FileExplorer' nmap wm :WMToggle<cr> "NERD_commenter let mapleader = "," " < txtbrowser 插件配置 > " ----------------------------------------------------------------------------- " 用于文本文件生成標(biāo)簽與與語(yǔ)法高亮(調(diào)用TagList插件生成標(biāo)簽,如果可以) au BufRead,BufNewFile *.txt setlocal ft=txt " 自動(dòng)切換目錄為當(dāng)前編輯文件所在目錄 au BufRead,BufNewFile,BufEnter * cd %:p:h au BufRead,BufNewFile *.svh set filetype=verilog_systemverilog au BufRead,BufNewFile *.sv set filetype=verilog_systemverilog au BufRead,BufNewFile *.v set filetype=verilog_systemverilog vnoremap <S-Up> gk vnoremap <S-Down> gj imap <S-Up> <Esc>gh<S-Up> imap <S-Down> <Esc><Right>gh<S-Down> nmap <S-Up> gh<S-Up> nmap <S-Down> gh<S-Down> " Use CTRL-S for saving, also in Insert mode noremap <C-S> <Esc>:update<CR> "vnoremap <C-S> <Esc>:update<CR> inoremap <C-S> <C-O>:update<CR> set noerrorbells " 關(guān)閉錯(cuò)誤信息響鈴 set novisualbell " 關(guān)閉使用可視響鈴代替呼叫 set t_vb= " 置空錯(cuò)誤鈴聲的終端代碼 " Vim 的默認(rèn)寄存器和系統(tǒng)剪貼板共享 set clipboard+=unnamed " 設(shè)置 alt 鍵不映射到菜單欄 set winaltkeys=no " CTRL-A is Select all noremap <C-A> gggH<C-O>G inoremap <C-A> <C-O>gg<C-O>gH<C-O>G cnoremap <C-A> <C-C>gggH<C-O>G onoremap <C-A> <C-C>gggH<C-O>G snoremap <C-A> <C-C>gggH<C-O>G xnoremap <C-A> <C-C>ggVG " backspace and cursor keys wrap to previous/next line set backspace=indent,eol,start whichwrap+=<,>,[,] " backspace in Visual mode deletes selection vnoremap <BS> d " CTRL-X and SHIFT-Del are Cut vnoremap <C-X> "+x vnoremap <S-Del> "+x " CTRL-C and CTRL-Insert are Copy vnoremap <C-C> "+y vnoremap <C-Insert> "+y " CTRL-Z is Undo; not in cmdline though noremap <C-Z> u inoremap <C-Z> <C-O>u " CTRL-Y is Redo (although not repeat); not in cmdline though noremap <C-Y> <C-R> inoremap <C-Y> <C-O><C-R> " CTRL-V and SHIFT-Insert are Paste " map <C-V> "+gP map <S-Insert> "+gP cmap <S-Insert> <C-R>+
|
|