Added CtrlP caching
parent
cc0adb1b17
commit
4db625188e
1
init.vim
1
init.vim
|
@ -18,4 +18,5 @@ runtime! init/*.vim
|
||||||
|
|
||||||
" This sources a .vim/local.vim file in the current directory, if it exists.
|
" This sources a .vim/local.vim file in the current directory, if it exists.
|
||||||
" This allows for project-specific settings, such as on-write autocmd's etc.
|
" This allows for project-specific settings, such as on-write autocmd's etc.
|
||||||
|
" The silent! prevents it from showing an error if no local.vim file is found
|
||||||
silent! source .vim/local.vim
|
silent! source .vim/local.vim
|
||||||
|
|
|
@ -1,8 +1,28 @@
|
||||||
" Remap CtrlP shortcut
|
" Remap CtrlP shortcut
|
||||||
let g:ctrlp_map = '<leader>t'
|
let g:ctrlp_map = '<leader>t'
|
||||||
|
|
||||||
" Disable caching
|
" Enable caching
|
||||||
let g:ctrlp_use_caching = 0
|
" I think this'll make it run just a bit faster
|
||||||
|
let g:ctrlp_use_caching = 1
|
||||||
|
" Don't clear the cache on exit, so it won't re-index every time we open the
|
||||||
|
" project
|
||||||
|
let g:ctrlp_clear_cache_on_exit = 0
|
||||||
|
" Cache inside the project's .vim directory to keep things tidy
|
||||||
|
let g:ctrlp_cache_dir = './.vim/cache/ctrlp'
|
||||||
|
|
||||||
" Only show files in git repo, ignoring .gitignore content
|
" You can define different listing commands for different version controls
|
||||||
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
|
" systems etc.
|
||||||
|
" I currently only have experience with Git, but I've written the config like
|
||||||
|
" this to allow for easy expansion if needed.
|
||||||
|
let g:ctrlp_user_command = {
|
||||||
|
\ 'types': {
|
||||||
|
\ 1: ['.git', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
|
||||||
|
\ },
|
||||||
|
\ 'fallback': 'find %s -type f'
|
||||||
|
\ }
|
||||||
|
|
||||||
|
" Limit max number of files
|
||||||
|
" This prevents me from indexing my entire HOME by accident
|
||||||
|
let g:ctrlp_max_files = 10000
|
||||||
|
" Also limit recursion depth
|
||||||
|
let g:ctrlp_max_depth = 40
|
||||||
|
|
Reference in New Issue