|
| 1 | +" 关闭NERDTree快捷键 |
| 2 | +" map <leader>t :NERDTreeToggle<CR> |
| 3 | +" 显示行号 |
| 4 | +let NERDTreeShowLineNumbers=1 |
| 5 | +let NERDTreeAutoCenter=1 |
| 6 | +" 是否显示隐藏文件 |
| 7 | +let NERDTreeShowHidden=1 |
| 8 | +" 设置宽度 |
| 9 | +let NERDTreeWinSize=31 |
| 10 | +" 在终端启动vim时,共享NERDTree |
| 11 | +let g:nerdtree_tabs_open_on_console_startup=1 |
| 12 | +" 忽略一下文件的显示 |
| 13 | +let NERDTreeIgnore=['\.pyc','\~$','\.swp'] |
| 14 | +" 显示书签列表 |
| 15 | +let NERDTreeShowBookmarks=1 |
| 16 | + |
| 17 | +let g:NERDTreeIndicatorMapCustom = { |
| 18 | + \ "Modified" : "?", |
| 19 | + \ "Staged" : "?", |
| 20 | + \ "Untracked" : "?", |
| 21 | + \ "Renamed" : "?", |
| 22 | + \ "Unmerged" : "═", |
| 23 | + \ "Deleted" : "?", |
| 24 | + \ "Dirty" : "?", |
| 25 | + \ "Clean" : "??", |
| 26 | + \ "Unknown" : "?" |
| 27 | + \ } |
| 28 | +" Show the line number |
| 29 | +set nu |
| 30 | +" Enable wrap |
| 31 | +set wrap |
| 32 | +" Auto open NERDTree when enter vim |
| 33 | +" Use vim, not vim ./dir |
| 34 | +autocmd vimenter * NERDTree |
| 35 | +" NERDTree config |
| 36 | +map <silent><F2> :NERDTreeToggle<CR> |
| 37 | +imap <F2> <ESC> :NERDTreeToggle<CR> |
| 38 | +"Use the pre dir tree |
| 39 | +"nmap <F2> :NERDTreeToggle<CR> :NERDTreeMirror<CR> |
| 40 | + autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif |
| 41 | + |
| 42 | + |
| 43 | +"安装tagbar插件 |
| 44 | +""设置tagbar使用的ctags的插件,必须要设置对 |
| 45 | +let g:tagbar_ctags_bin='/usr/bin/ctags' |
| 46 | +"设置tagbar的窗口宽度 |
| 47 | +"let g:tagbar_width=30 |
| 48 | +""设置tagbar的窗口显示的位置,为左边 |
| 49 | +let g:tagbar_right=1 |
| 50 | +"打开文件自动 打开tagbar |
| 51 | +"autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.cxx call tagbar#autoopen() |
| 52 | +let Tlist_Show_One_File=1 |
| 53 | +let Tlist_OnlyWindow=1 |
| 54 | +let Tlist_Use_Right_Window=1 |
| 55 | +let Tlist_Sort_Type='name' |
| 56 | +let Tlist_Exit_OnlyWindow=1 |
| 57 | +let Tlist_Show_Menu=1 |
| 58 | +let Tlist_Max_Submenu_Items=10 |
| 59 | +let Tlist_Max_Tag_length=20 |
| 60 | +let Tlist_Use_SingleClick=0 |
| 61 | +let Tlist_Auto_Open=0 |
| 62 | +let Tlist_Close_On_Select=0 |
| 63 | +let Tlist_File_Fold_Auto_Close=1 |
| 64 | +let Tlist_GainFocus_On_ToggleOpen=1 |
| 65 | +let Tlist_Process_File_Always=1 |
| 66 | +let Tlist_WinHeight=10 |
| 67 | +let Tlist_WinWidth=30 |
| 68 | +let Tlist_Use_Horiz_Window=0 |
| 69 | +map <silent><F3> :TagbarToggle<CR> |
| 70 | +imap <F3> <ESC> :TagbarToggle<CR> |
| 71 | +autocmd StdinReadPre * let s:std_in=1 |
| 72 | +autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif |
| 73 | +colorschem murphy |
| 74 | +"In normal mode, ; is equal to : |
| 75 | +nmap ; : |
| 76 | + |
| 77 | +" Buf explore |
| 78 | +nnoremap <silent> <leader>f :CtrlPMRU<CR> |
| 79 | + |
| 80 | +" airline statusline etc. |
| 81 | +let g:airline#extensions#tabline#enabled = 1 |
| 82 | +let g:airline#extensions#tabline#formatter = 'unique_tail_improved' |
| 83 | + |
| 84 | + |
| 85 | +" Close the current buffer |
| 86 | +map <leader>bd :Bclose<cr>:tabclose<cr>gT |
| 87 | + |
| 88 | +" Close all the buffers |
| 89 | +map <leader>ba :bufdo bd<cr> |
| 90 | + |
| 91 | +map <leader>l :bnext<cr> |
| 92 | +map <leader>h :bprevious<cr> |
| 93 | + |
| 94 | +" Useful mappings for managing tabs |
| 95 | +map <leader>tn :tabnew<cr> |
| 96 | +map <leader>to :tabonly<cr> |
| 97 | +map <leader>tc :tabclose<cr> |
| 98 | +map <leader>tm :tabmove |
| 99 | +map <leader>t<leader> :tabnext |
| 100 | + |
| 101 | +" Let 'tl' toggle between this and the last accessed tab |
| 102 | +let g:lasttab = 1 |
| 103 | +nmap <Leader>tl :exe "tabn ".g:lasttab<CR> |
| 104 | +au TabLeave * let g:lasttab = tabpagenr() |
| 105 | + |
| 106 | +"""""""""""""""""""""""""""""" |
| 107 | +" => bufExplorer plugin |
| 108 | +"""""""""""""""""""""""""""""" |
| 109 | +" Disalbe the bufExplorer, Because it conflict with many other vim plugs |
| 110 | +" When enable it often pop the warning as follow: |
| 111 | +" Error detected while processing function <SNR>49_BEActivateBuffer: |
| 112 | +" line 18: |
| 113 | +" E684: list index out of range: 2 |
| 114 | +" This will disable the bufExplorer |
| 115 | +let g:bufexplorer_version = "disabled" |
| 116 | +let g:bufExplorerDefaultHelp=0 |
| 117 | +let g:bufExplorerShowRelativePath=1 |
| 118 | +let g:bufExplorerFindActive=1 |
| 119 | +let g:bufExplorerSortBy='name' |
| 120 | +"map <leader>o :BufExplorer<cr> |
| 121 | + |
| 122 | +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 123 | +" => Vimroom |
| 124 | +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 125 | +let g:goyo_width=100 |
| 126 | +let g:goyo_margin_top = 2 |
| 127 | +let g:goyo_margin_bottom = 2 |
| 128 | +nnoremap <silent> <leader>z :Goyo<cr> |
| 129 | + |
| 130 | +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 131 | +" => Global copy/paste |
| 132 | +" Use the global clipbord by install vim-gnome |
| 133 | +" See: https://www.cnblogs.com/songlen/p/6883522.html |
| 134 | +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 135 | +set clipboard=unnamedplus |
| 136 | + |
| 137 | +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 138 | +" => cscope quickfix |
| 139 | +"See: |
| 140 | +" https://stackoverflow.com/questions/28185067/vim-go-to-next-search-result-across-multiple-files |
| 141 | +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 142 | +" Replaced by the gutentags_plus plug@2019-08-02 |
| 143 | +" set cscopequickfix=s-,c-,d-,i-,t-,e- |
| 144 | + |
| 145 | +" view the list of matches with: |
| 146 | +" :cw[indow] Open the quickfix window |
| 147 | +map <silent><F5> :cw<CR> |
| 148 | +imap <F5> <ESC> :cw<CR> |
| 149 | +" :ccl[ose] Close the quickfix window |
| 150 | +nmap <S-c> :ccl<cr> |
| 151 | +map <silent><F4> :ccl<CR> |
| 152 | +imap <F4> <ESC> :ccl<CR> |
| 153 | +" :[count]cn[ext][!] |
| 154 | +nmap <S-z> :cn<cr> |
| 155 | +" :[count]cp[revious][!] |
| 156 | +nmap <S-x> :cp<cr> |
| 157 | + |
| 158 | +" Use the new colorscheme plug |
| 159 | +colorscheme forest-night |
| 160 | +let g:airline_theme = 'forest_night' |
| 161 | + |
| 162 | + |
0 commit comments