-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
executable file
·75 lines (57 loc) · 2.28 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# set bash as default tmux shell
set-option -g default-shell /bin/bash
# set tmux to use 256 colors
set -g default-terminal "screen-256color"
set-option -g allow-rename off
set -g history-limit 10000
set-window-option -g mode-keys vi
# set command delay
set -sg escape-time 1
# Set the numbering of windows to start from 1
set -g base-index 1
setw -g pane-base-index 1
# Mouse works as expected
setw -g mouse on
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(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 -r C-l send-keys 'C-l'
# move between panes vim style
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# rebind split commands
bind \ split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
unbind '"'
unbind '%'
# resize panes with vim-like bindings
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5
# bind-key -t vi-copy 'v' begin-selection
# bind-key -t vi-copy 'y' copy-selection
# bind-key -t vi-copy 'C-v' rectangle-toggle
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'y' send-keys -X copy-selection
bind-key -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle
bind-key -T copy-mode-vi 'v' send-keys begin-selection
bind-key -T copy-mode-vi 'y' send-keys copy-selection
# Status panel settings
set-option -g status-position top
set-window-option -g status-left " #S "
set-window-option -g status-left-style 'bg=white, fg=black'
set-window-option -g status-right " %H:%M %d-%b-%y "
set-window-option -g status-right-style 'bg=black, fg=green'
set-window-option -g window-status-format " #I: #W "
set-window-option -g window-status-style 'fg=black'
set-window-option -g window-status-current-format " #I: #W "
set-window-option -g window-status-current-style 'bg=black, fg=green'
# source tmux.conf while in tmux
bind r source-file ~/.tmux.conf \; display "Reloaded!"