-
Notifications
You must be signed in to change notification settings - Fork 14
/
ctrlp.vim
62 lines (51 loc) · 1.88 KB
/
ctrlp.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Bundle 'ctrlpvim/ctrlp.vim'
Bundle 'jasoncodes/ctrlp-modified.vim'
Bundle 'ivalkeen/vim-ctrlp-tjump'
Bundle 'FelikZ/ctrlp-py-matcher'
Bundle 'd11wtq/ctrlp_bdelete.vim'
let g:ctrlp_clear_cache_on_exit = 1
let g:ctrlp_working_path_mode = 0 " Don't manage
let g:ctrlp_dotfiles = 0 " Ignore all dot/hidden files
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$\|backups$\|logs$\|tmp$\|_site$',
\ 'file': '',
\ 'link': '',
\ }
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_match_window = 'bottom,order:ttb,min:10,max:10'
let g:ctrlp_switch_buffer = ''
let g:ctrlp_match_func = {'match' : 'pymatcher#PyMatch' }
let g:ctrlp_buffer_func = { 'enter': 'ctrlp_bdelete#mappings' }
augroup ctrlp-tjump
autocmd VimEnter * runtime autoload/ctrlp/tjump.vim
autocmd VimEnter * let g:ctrlp_tjump_only_silent = 1
autocmd VimEnter * let g:ctrlp_tjump_shortener = [getcwd() . '/', '']
autocmd VimEnter * silent augroup! ctrlp-tjump
augroup end
" The Silver Searcher
if executable('ag')
" Use ag over grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
" ag is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
endif
" ripgrep
if executable('rg')
" Use rg over grep
set grepprg=rg\ --vimgrep\ --no-heading
set grepformat=%f:%l:%c:%m,%f:%l:%m
" Use rg in CtrlP for listing files. Lightning fast and respects .gitignore
let g:ctrlp_user_command = 'rg --files --hidden --glob "!.git" %s'
" rg is fast enough that CtrlP doesn't need to cache
let g:ctrlp_use_caching = 0
end
map <Leader>t :CtrlP<CR>
map <Leader>T :CtrlPClearAllCaches<CR>:CtrlP<CR>
map <Leader>l :CtrlPBuffer<CR>
map <Leader>m :CtrlPModified<CR>
map <Leader>M :CtrlPBranchModified<CR>
map <Leader>d :CtrlPCurFile<CR>
map <Leader>] :CtrlPTag<CR>
map <silent> <C-]> :CtrlPtjump<CR>