Skip to content

Instantly share code, notes, and snippets.

@cloud8421
Created May 3, 2013 16:32

Revisions

  1. Claudio Ortolina created this gist May 3, 2013.
    17 changes: 17 additions & 0 deletions gistfile1.vim
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    let g:greyhound_path = '/path/to/greyhound'
    let g:ctrlp_use_caching = 0
    let g:greyhound_exclude_paths = ".git,public/system,public/uploads,.svn,tmp/,vendor/cache,vendor/bundle,log/,.bundle,coverage/"
    let g:ctrlp_user_command = g:greyhound_path." --exclude ".g:greyhound_exclude_paths
    let g:ctrlp_match_func = { 'match': 'Greyhound' }

    function! Greyhound(items, str, limit, mmode, ispath, crfile, regex)

    let cmd = g:greyhound_path.' --exclude '.g:greyhound_exclude_paths

    if (strlen(a:str) > 0)
    let cmd = cmd.' --query '.a:str
    endif

    return split(system(cmd), "\n")[0:10]

    endfunction