|
|
|
###################################
|
|
|
|
# #
|
|
|
|
# Custom Binds #
|
|
|
|
# #
|
|
|
|
###################################
|
|
|
|
|
|
|
|
|
|
|
|
# Rebind tmux prefix to <c-space> to match vim
|
|
|
|
|
|
|
|
unbind C-b
|
|
|
|
set -g prefix C-Space
|
|
|
|
bind Space send-prefix
|
|
|
|
|
|
|
|
# Once the prefix is active these binds will matter
|
|
|
|
# <prefix><Space> and <prefix><C-Space> take you to copy mode.
|
|
|
|
|
|
|
|
bind Space copy-mode
|
|
|
|
bind C-Space copy-mode
|
|
|
|
|
|
|
|
# Rebind window splitting
|
|
|
|
# <prefix>j and <prefix>l split vertically and horizontally, respectively
|
|
|
|
bind j split-window -v
|
|
|
|
bind C-j split-window -v
|
|
|
|
|
|
|
|
bind l split-window -h
|
|
|
|
bind C-l split-window -h
|
|
|
|
|
|
|
|
# Smart pane switching with awareness of vim splits
|
|
|
|
# This is the tmux side of the vim-tmux-navigator plugin
|
|
|
|
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
|
|
|
|
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
|
|
|
|
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
|
|
|
|
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
|
|
|
|
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
|
|
|
|
bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
|
|
|
|
|
|
|
|
|
|
|
|
# Vim keybinds so copy mode behaves more like vim
|
|
|
|
bind-key -t vi-copy 'v' begin-selection
|
|
|
|
bind-key -t vi-copy 'y' copy-selection
|
|
|
|
|
|
|
|
# Vim keybind so that paste is done more naturally instead of with ]
|
|
|
|
bind p paste-buffer
|
|
|
|
|
|
|
|
|
|
|
|
###################################
|
|
|
|
# #
|
|
|
|
# Custom Settings #
|
|
|
|
# #
|
|
|
|
###################################
|
|
|
|
|
|
|
|
|
|
|
|
# Enable vi-like keybindings
|
|
|
|
set-window-option -g mode-keys vi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set -g mode-mouse on
|
|
|
|
set -g mouse-resize-pane on
|
|
|
|
set -g mouse-select-pane on
|
|
|
|
set -g mouse-select-window on
|
|
|
|
set-window-option -g mode-mouse on
|
|
|
|
|