Created
September 4, 2021 00:03
-
-
Save trufae/c6e164f8c5156f000af488e23a2a0a89 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
if [ -f ~/.vim/autoload/plug.vim ]; then | |
echo "fzf-vim already installed." | |
else | |
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ | |
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
cat >> ~/.vimrc <<EOF | |
call plug#begin('~/.vim/plugged') | |
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
call plug#end() | |
command! -bang -nargs=* GGrep | |
\ call fzf#vim#grep( | |
\ 'git grep --line-number -- '.shellescape(<q-args>), 0, | |
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0) | |
nmap <D-O> :GGrep<cr> | |
nmap <C-o> :FZF --layout=reverse<cr> | |
EOF | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment