I have my :Rg
results open in a popover and that allows me to cycle through the results using <Ctrl>j
and <Ctrl>k
.
That is an individual selection though so if you want to save your results to a quick fix list, start by <Tab>
and you will noticed a red indicator show up next to the name. Once you press enter everything with the indicator will be placed in the quick fix list.
I also wanted to mention my function for Rg
" Ripgrep advanced
function! RipgrepFzf(query, fullscreen)
let command_fmt = 'rg --column --line-number --no-heading --color=always --smart-case %s || true'
let initial_command = printf(command_fmt, shellescape(a:query))
let reload_command = printf(command_fmt, '{q}')
let spec = {'options': ['--phony', '--query', a:query, '--bind', 'change:reload:'.reload_command]}
call fzf#vim#grep(initial_command, 1, fzf#vim#with_preview(spec), a:fullscreen)
endfunction
command! -nargs=* -bang RG call RipgrepFzf(<q-args>, <bang>0)
And I also wanted to add some shortcuts for quickfix list so that you can cycle through them easily:
map <leader>cc :botright cope<cr>
map <leader>co ggVGy:tabnew<cr>:set syntax=qf<cr>pgg
" Next item on list
map <leader>n :cn<cr>
" Previous item on list
map <leader>p :cp<cr>