Skip to content

Instantly share code, notes, and snippets.

@SidOfc
Created September 27, 2018 20:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SidOfc/ba43acade7f4a1bf9faf57d16b33616a to your computer and use it in GitHub Desktop.
Save SidOfc/ba43acade7f4a1bf9faf57d16b33616a to your computer and use it in GitHub Desktop.
Adds `:Rg` command to FZF.vim.
" FZF.vim now supports this command out of the box
" so this code is no longer needed.
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --hidden --ignore-case --no-heading --color=always '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'up:60%')
\ : fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'right:50%:hidden', '?'),
\ <bang>0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment