From 2ee928081c1cd91e251a07f25079fd6ba2279b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Wed, 12 Oct 2016 20:58:26 +0200 Subject: [PATCH 1/2] Add fzf + ripgrep everywhere. * install by default * configure Vim to use fzf via fzf.vim * start Tmux when starting zsh --- .setenv | 1 + .vimrc.common.epilogue | 5 +++++ .vimrc.common.plugins | 1 + .vimrc.common.prelude | 2 ++ .zshrc | 16 ++++++++++++++-- common/configure_fresh_system | 2 ++ 6 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.setenv b/.setenv index 706c22bb..ae40429d 100644 --- a/.setenv +++ b/.setenv @@ -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/*"' diff --git a/.vimrc.common.epilogue b/.vimrc.common.epilogue index ca7a78ab..ee21d921 100644 --- a/.vimrc.common.epilogue +++ b/.vimrc.common.epilogue @@ -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().'| tr -d "\017"', 1, 0) +nmap :Find + " appearance set number set relativenumber diff --git a/.vimrc.common.plugins b/.vimrc.common.plugins index be5ec9db..307e90db 100644 --- a/.vimrc.common.plugins +++ b/.vimrc.common.plugins @@ -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' diff --git a/.vimrc.common.prelude b/.vimrc.common.prelude index 84792bc2..5b358aea 100644 --- a/.vimrc.common.prelude +++ b/.vimrc.common.prelude @@ -50,4 +50,6 @@ set expandtab filetype off set rtp+=~/.vim/bundle/Vundle.vim +set rtp+=~/.fzf + call vundle#begin() diff --git a/.zshrc b/.zshrc index 860a8d40..4b9581e2 100644 --- a/.zshrc +++ b/.zshrc @@ -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 diff --git a/common/configure_fresh_system b/common/configure_fresh_system index 9969c1d3..370507ac 100755 --- a/common/configure_fresh_system +++ b/common/configure_fresh_system @@ -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 From 4cc0950c34643eacaed1719c02f55a498b773287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Wed, 12 Oct 2016 21:16:18 +0200 Subject: [PATCH 2/2] Upgrade tmux mouse configuratio to use new tmux' verbs --- .tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index a8483852..2e83a536 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,4 +1,4 @@ -set -g mode-mouse on +set -g mouse on set -g terminal-overrides 'xterm*:smcup@:rmcup@' set -g prefix C-a # prefix from ctrl-b to ctrl-a unbind C-b # free ctrl-b to be used by programs inside tmux