Added CtrlP caching

master
Jef Roosens 2020-10-30 11:27:40 +01:00
parent cc0adb1b17
commit 4db625188e
2 changed files with 25 additions and 4 deletions

View File

@ -18,4 +18,5 @@ runtime! init/*.vim
" 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.
" The silent! prevents it from showing an error if no local.vim file is found
silent! source .vim/local.vim

View File

@ -1,8 +1,28 @@
" Remap CtrlP shortcut
let g:ctrlp_map = '<leader>t'
" Disable caching
let g:ctrlp_use_caching = 0
" Enable caching
" 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
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
" You can define different listing commands for different version controls
" 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