Created
July 1, 2019 09:39
-
-
Save daGrevis/4f9ed8efbe175bd551df90e5ec7c223d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Don't change working directory. | |
let g:ctrlp_working_path_mode = '' | |
" How CtrlP finds files. For now it uses git/hg when possible, but fallbacks to find. | |
let g:ctrlp_user_command = { | |
\ 'types': { | |
\ 1: ['.git', 'cd %s && git ls-files -oc --exclude-standard'], | |
\ 2: ['.hg', 'hg --cwd %s locate -I .'], | |
\ }, | |
\ 'fallback': 'find %s -type f -o -type l' | |
\ } | |
" CtrlP height. | |
let g:ctrlp_match_window = 'max:20' | |
" Custom status. | |
function! CtrlPStatusFuncMain(focus, byfname, regex, prev, item, next, marked) | |
return getcwd() | |
endfunction | |
let g:ctrlp_status_func = { | |
\ 'main': 'CtrlPStatusFuncMain', | |
\ } | |
let g:ctrlp_map = '' | |
function! CtrlP() | |
if (getcwd() == $HOME) | |
echo "Won't run in ~" | |
return | |
endif | |
if (getcwd() == '/') | |
echo "Won't run in /" | |
return | |
endif | |
CtrlP | |
endfunction | |
nnoremap <C-p> :call CtrlP()<CR> | |
" Clears cache and then runs CtrlP. | |
nnoremap <Leader>p :CtrlPClearAllCaches \| CtrlP<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment