Add fzf + ripgrep everywhere.

* install by default
* configure Vim to use fzf via fzf.vim
* start Tmux when starting zsh
This commit is contained in:
Cyryl Płotnicki 2016-10-12 20:58:26 +02:00
parent 0c37559dfd
commit 2ee928081c
6 changed files with 25 additions and 2 deletions

View file

@ -12,4 +12,5 @@ export RUST_SRC_PATH=$HOME/dev/rust/src
export EDITOR="vim"
export KEYTIMEOUT=1
export VAGRANT_DEFAULT_PROVIDER=virtualbox
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"'

View file

@ -25,8 +25,13 @@ endif
if executable('rg')
let g:ackprg = 'rg --no-heading --vimgrep'
set grepprg=rg\ --vimgrep
endif
" fzf
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
nmap <C-n> :Find
" appearance
set number
set relativenumber

View file

@ -9,6 +9,7 @@ Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'timonv/vim-cargo'
Plugin 'kien/ctrlp.vim'
Plugin 'junegunn/fzf.vim'
Plugin 'will133/vim-dirdiff'
Plugin 'tpope/vim-dispatch.git'
Plugin 'tpope/vim-fugitive.git'

View file

@ -50,4 +50,6 @@ set expandtab
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=~/.fzf
call vundle#begin()

16
.zshrc
View file

@ -47,9 +47,21 @@ fi
alias benice="ionice -c3 nice -n20"
# env vars
# stuff that checks if it's added to the .zshrc exipliclty
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# other common env vars
source ~/.setenv
# TMUX
if which tmux >/dev/null 2>&1; then
# if no session is started, start a new session
test -z ${TMUX} && tmux
# when quitting tmux, try to attach
while test -z ${TMUX}; do
tmux attach || break
done
fi
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

View file

@ -112,6 +112,8 @@ if [[ -z $NORUBY ]]; then
fi
if [[ -z $NOVIM ]]; then
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --64 --all
echo "\n" | vim +PluginInstall +qa
if [[ -z $NOYCM ]]; then
cd ~/.vim/bundle/YouCompleteMe