You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB

###################################
# #
# Custom Binds #
# #
###################################
10 years ago
# Rebind tmux prefix to <c-space> to match vim
10 years ago
unbind C-b
set -g prefix C-Space
bind Space send-prefix
10 years ago
set -g status-bg blue
9 years ago
set -g status-fg black
# Once the prefix is active these binds will matter
# <prefix><Space> and <prefix><C-Space> take you to copy mode.
10 years ago
bind Space copy-mode
bind C-Space copy-mode
10 years ago
# Rebind window splitting
# <prefix>j and <prefix>l split vertically and horizontally, respectively
bind j split-window -v
bind C-j split-window -v
10 years ago
bind l split-window -h
bind C-l split-window -h
10 years ago
# 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"
10 years ago
# 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
10 years ago
# Vim keybind so that paste is done more naturally instead of with ]
bind p paste-buffer
10 years ago
###################################
# #
# Custom Settings #
# #
###################################
10 years ago
# Enable vi-like keybindings
set-window-option -g mode-keys vi
10 years ago