Skip to content

Instantly share code, notes, and snippets.

@damonkelley
Created October 11, 2019 19:41
Show Gist options
  • Save damonkelley/06d75924c4f47ebd1cf9338341389a55 to your computer and use it in GitHub Desktop.
Save damonkelley/06d75924c4f47ebd1cf9338341389a55 to your computer and use it in GitHub Desktop.
Fuzzy Finding
" Plugins {{{
call plug#begin()
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
call plug#end()
"}}}
" Search for word under the cursor
nnoremap <silent> <leader>* :Rg! <C-R><C-W><CR>
nnoremap <leader>/ :Rg!
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --no-heading --color=always '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
command! -bang -nargs=* Ag
\ call fzf#vim#ag(<q-args>,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%:hidden', '?'),
\ <bang>0)
@damonkelley
Copy link
Author

damonkelley commented Oct 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment