-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.tmux.conf
108 lines (85 loc) · 3.15 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# ctrl-a is easier
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# base-index 1 makes more sense for windows, panes
set -g base-index 1
setw -g pane-base-index 1
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded tmux configuration from ~/.tmux.conf"
# need more history limit
set -g history-limit 20000
# select, resize panes; copy text and so on
set -g mouse on
# % and " don't make sense to me
bind-key v split-window -h
bind-key s split-window -v
# alternative meta key split
bind -n M-V split-window -h
bind -n M-S split-window -v
# current path is what I want most of the time
bind -n M-v split-window -h -c "#{pane_current_path}"
bind -n M-s split-window -v -c "#{pane_current_path}"
# vi mode
set -g status-keys vi
setw -g mode-keys vi
# window title
setw -g automatic-rename on
set -g set-titles on
set -g renumber-windows on
# window switching
bind -n M-n next-window
bind -n M-p previous-window
# activities
set -g monitor-activity on
set -g visual-activity off
# pane switching easier with Alt (Meta key)
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D
# pane resizing
bind -r h resize-pane -L 5
bind -r l resize-pane -R 5
bind -r k resize-pane -U 5
bind -r j resize-pane -D 5
bind C-p setw synchronize-panes
bind -n M-[ copy-mode
# tmux < 2.4 will not work with these bind-keys
# but 2.4 is now pretty old ;)
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'V' send-keys -X select-line
bind-key -T copy-mode-vi 'r' send-keys -X rectangle-toggle
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'xsel -ib'
# color and stuff
set -g status-style fg=white,bg=black
setw -g window-status-current-style fg=white,bold,bg=colour202
# experiment with these settings more
#setw -g pane-border-style fg=green,bg=black
#setw -g pane-active-border-style fg=white,bg=yellow
#setw -g window-style fg=colour240,bg=colour235
#setw -g window-active-style fg=white,bg=black
#setw -g monitor-activity on
#set -g visual-activity on
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi C-\\ select-pane -l
bind C-l send-keys 'C-l'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
run '~/.tmux/plugins/tpm/tpm'
# powerline
if-shell 'command -v powerline-daemon' 'powerline-daemon -q'
if-shell 'env "$POWERLINE_CONFIG_COMMAND" tmux setup' '' 'run-shell "powerline-config tmux setup"'
if-shell 'command -v powerline' 'set -g status-right "#(powerline tmux right)"'
# any other custom local conf
if '[ -f ~/.tmux.conf.local ]' 'source ~/.tmux.conf.local'