Created
October 2, 2019 15:51
-
-
Save tomleo/00066964f5f6315bc16260bf20e6e8d1 to your computer and use it in GitHub Desktop.
FZF Is awesome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# THE FZF BITS | |
[ -f ~/.fzf.bash ] && source ~/.fzf.bash | |
export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc | |
# --files: List files that would be searched but do not search | |
# --no-ignore: Do not respect .gitignore, etc... | |
# --hidden: Search hidden files and folders | |
# --follow: Follow symlinks | |
# --glob: Additional conditions for search (in this case ignore everything in the .git/ folder) | |
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*" --glob "!**/node_modules/"' | |
[ -f ~/.fzf.bash ] && source ~/.fzf.bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" THE FZF BITS | |
let g:ag_prg="ag --vimgrep --smart-case" | |
let g:ag_working_path_mode="r" | |
"====[ FZF Settings ]====" | |
set rtp+=~/.fzf | |
set grepprg=rg\ --vimgrep | |
let g:fzf_tags_command = 'ctags -R' | |
" --column: Show column number | |
" --line-number: Show line number | |
" --no-heading: Do not show file headings in results | |
" --fixed-strings: Search term as a literal string | |
" --ignore-case: Case insensitive search | |
" --no-ignore: Do not respect .gitignore, etc... | |
" --hidden: Search hidden files and folders | |
" --follow: Follow symlinks | |
" --glob: Additional conditions for search (in this case ignore everything in the .git/ folder) | |
" --color: Search color options | |
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --glob "!**/node_modules/*" --glob "!*.pyc" --color "always" '.shellescape(<q-args>), 1, <bang>0) | |
let g:fzf_action = { | |
\ 'ctrl-s': 'split', | |
\ 'ctrl-v': 'vsplit' | |
\ } | |
nnoremap <c-p> :FZF<cr> | |
" via: https://github.com/euclio/vimrc/blob/master/plugins.vim#L207-L212 | |
augroup fzf | |
autocmd! | |
autocmd! FileType fzf | |
autocmd FileType fzf set laststatus=0 noshowmode noruler | |
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler | |
augroup END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment