vimrc: update CtrlP to use The Silver Searcher

This commit is contained in:
leo 2023-02-21 21:03:36 +01:00
parent fcec9cc75b
commit 773436b048
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -568,13 +568,25 @@ let g:ctrlp_custom_ignore = {
" control. It also supports works with .svn, .hg, .bzr.
" let g:ctrlp_working_path_mode = 'r'
let g:ctrlp_working_path_mode = 'raw'
let g:ctrlp_cache_dir = $HOME . '/.cache/ctrlp'
nnoremap '<c-p>' :<CtrlP><cr>
" The Silver Searcher
if executable('ag')
" use ag instead of grep.
set grepprg=ag\ --nogroup\ --nocolor
" use ag in CtrlP
let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
nnoremap <c-p> :CtrlP<cr><cr>
nnoremap <leader>s <Plug>(ctrlp)
let g:ctrlp_map = '<c-p>'
let g:ctrlp_show_hidden = 1
" Use a leader instead of the actual named binding
nmap <leader>p :CtrlP<cr>
nmap <leader>p <Plug>(ctrlp)
" ctrlp buffers
" Easy bindings for its various modes