Created
September 13, 2012 15:45
-
-
Save rene-aguirre/3715215 to your computer and use it in GitHub Desktop.
Speed up ctrlp with VCS
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
" ctrlp.vim plug-in | |
" open files extra files in hidden buffers | |
let g:ctrlp_open_multiple_files = '1jr' | |
" indexing speed up | |
if has("unix") | |
let g:ctrlp_user_command = { | |
\ 'types': { | |
\ 1: ['.git', 'cd %s && git ls-files'], | |
\ 2: ['.hg', 'hg --cwd %s locate -I .'], | |
\ 3: ['.svn', 'find %s -type f'], | |
\ }, | |
\ 'fallback': 'find %s -type f' | |
\ } | |
else | |
" windows | |
let ctrlp_filter_greps = "". | |
\ 'grep -iv "\\.\(' . | |
\ 'exe\|jar\|class\|swp\|swo\|log\|so\|o\|pyc\|jpe?g\|png\|gif\|mo\|po' . | |
\ 'o\|a\|obj\|com\|dll\|exe\|tmp\|docx\|pdf\|jpg\|png\|vsd\|zip' . | |
\ '\)$"' | |
let g:ctrlp_user_command = { | |
\ 'types': { | |
\ 1: ['.git', "cd %s && git ls-files | " . ctrlp_filter_greps], | |
\ 2: ['.hg', 'hg --cwd %s locate -I .'], | |
\ 3: ['.svn', 'svn status %s -q -v --xml | grep -e "\\s*path=" | sed ' . "'" . 's/\\s*path="\(.*\)".*$/\1/' . "' | " . ctrlp_filter_greps], | |
\ }, | |
\ 'fallback': 'dir %s /-n /b /s /a-d' | |
\ } | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment