Skip to content

Instantly share code, notes, and snippets.

@rene-aguirre
Created September 13, 2012 15:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rene-aguirre/3715215 to your computer and use it in GitHub Desktop.
Save rene-aguirre/3715215 to your computer and use it in GitHub Desktop.
Speed up ctrlp with VCS
" 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