Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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>')
Add Comment
Please, Sign In to add comment