diff --git a/.gitignore b/.gitignore index 8383c6f..09d2f16 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.un *.un~ +/vim/.vim/plugins/* diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..1a4ef86 --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,32 @@ +set-option -g default-shell /bin/bash +set -g default-terminal "rxvt-unicode-256color" +# set-window-option -g mode-keys vi + +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" + +# Smart pane switching with awareness of Vim splits. +# See: https://github.com/christoomey/vim-tmux-navigator +# Adapted to avoid fzf conflicts + +is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ +| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'" + +is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \ + | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'" + +bind -n C-h run "($is_vim && tmux send-keys C-h) || \ + tmux select-pane -L" + +bind -n C-j run "($is_vim && tmux send-keys C-j) || \ + ($is_fzf && tmux send-keys C-j) || \ + tmux select-pane -D" + +bind -n C-k run "($is_vim && tmux send-keys C-k) || \ + ($is_fzf && tmux send-keys C-k) || \ + tmux select-pane -U" + +bind -n C-l run "($is_vim && tmux send-keys C-l) || \ + tmux select-pane -R" + +bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" diff --git a/vim/.vimrc b/vim/.vimrc index 9bb6ef0..5c69948 100755 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -31,6 +31,8 @@ Plug 'relastle/bluewery.vim' Plug 'sainnhe/vim-color-forest-night' Plug 'justinmk/vim-sneak' + Plug 'christoomey/vim-tmux-navigator' + Plug 'ap/vim-css-color' " Todo: " GV " Gundo (or undotree?)