# HG changeset patch # User Ludovic Chabant # Date 1526272917 25200 # Node ID 05ab0353cd6ea2efa24a29a2fbb11d067bceacc6 # Parent 71d7734148ed8ca1d3dc11ef15628fb044a663a1 Add config for `cpsm` and `Leaderf`. diff -r 71d7734148ed -r 05ab0353cd6e vim/vimrc --- a/vim/vimrc Mon May 07 22:14:56 2018 -0700 +++ b/vim/vimrc Sun May 13 21:41:57 2018 -0700 @@ -54,8 +54,12 @@ endif endif -function! s:HasPlugin(plugname) abort - return globpath(&runtimepath, 'plugin/'.a:plugname.'.vim') !=# '' +function! s:HasPlugin(plugname, ...) abort + let l:dirname = 'plugin/' + if a:0 && a:1 + let l:dirname = 'autoload/' + endif + return globpath(&runtimepath, l:dirname.a:plugname.'.vim') !=# '' endfunction " }}} @@ -276,10 +280,16 @@ \] " Use PyMatch to go faster. -if (has('python3') || has('python')) && s:HasPlugin('ctrlp-py-matcher') - let g:ctrlp_match_func = {'match': 'pymatcher#PyMatch'} - let g:ctrlp_max_files = 0 - let g:ctrlp_lazy_update = 350 +if (has('python3') || has('python')) + if s:HasPlugin('ctrlp-py-matcher') + let g:ctrlp_match_func = {'match': 'pymatcher#PyMatch'} + let g:ctrlp_max_files = 0 + let g:ctrlp_lazy_update = 350 + elseif s:HasPlugin('cpsm', 1) + let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'} + let g:ctrlp_max_files = 0 + let g:ctrlp_lazy_update = 350 + endif endif " }}} @@ -660,8 +670,6 @@ nnoremap cf :let @+ = expand('%:h'):echo @+ nnoremap cw :let @+ = getcwd():echo @+ -nnoremap F (easymotion-prefix)s - " Make the diff navigation also center things. nnoremap ]c ]czvzz nnoremap [c [czvzz @@ -762,6 +770,19 @@ endif endif +" LeaderF mappings. +if s:HasPlugin('leaderf') + let g:Lf_ShortcutF = '' + let g:Lf_ShortcutB = '' + nnoremap :LeaderfFile + nnoremap :LeaderfBuffer + nnoremap :LeaderfTag + nnoremap :LeaderfBufTagAll + nnoremap :LeaderfMru + + let g:Lf_StlSeparator = { 'left': '', 'right': '' } +endif + " }}} " Folding {{{