From c019e9539485f6b72f3ff4058d9dea36247ecb18 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Sat, 30 Aug 2014 14:06:58 +0800 Subject: [PATCH] Use Unite to replace ctrlp --- .vim/vundlerc | 144 +++++++++++++++++++++++++++++--------------------- 1 file changed, 85 insertions(+), 59 deletions(-) diff --git a/.vim/vundlerc b/.vim/vundlerc index 8b9d5ac..5cb5919 100644 --- a/.vim/vundlerc +++ b/.vim/vundlerc @@ -159,8 +159,9 @@ let g:UltiSnipsEditSplit="vertical" " Maintains a history of yanks Plugin 'YankRing.vim' -map p :YRShow +let g:yankring_replace_n_pkey = '' let g:yankring_history_dir = '~/.cache/vim' +map p :YRShow " s search, also have value in clipboard Plugin 'Raimondi/delimitMate' @@ -222,64 +223,89 @@ Plugin 'majutsushi/tagbar' " nmap :TagbarToggle Plugin 'AutoTag' -Plugin 'ctrlpvim/ctrlp.vim' -let g:ctrlp_extensions = ['changes', 'line', 'tag', 'buffertag'] -let g:ctrlp_lazy_update = 1 -let g:ctrlp_max_files = 0 -let g:ctrlp_max_depth = 20 -let g:ctrlp_use_caching = 1 -let g:ctrlp_show_hidden = 1 -let g:ctrlp_clear_cache_on_exit = 1 -let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' -let g:ctrlp_mruf_last_entered = 1 -let g:ctrlp_follow_symlinks = 1 -let g:ctrlp_max_height = 35 -let g:ctrlp_match_window_reversed = 0 -let g:ctrlp_working_path_mode = 'ra' -let g:ctrlp_custom_ignore = { - \ 'dir': '\v[\/](public\/system|node_modules|tmp|target|dist)|(\.(swp|ico|git|svn|hg))$', - \ 'file': '\.jpg$\|\.png$\|\.gif$\|tags$' - \ } - -Plugin 'JazzCore/ctrlp-cmatcher' -let g:ctrlp_match_func = {'match' : 'matcher#cmatch' } - -"let g:ctrlp_user_command = { -" \ 'types': { -" \ 1: ['.git', 'cd %s && git ls-files -oc --exclude-standard'], -" \ 2: ['.hg', 'hg --cwd %s locate -I .'], -" \ }, -" \ 'fallback': 'find %s -type f' -" \ } - -let g:ctrlp_prompt_mappings = { - \ 'PrtSelectMove("j")': [''], - \ 'PrtSelectMove("k")': [''], - \ 'PrtHistory(-1)': [''], - \ 'PrtHistory(1)': [''] - \} - -let g:ctrlp_cmd = 'CtrlP' -map b :CtrlPBuffer -map r :CtrlPMRUFiles -map gr :CtrlPRoot -map gf :CtrlPCurFile -map gl :CtrlPLine -map gt :CtrlPTag -map gb :CtrlPBufTag -map gq :CtrlPQuickfix -map gc :CtrlPChange -map gC :CtrlPChangeAll -map gm :CtrlPMixed -map gp :CtrlPRTS -let g:ctrlp_buftag_types = { - \ 'go' : '--language-force=go', - \ 'css' : '--language-force=css', - \ 'scss' : '--language-force=scss', - \ 'js' : '--language-force=js', - \ 'coffee' : '--language-force=coffee', - \ 'markdown' : '--language-force=markdown' - \ } +" Plugin 'ctrlpvim/ctrlp.vim' +" let g:ctrlp_extensions = ['changes', 'line', 'tag', 'buffertag'] +" let g:ctrlp_lazy_update = 1 +" let g:ctrlp_max_files = 0 +" let g:ctrlp_max_depth = 20 +" let g:ctrlp_use_caching = 1 +" let g:ctrlp_show_hidden = 1 +" let g:ctrlp_clear_cache_on_exit = 1 +" let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' +" let g:ctrlp_mruf_last_entered = 1 +" let g:ctrlp_follow_symlinks = 1 +" let g:ctrlp_max_height = 35 +" let g:ctrlp_match_window_reversed = 0 +" let g:ctrlp_working_path_mode = 'ra' +" let g:ctrlp_custom_ignore = { +" \ 'dir': '\v[\/](public\/system|node_modules|tmp|target|dist)|(\.(swp|ico|git|svn|hg))$', +" \ 'file': '\.jpg$\|\.png$\|\.gif$\|tags$' +" \ } +" +" Plugin 'JazzCore/ctrlp-cmatcher' +" let g:ctrlp_match_func = {'match' : 'matcher#cmatch' } +" +" "let g:ctrlp_user_command = { +" " \ 'types': { +" " \ 1: ['.git', 'cd %s && git ls-files -oc --exclude-standard'], +" " \ 2: ['.hg', 'hg --cwd %s locate -I .'], +" " \ }, +" " \ 'fallback': 'find %s -type f' +" " \ } +" +" let g:ctrlp_prompt_mappings = { +" \ 'PrtSelectMove("j")': [''], +" \ 'PrtSelectMove("k")': [''], +" \ 'PrtHistory(-1)': [''], +" \ 'PrtHistory(1)': [''] +" \} +" +" let g:ctrlp_cmd = 'CtrlP' +" map b :CtrlPBuffer +" map r :CtrlPMRUFiles +" map gr :CtrlPRoot +" map gf :CtrlPCurFile +" map gl :CtrlPLine +" map gt :CtrlPTag +" map gb :CtrlPBufTag +" map gq :CtrlPQuickfix +" map gc :CtrlPChange +" map gC :CtrlPChangeAll +" map gm :CtrlPMixed +" map gp :CtrlPRTS +" let g:ctrlp_buftag_types = { +" \ 'go' : '--language-force=go', +" \ 'css' : '--language-force=css', +" \ 'scss' : '--language-force=scss', +" \ 'js' : '--language-force=js', +" \ 'coffee' : '--language-force=coffee', +" \ 'markdown' : '--language-force=markdown' +" \ } +" +Plugin 'thinca/vim-unite-history' +Plugin 'Shougo/neomru.vim' +Plugin 'mattn/webapi-vim' +Plugin 'farseer90718/unite-workflow' +Plugin 'Shougo/vimproc.vim' +Plugin 'Shougo/unite.vim' +let g:unite_source_find_default_opts = "-L" +call unite#filters#matcher_default#use(['matcher_fuzzy']) +call unite#filters#sorter_default#use(['sorter_rank']) +call unite#custom#source('file_rec/async', 'ignore_pattern', 'node_modules/\|bower_components/\|.git/\|.cache/') +call unite#custom#profile('default', 'context', { + \ 'start_insert': 1 + \ }) + +autocmd FileType unite call s:unite_my_settings() +function! s:unite_my_settings() + imap (unite_exit) + imap (unite_select_next_line) +endfunction + +nnoremap :Unite file_rec/async +map r :Unite file_mru +map b :Unite buffer_tab +map :Unite Plugin 'gmarik/github-search.vim' " :GHSearchRepo something