X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=vim%2Fvimrc;fp=vim%2Fvimrc;h=e68c9cb60767f6270433cd15ad4b619c3e122a2c;hb=a3f9febb8a04d66a7af3e0ffee9167e84bf8ba12;hp=04735e91eca8cbd6104d4448e2c03e596f04a8ea;hpb=d1f34ddf486ccbcf2a1080a09d6414790ffb697f;p=dotfiles.git diff --git a/vim/vimrc b/vim/vimrc index 04735e9..e68c9cb 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -34,6 +34,10 @@ Bundle 'tpope/vim-markdown' "Bundle 'vim-scripts/genutils' "Bundle 'vim-scripts/Marks-Browser' Bundle 'MattesGroeger/vim-bookmarks' +"Bundle 'tpope/vim-repeat' +"Bundle 'kien/ctrlp.vim' +"disable since some conflicting mapping +Bundle 'vim-latex/vim-latex' call vundle#end() filetype plugin indent on @@ -41,6 +45,7 @@ filetype plugin indent on " }}} " Basic options ----------------------------------------------------------- {{{ set number +set relativenumber set tabstop=4 set softtabstop=4 set shiftwidth=4 @@ -75,7 +80,8 @@ set hlsearch set autoindent set confirm set nostartofline " don't jump to first character when paging -set nowrap +set wrap +set expandtab "set textwidth, formatoptions for chinese set formatoptions+=m set colorcolumn=+1 @@ -123,7 +129,7 @@ nmap q :q nmap e :e nmap W :w !sudo tee % nmap h :vertical help -nmap t :tabedit +nmap t :tabedit % "nmap x :x " windows @@ -152,8 +158,10 @@ nnoremap gT " map Alt+TAB "noremap "input C-V then input key sequence to "http://vim.wikia.com/wiki/Make_Shift-Tab_work -nnoremap :bn -nnoremap  :bp +"nnoremap :bn +nnoremap :tabnext +"nnoremap  :bp +nnoremap  :tabprevious "nmap :bp "nmap :b# "nmap d :bd @@ -176,6 +184,9 @@ nnoremap zR zRzz nnoremap zr zrzz nnoremap zn znzz +nnoremap zj zjzz +nnoremap zh zhzz + noremap z zmzvzz nmap \\ :nohlsearch " }}} @@ -220,6 +231,14 @@ vmap { vmap } "vmap y "*y vmap Y "*y +" +"vmap "qy +"vmap "qp +vnoremap Y "*y +vnoremap p "*p +"search for visually selectecd text +vnoremap // y/" +vnoremap a : " }}} " }}} " Plugins Configuration --------------------------------------------------- {{{ @@ -234,18 +253,18 @@ nnoremap sj :FufBuffer nnoremap sk :FufFileWithCurrentBufferDir nnoremap sK :FufFileWithFullCwd nnoremap s :FufFile -nnoremap sl :FufCoverageFileChange -nnoremap sL :FufCoverageFileChange -nnoremap s :FufCoverageFileRegister +"nnoremap sl :FufCoverageFileChange +"nnoremap sL :FufCoverageFileChange +"nnoremap s :FufCoverageFileRegister nnoremap sd :FufDirWithCurrentBufferDir nnoremap sD :FufDirWithFullCwd nnoremap s :FufDir nnoremap sn :FufMruFile nnoremap sN :FufMruFileInCwd nnoremap sm :FufMruCmd -nnoremap su :FufBookmarkFile +"nnoremap su :FufBookmarkFile nnoremap s :FufBookmarkFileAdd -vnoremap s :FufBookmarkFileAddAsSelectedText +"vnoremap s :FufBookmarkFileAddAsSelectedText nnoremap si :FufBookmarkDir nnoremap s :FufBookmarkDirAdd nnoremap sT :FufTag @@ -253,29 +272,30 @@ nnoremap st :FufTag! nnoremap s :FufTagWithCursorWord! nnoremap s, :FufBufferTag nnoremap s< :FufBufferTag! -vnoremap s, :FufBufferTagWithSelectedText! -vnoremap s< :FufBufferTagWithSelectedText +"vnoremap s, :FufBufferTagWithSelectedText! +"vnoremap s< :FufBufferTagWithSelectedText nnoremap s} :FufBufferTagWithCursorWord! +nnoremap sl :FufBufferTagAll "nnoremap s. :FufBufferTagAll -"nnoremap s> :FufBufferTagAll! +nnoremap s> :FufBufferTagAll! "vnoremap s. :FufBufferTagAllWithSelectedText! "vnoremap s> :FufBufferTagAllWithSelectedText "nnoremap s] :FufBufferTagAllWithCursorWord! nnoremap sG :FufTaggedFile nnoremap sg :FufTaggedFile! -nnoremap so :FufJumpList -nnoremap sp :FufChangeList -nnoremap sq :FufQuickfix -nnoremap sy :FufLine +"nnoremap so :FufJumpList +"nnoremap sp :FufChangeList +"nnoremap sq :FufQuickfix +"nnoremap sy :FufLine " nnoremap sh :FufHelp -nnoremap se :FufEditDataFile +"nnoremap se :FufEditDataFile nnoremap sr :FufRenewCache " }}} " YouCompleteMe ----------------------------------------------------------- {{{ "syntax on, must before the YCM, -let g:ycm_collect_identifiers_from_tags_files = 1 -let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' +"let g:ycm_collect_identifiers_from_tags_files = 1 +"let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py' let g:ycm_auto_trigger = 1 let g:ycm_seed_identifiers_with_syntax = 1 let g:ycm_show_diagnostics_ui = 0 @@ -312,7 +332,8 @@ let g:ycm_key_detailed_diagnostics = '' let g:airline_right_sep = '' let g:airline_right_alt_sep = '' - let g:airline#extensions#tabline#show_buffers = 1 +" let g:airline#extensions#tabline#show_buffers = 1 + let g:airline#extensions#tabline#show_buffers = 0 let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#left_sep = '' let g:airline#extensions#tabline#left_alt_sep ='' @@ -401,8 +422,8 @@ endif " }}} " Marks ------------------------------------------------------------------- {{{ nmap \h MarkSet -nmap * MarkSearchNext -nmap # MarkSearchPrev +"nmap * MarkSearchNext +"nmap # MarkSearchPrev " }}} " Gundo ------------------------------------------------------------------- {{{ " nnoremap :GundoToggle @@ -432,7 +453,27 @@ let g:bookmark_auto_close = 1 " nmap ,c BookmarkClear " nmap ,x BookmarkClearAll " }}} - +" EasyMotion -------------------------------------------------------------- {{{ +map en (easymotion-sn) +map ej (easymotion-j) +map ek (easymotion-k) +map eb (easymotion-b) +map ew (easymotion-w) +map el (easymotion-lineforward) +map eh (easymotion-linebackward) +"" }}} +" vim-latex --------------------------------------------------------------- {{{ +"set grepprg=grep\ -nH\ $* +"let g:tex_flavor='latex' +"set iskeyword+=: +"autocmd BufEnter *.tex set sw=2 +"disable default mapping +imap #$ IMAP_JumpForward +nmap #$ IMAP_JumpForward +vmap #$ IMAP_JumpForward +vmap #$ IMAP_DeleteAndJumpForward +let g:Imap_FreezeImap=1 +" }}} " }}} " FileType ---------------------------------------------------------------- {{{ autocmd BufNewFile,BufRead *.log set filetype=logecc @@ -455,7 +496,8 @@ autocmd FileType qf nnoremap q :q | setlocal nowrap | setl autocmd FileType help nnoremap q :q | vertical resize 85; autocmd FileType c,cpp setlocal foldmethod=syntax | \ let b:AutoClosePairs = AutoClose#DefaultPairsModified("\"", "{}") | - \ inoremap { {}kA + \ inoremap { {}kA | + \ nnoremap :let word=expand(""):wincmd o:vsp:exec("tag ". word)zzzr:wincmd w autocmd FileType python setlocal foldmethod=indent autocmd FileType xml setlocal foldmethod=syntax | @@ -564,7 +606,7 @@ nmap \q :call ToggleList("Quickfix List", 'c') "endif function! DiffToggle() if(&diff) - diffoff | wincmd h | wincmd o + diffoff | wincmd l | :q else exec ":VCSVimDiff" | wincmd h endif @@ -607,8 +649,27 @@ iabbrev "} " }}} " m nnoremap B ^ nnoremap E $ -nnoremap :cn -nnoremap :cp +nnoremap :cnzzzv +nnoremap :cpzzzv "http://dougblack.io/words/a-good-vimrc.html "nnoremap gV `[v`] +"nnoremap :let word=expand(""):vsp:wincmd w:exec("tag ". word) +"nnoremap :let word=expand(""):wincmd o:vsp:exec("tag ". word)zz:wincmd w +" command in normal mode, and visual mode +" yiw = viwy +" diw = viwd +" gn select search and in visual mode +" confirm when using :q to quit the last tab page, +"Alias q if\ winnr('$')>1||tabpagenr('$')>1||confirm('Really\ quit?',\ "&OK\\n&Cancel")==1|quit|endif + + + +" color of current line +"let s:marklist = '' +nnoremap m :marks abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:normal ' + +"let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript', +" \ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir'] + +