dotfiles/tmux/.tmux.conf

49 lines
1.4 KiB
Text
Raw Normal View History

2020-02-18 14:21:14 -05:00
set-option -g default-shell /bin/zsh
2021-03-15 19:09:16 +00:00
set -g default-terminal "screen-256color"
2020-02-10 12:55:17 -08:00
# set-window-option -g mode-keys vi
2020-02-18 14:21:14 -05:00
set-window-option -g automatic-rename on
2021-03-15 19:09:16 +00:00
set-window-option mode-keys vi
2020-02-18 14:21:14 -05:00
bind h split-window -h -c "#{pane_current_path}"
bind v split-window -v -c "#{pane_current_path}"
bind w new-window
2020-02-10 12:55:17 -08:00
# 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"
2020-02-24 20:27:04 -05:00
# bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
2020-02-18 14:21:14 -05:00
bind a resize-pane -Z
# Shift arrow to switch windows
bind -n C-S-Space previous-window
bind -n C-Space next-window
2020-02-25 13:27:08 -05:00
# Remove escape delay
set -s escape-time 0
2021-11-06 14:28:39 -04:00
# Enable mouse scroll
set -g mouse on