-
-
Save davidmh/9011182 to your computer and use it in GitHub Desktop.
Accelerate CtrlP by ignoring certain files and paths. Including node modules and grunt's .tmp
This file contains hidden or 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
" Ignore some folders and files for CtrlP indexing | |
let g:ctrlp_custom_ignore = { | |
\ 'dir': '\.git$\|\.yardoc\|node_modules\|log\|tmp$', | |
\ 'file': '\.so$\|\.dat$|\.DS_Store$' | |
\ } |
This is super old, since then I've switched to https://github.com/junegunn/fzf.vim it's way faster than ctrlp, respects your .gitignore out of the box and it has a bunch of integrations with external search packages.
FWIW, if you don't care about files outside of source control, you can use source control itself as a source-of-truth for ctrlp_user_command
. This also honors .gitignore
et. al. Per :help ctrlp_user_command
" Single VCS, listing command does not list untracked files:
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files']
let g:ctrlp_user_command = ['.hg', 'hg --cwd %s locate -I .']
" Multiple VCS's:
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files'],
\ 2: ['.hg', 'hg --cwd %s locate -I .'],
\ },
\ 'fallback': 'find %s -type f'
\ }
" Single VCS, listing command lists untracked files (slower):
let g:ctrlp_user_command =
\ ['.git', 'cd %s && git ls-files -co --exclude-standard']
let g:ctrlp_user_command =
\ ['.hg', 'hg --cwd %s status -numac -I . $(hg root)'] " MacOSX/Linux
let g:ctrlp_user_command = ['.hg', 'for /f "tokens=1" %%a in (''hg root'') '
\ . 'do hg --cwd %s status -numac -I . %%a'] " Windows
@BourgeoisBear That's perfect, thanks !
Thanks !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome, thanx.