-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
42 lines (34 loc) · 1.39 KB
/
tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
set -g default-terminal "screen-256color"
if-shell "hostname | grep stoneMBP" "set-option -g status-bg colour95; set-option -g status-fg colour254"
if-shell "hostname | grep kallisti" "set-option -g status-bg colour95; set-option -g status-fg colour254"
# Remap window navigation to vim
unbind-key j
bind-key j select-pane -D
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
# vim navigation through copy mode
setw -g mode-keys vi
# Tmux/vim navigation
# Smart pane switching with awareness of vim splits
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"
bind-key -n C-S-Up resize-pane -U 10
bind-key -n C-S-Down resize-pane -D 10
bind-key -n C-S-Left resize-pane -L 20
bind-key -n C-S-Right resize-pane -R 20
# Automatically renumber windows when one is closed
set-option -g renumber-windows on
# setw -g aggressive-resize off
# set -g mode-mouse on
# set -g mouse-select-pane on
# set -g terminal-overrides 'xterm*:smcup@:rmcup@
# Sort sessions alphabetically
bind s choose-tree -sZ -O name