if exists("g:ctrlp_user_command") unlet g:ctrlp_user_command endif if executable('rg') " Use rg in CtrlP for listing files. Lightning fast and respects .gitignore let g:ctrlp_user_command = 'rg --hidden --files -g \!.git -g \!.DS_Store --smart-case %s' " rg is fast enough that CtrlP doesn't need to cache let g:ctrlp_use_caching = 0 elseif executable('ag') " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore let g:ctrlp_user_command = 'ag %s --hidden --files-with-matches -g "" --ignore "\.git$\|\.hg$\|\.svn$"' " ag is fast enough that CtrlP doesn't need to cache let g:ctrlp_use_caching = 0 else " Fall back to using git ls-files if Ag is not available let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'] endif " Default to filename searches - so that appctrl will find application " controller let g:ctrlp_by_filename = 1 let g:ctrlp_working_path_mode = 'ra' set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$' let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/](\.git|\.hg|\.svn|node_modules)$', \ 'file': '\v\.(exe|so|dll)$', \ 'link': 'some_bad_symbolic_links', \ } " show even .ssh/config file let g:ctrlp_show_hidden = 1 " Don't jump to already open window. This is annoying if you are maintaining " several Tab workspaces and want to open two windows into the same file. let g:ctrlp_switch_buffer = 0 " We don't want to use Ctrl-p as the mapping because " it interferes with YankRing (paste, then hit ctrl-p) let g:ctrlp_map = ',t' nnoremap ,t :CtrlP " Additional mapping for buffer search nnoremap ,b :CtrlPBuffer " Cmd-Shift-P to clear the cache nnoremap :ClearCtrlPCache " Idea from : http://www.charlietanksley.net/blog/blog/2011/10/18/vim-navigation-with-lustyexplorer-and-lustyjuggler/ " Open CtrlP starting from a particular path, making it much " more likely to find the correct thing first. mnemonic 'jump to [something]' map ,ja :CtrlP app/assets map ,jm :CtrlP app/models map ,jc :CtrlP app/controllers map ,jv :CtrlP app/views map ,jj :CtrlP app/assets/javascripts map ,jh :CtrlP app/helpers map ,jl :CtrlP lib map ,jp :CtrlP public map ,js :CtrlP spec map ,jf :CtrlP fast_spec map ,jd :CtrlP db map ,jC :CtrlP config map ,jV :CtrlP vendor map ,jF :CtrlP factories map ,jT :CtrlP test "Cmd-Shift-(M)ethod - jump to a method (tag in current file) "Ctrl-m is not good - it overrides behavior of Enter nnoremap :CtrlPBufTag