|
| 1 | +" Vim Jump |
| 2 | + |
| 3 | +" Github: https://github.com/jiaobuzuji |
| 4 | +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
| 5 | +" vim:fdm=marker fmr={,} |
| 6 | + |
| 7 | +" jump to somewhere:file,mru,bookmark |
| 8 | +" Plug 'Yggdroot/LeaderF' " {1 |
| 9 | +" Plug 'Yggdroot/LeaderF-marks',{'on': 'LeaderfMarks'} |
| 10 | +" " show global mark |
| 11 | +" nnoremap <leader>pm :LeaderfMarks<Cr> |
| 12 | + |
| 13 | +" "function |
| 14 | +" nnoremap <c-k> :LeaderfFunction<cr> |
| 15 | +" nnoremap <Leader>pk :LeaderfFunction<cr> |
| 16 | +" " buffer |
| 17 | +" nnoremap <Leader>pb :LeaderfBuffer<Cr> |
| 18 | +" " recent file |
| 19 | +" nnoremap <c-l> :LeaderfMru<cr> |
| 20 | +" nnoremap <Leader>pr :LeaderfMru<cr> |
| 21 | +" "file |
| 22 | +" nnoremap <Leader>pp :LeaderfFile<cr> |
| 23 | +" "leaderf cmd |
| 24 | +" nnoremap <Leader>ps :LeaderfSelf<cr> |
| 25 | +" nnoremap <Leader>pt :LeaderfBufTag<cr> |
| 26 | +" "colorsceme |
| 27 | +" nnoremap <Leader>pc :LeaderfColorscheme<cr> |
| 28 | +" "CtrlP cmd |
| 29 | +" let g:Lf_ShortcutF = '<C-P>' |
| 30 | +" let g:Lf_ShortcutB = '<C-j>' |
| 31 | +" let g:Lf_CacheDiretory=$VIMFILES |
| 32 | +" let g:Lf_DefaultMode='FullPath' |
| 33 | +" let g:Lf_StlColorscheme = 'default' |
| 34 | +" let g:Lf_StlSeparator = { 'left': '', 'right': '' } |
| 35 | +" let g:Lf_UseMemoryCache = 0 |
| 36 | +" nnoremap <Leader><Leader> :LeaderfFile<cr> |
| 37 | + |
| 38 | +" Plug 'Shougo/denite.nvim' " {1 |
| 39 | +" Plug 'Shougo/neomru.vim' |
| 40 | + " autocmd misc_group VimEnter * silent! source $VIMFILES/rc/denite.vim |
| 41 | + " "keymapping for denite |
| 42 | + " nnoremap <c-p> :Denite file_rec<cr> |
| 43 | + " nnoremap <Leader><Leader> :Denite file_rec<cr> |
| 44 | + " nnoremap <c-j> :Denite buffer<cr> |
| 45 | + " nnoremap <c-l> :Denite file_mru<cr> |
| 46 | + " nnoremap <c-k> :Denite outline<cr> |
| 47 | + " nnoremap <Leader>pc :Denite colorscheme -no-quit<cr> |
| 48 | + " nnoremap <Leader>ff :Denite file<cr> |
| 49 | + " "mru |
| 50 | + " nnoremap <Leader>pr :Denite file_mru<cr> |
| 51 | + " "file |
| 52 | + " nnoremap <Leader>pp :Denite file_rec<cr> |
| 53 | + " "function |
| 54 | + " nnoremap <Leader>pp :Denite outline<cr> |
| 55 | + " "vim help |
| 56 | + " nnoremap <Leader>ph :Denite help<cr> |
| 57 | + " "command history |
| 58 | + " nnoremap <Leader>p: :Denite command_history<cr> |
| 59 | + " "fly on grep |
| 60 | + " nnoremap <Leader>pf :call denite#start([{'name': 'grep', 'args': ['', '', '!']}])<cr> |
| 61 | + |
| 62 | + " " call denite#custom#var('file_rec', 'command', |
| 63 | + " " \ ['rg', '--hidden', '--files', '--glob', '!.git', '--glob', ''] |
| 64 | + " " \ ) |
| 65 | + |
| 66 | +Plug 'ctrlpvim/ctrlp.vim' " {1 |
| 67 | +Plug 'tacahiroy/ctrlp-funky',{'on': 'CtrlPFunky'} |
| 68 | +Plug 'fisadev/vim-ctrlp-cmdpalette',{'on': 'CtrlPCmdPalette'} |
| 69 | +Plug 'zeero/vim-ctrlp-help',{'on': 'CtrlPHelp'} |
| 70 | +"ctrlp thirdparty matchers |
| 71 | +Plug 'FelikZ/ctrlp-py-matcher' |
| 72 | +let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } |
| 73 | + " Set Ctrl-P to show match at top of list instead of at bottom, which is so |
| 74 | + " stupid that it's not default |
| 75 | + let g:ctrlp_match_window_reversed = 0 |
| 76 | + let g:ctrlp_max_files = 70000 |
| 77 | + let g:ctrlp_search_hidden="" |
| 78 | + |
| 79 | + " Tell Ctrl-P to keep the current VIM working directory when starting a |
| 80 | + " search, another really stupid non default |
| 81 | + let g:ctrlp_working_path_mode = 'w' |
| 82 | + |
| 83 | + let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:20,results:20' |
| 84 | + " Ctrl-P ignore target dirs so VIM doesn't have to! Yay! |
| 85 | + let g:ctrlp_custom_ignore = { |
| 86 | + \ 'dir': '\v[\/]\.(git|svn|hg|build|sass-cache)$', |
| 87 | + \ 'file': '\v\.(exe|so|dll|o|d|proj|out)$', |
| 88 | + \ } |
| 89 | + let g:ctrlp_extensions = ['tag', 'buffertag', 'dir', 'bookmarkdir'] |
| 90 | + |
| 91 | + let g:ctrlp_use_caching = 50000 |
| 92 | + " let g:ctrlp_use_caching = 0 |
| 93 | + " let g:ctrlp_use_caching = 1 |
| 94 | + |
| 95 | + function! s:update_ctrlp_command() abort |
| 96 | + if executable('rg') |
| 97 | + let g:ctrlp_user_command = 'rg '.g:ctrlp_search_hidden.' %s --files --color=never --glob "!.git"' |
| 98 | + elseif executable('ag') |
| 99 | + "NOTE: --ignore option use wildcard PATTERN instead of regex PATTERN,and |
| 100 | + "it does not support {} |
| 101 | + "--hidden:enable seach hidden dirs and files |
| 102 | + "-g <regex PATTERN>:search file name that match the PATTERN |
| 103 | + let g:ctrlp_user_command = 'ag '.g:ctrlp_search_hidden.' %s -l --nocolor --nogroup |
| 104 | + \ --ignore "*.[odODaA]" |
| 105 | + \ --ignore "*.exe" |
| 106 | + \ --ignore "*.out" |
| 107 | + \ --ignore "*.hex" |
| 108 | + \ --ignore "cscope*" |
| 109 | + \ --ignore "*.so" |
| 110 | + \ --ignore "*.dll" |
| 111 | + \ --ignore ".git" |
| 112 | + \ -g ""' |
| 113 | + endif |
| 114 | + endfunction |
| 115 | + call s:update_ctrlp_command() |
| 116 | + |
| 117 | + let g:user_command_async = 1 |
| 118 | + let g:ctrlp_show_hidden = 1 |
| 119 | + let g:ctrlp_funky_syntax_highlight = 0 |
| 120 | + let g:ctrlp_funky_matchtype = 'path' |
| 121 | + |
| 122 | + "handle bug of gitgutter |
| 123 | + function! s:ctrlp_funky() |
| 124 | + let g:gitgutter_async=0 |
| 125 | + :CtrlPFunky |
| 126 | + let g:gitgutter_async=1 |
| 127 | + endfunction |
| 128 | + nnoremap <c-k> :call <SID>ctrlp_funky()<cr> |
| 129 | + nnoremap <c-j> :CtrlPBuffer<Cr> |
| 130 | +
|
| 131 | + function! s:toggle_ctrlp_search_hidden() abort |
| 132 | + if g:ctrlp_search_hidden ==# "" |
| 133 | + let g:ctrlp_search_hidden = "--hidden" |
| 134 | + else |
| 135 | + let g:ctrlp_search_hidden = "" |
| 136 | + endif |
| 137 | + endfunction |
| 138 | + nnoremap <leader>ti :call <SID>toggle_ctrlp_search_hidden()<cr>:call <SID>update_ctrlp_command()<cr> |
| 139 | + " show global mark |
| 140 | + nnoremap <leader>pm :SignatureListGlobalMarks<Cr> |
| 141 | + " ctrlp buffer |
| 142 | + nnoremap <Leader>pb :CtrlPBuffer<Cr> |
| 143 | + nnoremap <c-l> :CtrlPMRUFiles<cr> |
| 144 | + "CtrlP mru |
| 145 | + nnoremap <Leader>pr :CtrlPMRUFiles<cr> |
| 146 | + "CtrlP file |
| 147 | + nnoremap <Leader>pp :CtrlP<cr> |
| 148 | + " narrow the list down with a word under cursor |
| 149 | + "CtrlP function |
| 150 | + nnoremap <Leader>pU :execute 'CtrlPFunky ' . expand('<cword>')<Cr> |
| 151 | + "CtrlP colorsceme |
| 152 | + "nnoremap <Leader>pc :call te#ctrlp#colorscheme#start()<cr> |
| 153 | + "CtrlP function |
| 154 | + nnoremap <Leader>pk :CtrlPFunky<cr> |
| 155 | + "CtrlP cmd |
| 156 | + nnoremap <Leader><Leader> :CtrlP<cr> |
| 157 | + "spacemacs :SPC ff |
| 158 | + nnoremap <Leader>ff :call te#ctrlp#dir#start()<cr> |
| 159 | + " CtrlP TODO {2 |
| 160 | + " "CtrlP git branch |
| 161 | + " nnoremap <Leader>pgb :call te#ctrlp#git#start(1)<cr> |
| 162 | + " "CtrlP git show diff of specified commit |
| 163 | + " nnoremap <Leader>pgl :call te#ctrlp#git#start(2)<cr> |
| 164 | + " "CtrlP git log checkout |
| 165 | + " nnoremap <Leader>pgc :call te#ctrlp#git#start(3)<cr> |
| 166 | + " "CtrlP git remote branch |
| 167 | + " nnoremap <Leader>pgr :call te#ctrlp#git#start(4)<cr> |
| 168 | + "vim help |
| 169 | + nnoremap <Leader>ph :CtrlPHelp<cr> |
| 170 | +
|
| 171 | +" vim-easymotion {1 |
| 172 | +Plug 'easymotion/vim-easymotion', { 'on': [ '<Plug>(easymotion-lineforward)', |
| 173 | + \ '<Plug>(easymotion-linebackward)','<Plug>(easymotion-overwin-w)' ]} |
| 174 | + map W <Plug>(easymotion-lineforward) |
| 175 | + map B <Plug>(easymotion-linebackward) |
| 176 | + " MultiWindow easymotion for word |
| 177 | + nmap <Leader>jw <Plug>(easymotion-overwin-w) |
| 178 | + xmap <Leader>jw <Plug>(easymotion-bd-w) |
| 179 | + omap <Leader>jw <Plug>(easymotion-bd-w) |
| 180 | + " Multi Input Find Motion:s |
| 181 | + nmap <Leader>js <Plug>(easymotion-sn) |
| 182 | + xmap <Leader>js <Plug>(easymotion-sn) |
| 183 | + omap <Leader>js <Plug>(easymotion-sn) |
| 184 | + " Multi Input Find Motion:t |
| 185 | + nmap <Leader>jt <Plug>(easymotion-tn) |
| 186 | + xmap <Leader>jt <Plug>(easymotion-tn) |
| 187 | + omap <Leader>jt <Plug>(easymotion-tn) |
| 188 | + " MultiWindow easymotion for line |
| 189 | + nmap <Leader>jl <Plug>(easymotion-overwin-line) |
| 190 | + xmap <Leader>jl <Plug>(easymotion-bd-jk) |
| 191 | + omap <Leader>jl <Plug>(easymotion-bd-jk) |
| 192 | + " MultiWindow easymotion for char |
| 193 | + nmap <Leader>jj <Plug>(easymotion-overwin-f) |
| 194 | + xmap <Leader>jj <Plug>(easymotion-bd-f) |
| 195 | + omap <Leader>jj <Plug>(easymotion-bd-f) |
| 196 | + map <LocalLeader><LocalLeader> <Plug>(easymotion-prefix) |
| 197 | +
|
| 198 | + let g:EasyMotion_startofline = 0 |
| 199 | + let g:EasyMotion_show_prompt = 0 |
| 200 | + let g:EasyMotion_verbose = 0 |
| 201 | + |
| 202 | +" Plug 't9md/vim-choosewin',{'on': '<Plug>(choosewin)'} " {1 |
| 203 | +" let g:choosewin_overlay_enable = 1 |
| 204 | +" nmap <Leader>wc <Plug>(choosewin) |
| 205 | + |
| 206 | +Plug 'kshenoy/vim-signature' " {1 |
| 207 | + let g:SignatureEnabledAtStartup = 1 |
| 208 | + let g:SignatureMarkTextHLDynamic = 1 |
| 209 | + let g:SignatureMarkerTextHLDynamic = 1 |
| 210 | + |
| 211 | +Plug 'MattesGroeger/vim-bookmarks', { 'on': ['BookmarkShowAll', 'BookmarkToggle', 'BookmarkAnnotate']} " {1 |
| 212 | + let g:bookmark_auto_save = 1 |
| 213 | + let g:bookmark_no_default_key_mappings = 1 |
| 214 | + let g:bookmark_save_per_working_dir = 1 |
| 215 | + let g:bookmark_sign = '>>' |
| 216 | + let g:bookmark_annotation_sign = '##' |
| 217 | + let g:bookmark_auto_close = 1 |
| 218 | + "Bookmark annotate |
| 219 | + nnoremap <leader>mi :BookmarkAnnotate<CR> |
| 220 | + "Bookmark toggle |
| 221 | + nnoremap <leader>ma :BookmarkToggle<cr> |
| 222 | + "Bookmark annotate |
| 223 | + vnoremap <leader>mi :<c-u>exec ':BookmarkAnnotate '.getline("'<")[getpos("'<")[2]-1:getpos("'>")[2]-1]<cr> |
| 224 | + "Bookmark clear |
| 225 | + nnoremap <leader>mc :BookmarkClear<cr> |
| 226 | + "Bookmark show all |
| 227 | + nnoremap <leader>mb :BookmarkShowAll<CR> |
| 228 | +
|
| 229 | +" if get(g:,'feat_enable_airline') == 0 " {1 |
| 230 | +" Plug 'tracyone/vim-buftabline' |
| 231 | +" let g:buftabline_numbers=2 |
| 232 | +" let g:buftabline_show=1 |
| 233 | +" let g:buftabline_indicators=1 |
| 234 | +" endif |
| 235 | + |
| 236 | +Plug 'ronakg/quickr-preview.vim', { 'for': ['qf']} " {1 |
| 237 | + let g:quickr_preview_keymaps = 0 |
| 238 | + autocmd filetype_group FileType qf nmap <buffer> <down> <down><plug>(quickr_preview) |
| 239 | + autocmd filetype_group FileType qf nmap <buffer> <up> <up><plug>(quickr_preview) |
| 240 | + autocmd filetype_group FileType qf nmap <buffer> <Space><Space> <plug>(quickr_preview) |
| 241 | +
|
| 242 | +" TODO {1 |
| 243 | +" if get(g:,'feat_enable_airline') == 0 |
| 244 | +" Plug 'tracyone/vim-buftabline' |
| 245 | +" let g:buftabline_numbers=2 |
| 246 | +" let g:buftabline_show=1 |
| 247 | +" let g:buftabline_indicators=1 |
| 248 | +" endif |
| 249 | +" |
0 commit comments