fzf-ripgrep.vim
fzf-ripgrep.vim copied to clipboard
Vim + Fzf + Rg = Super Fast Jumper
fzf-ripgrep.vim
A fzf + ripgrep wrapper for vim --- things you can do more with fzf and ripgrep and (neo)vim.
fzf.vim is a great plugin which integrates fzf into vim.
One of its great feature is fzf#vim#grep, or the :Rg command, but we should have a full-featured ripgrep integration for fzf+vim.
This plugin adds a bunch of batteries so that you can instantly jump to everywhere ripgrep would suggest.
Features
- [x] Always comes with fzf preview (toggle with
CTRL-/) - [x] FZF matchs file contents only, not file names
- [x] cword expansion in vim commands (e.g.
*for<cword>,:Rg*) - [x] Aware of NERDTree and NERDTreeTabs: do not mess up them
- [x] Send the ripgrep result to the quickfix window (
<C-Q>) - [ ] Interactive, bidirectional communication between fzf and vim through RPC
- [ ] Support many flags (e.g.,
-t,-u) as the command-linergdoes
Usage
Commands
| Command | List |
|---|---|
:Rg [query] |
Perform rg search (interactive query refinement) |
:RgFzf [query] |
Perform rg search (filtering with FZF), similar to fzf.vim's :Rg |
Keybindings
CTRL-Q: Send the current search result to the quickfix window.- Common fzf key-bindings:
CTRL-T(new tab),CTRL-X(split),CTRL-V(vsplit)CTRL-/to toggle preview (org:fzf_ripgrep_keybindings['toggle-preview'])
Advanced: as a vim function
fzf#vim#ripgrep#rg(search_pattern, opts)
fzf#vim#ripgrep#rg_fzf(search_pattern, opts)
opts:
fullscreen(boolean)prompt_name(str), defaultsRgprompt_query(str), defaultsa:search_patternpath(str), path (file or directory) to perform ripgrep search on.
Installation
Plug 'wookayin/fzf-ripgrep.vim'
License
The MIT License (c) 2020 Jongwook Choi (@wookayin)