vim-settings/vim/rc/plugins/ctrlp.rc.vim

51 lines
1.4 KiB
VimL
Raw Permalink Normal View History

Plug 'ctrlpvim/ctrlp.vim'
" Configuration for ctrlp.vim
2015-03-27 00:45:03 +00:00
let g:ctrlp_in_use = 1
2015-03-27 00:45:03 +00:00
" Ensure max height isn't too large. (for performance)
let g:ctrlp_max_height = 10
" Conditional Mappings
let g:ctrlp_map = '<C-t>'
2015-08-14 05:43:20 +00:00
" Allow ctrl p to open over startify
let g:ctrlp_reuse_window = 'startify'
2015-03-27 00:45:03 +00:00
" Support tag jumping
let g:ctrlp_extensions = ['tag', 'buffertag']
2016-03-24 19:14:39 +00:00
" Don't search right away
2016-05-03 18:42:58 +00:00
let g:ctrlp_lazy_update = 50
2016-03-24 19:14:39 +00:00
" Quick exiting with <bs>
let g:ctrlp_brief_prompt = 1
" Support golang tags
2015-03-27 00:45:03 +00:00
let g:ctrlp_buftag_types = {
\ 'go' : {
\ 'bin' : 'gotags',
\ 'args' : '-sort -silent',
\}
\}
2016-03-24 19:14:39 +00:00
" When using slow built in search, limit max depth
let g:ctrlp_max_depth = 4
" When using slow built in search, limit max files
let g:ctrlp_max_files = 1000
" Use git ls-files when in a git project
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files'],
\}
\}
2015-03-27 00:45:03 +00:00
" Leader Commands
nnoremap <leader>b :CtrlPBuffer<CR>
nnoremap <leader>m :CtrlPMRUFiles<CR>
nnoremap <leader>p :CtrlP<CR>
2015-03-27 00:45:03 +00:00
nnoremap <leader>r :CtrlPTag<CR>
nnoremap <leader>t :CtrlPBufTag<CR>
2015-03-27 00:45:03 +00:00
nnoremap <leader>u :CtrlPCurFile<CR>
2017-11-14 03:05:26 +00:00
nnoremap <silent> <F2> :CtrlPBuffer<CR>
2015-03-27 00:45:03 +00:00
" Special stuff for The Silver Searcher
if executable('ag')
" use ag for CtrlP
2016-03-24 19:14:39 +00:00
let g:ctrlp_user_command['fallback'] = 'ag %s -l --depth 5 --nocolor --nogroup -g ""'
2015-03-27 00:45:03 +00:00
" ag is fast enough we don't need cache
let g:ctrlp_use_caching = 0
endif