Created
May 7, 2015 17:06
-
-
Save dsummersl/c37c8f35111f20aaa1d4 to your computer and use it in GitHub Desktop.
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
" Execute something on all files of the same kind: | |
" | |
" See GG and AA commands: | |
function! s:ExecFileType(cmd,search) | |
let extension = substitute(expand('%'),'\v^.*\.',"","") | |
exec printf("silent %s",printf(a:cmd,a:search,extension)) | |
endfunction | |
command! -nargs=1 GG call s:ExecFileType("Ggrep %s -- '*.%s'",'<args>') | |
command! -nargs=1 AA call s:ExecFileType("Ag %s **/*.%s",'<args>') | |
command! -nargs=1 AA call s:ExecFileType("Ag %s **/*.%s",'<args>') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment