" base set of flags to rg
set grepprg=rg\ --path-separator\ /\ -g\ 'src/**'\ --vimgrep
" setup a command to take some more flags to rg
command! -nargs=+ MyGrep mark A | execute 'silent grep! <args>' | bot cw 20
" Ask rg to grep from */**
nnoremap <leader>aW :let @w = "<c-r><c-w>" <bar> MyGrep "-w" "-g" "*/**" "<c-r><c-w>"<cr>
Having trouble getting */**
into the rg command. I can manually put it into grepprg with
set grepprg=rg\ --path-separator\ /\ -g\ 'src/**'\ -g\ '*/**'\ --vimgrep
but i don’t want that aggressive search mask in the base set of flags
linux wants the -g path wrapped in ticks: ‘path’, while windows does not.
in the nnoremap command i tried adding in the ticks but it didnt’ work
MyGrep "-w" "-g" "'*/**'"
after that i tried escaping the ticks single, double, then tripple \ and each of those attempts failed.