Loading .vimrc +9 −2 Original line number Diff line number Diff line Loading @@ -158,10 +158,17 @@ nmap <silent> th :set hlsearch!<CR> " === GREPPING === function! s:greprep(string, ...) let replacements = {'\|': '|', '$*': join(a:000)} let rekeys = keys(replacements) call map(rekeys, {k, v -> escape(v, '\$*')}) let regex = join(rekeys, '\|') return substitute(a:string, regex, {m -> replacements[m[0]]}, 'g') endfunction command! -bang -nargs=1 AsyncGrep \ exe 'AsyncRun<bang> -auto=grep' \ substitute(&grepprg, '\\|', '|', 'g') \ <q-args> \ <SID>greprep(&grepprg, <q-args>) noremap <silent> S :AsyncGrep '\b<cword>\b'<CR> vnoremap <silent> S ""y:exe 'AsyncGrep' Loading Loading
.vimrc +9 −2 Original line number Diff line number Diff line Loading @@ -158,10 +158,17 @@ nmap <silent> th :set hlsearch!<CR> " === GREPPING === function! s:greprep(string, ...) let replacements = {'\|': '|', '$*': join(a:000)} let rekeys = keys(replacements) call map(rekeys, {k, v -> escape(v, '\$*')}) let regex = join(rekeys, '\|') return substitute(a:string, regex, {m -> replacements[m[0]]}, 'g') endfunction command! -bang -nargs=1 AsyncGrep \ exe 'AsyncRun<bang> -auto=grep' \ substitute(&grepprg, '\\|', '|', 'g') \ <q-args> \ <SID>greprep(&grepprg, <q-args>) noremap <silent> S :AsyncGrep '\b<cword>\b'<CR> vnoremap <silent> S ""y:exe 'AsyncGrep' Loading