Created
October 23, 2009 18:08
-
-
Save TwP/217086 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
function! AckSnippets(search) | |
let ft = &ft | |
if ft == 'objc' || ft == 'cpp' || ft == 'cs' | |
ft = 'c' | |
elseif ft == 'xhtml' | |
ft = 'html' | |
endif | |
let dirs = join(split( | |
\ globpath(g:snippets_dir, ft)."\n". | |
\ globpath(g:snippets_dir, ft.'-*'), | |
\ "\n"), ' ') | |
let grepprg_bak=&grepprg | |
exec "set grepprg=" . g:ackprg | |
execute "silent! grep! -a " . a:search . ' ' . dirs | |
botright copen | |
let &grepprg=grepprg_bak | |
exec "redraw!" | |
endfunction | |
command -nargs=? Acks call AckSnippets('<args>') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment