-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
131 lines (100 loc) · 3.62 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# vim:set ft=tmux:
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'seebi/tmux-colors-solarized'
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'
# Count sessions start at 1
set -g base-index 1
setw -g pane-base-index 1
set -g default-terminal "tmux-direct"
set -sg terminal-overrides ",*:RGB"
set -g mouse on
set -g history-limit 10000
# unbind c-b, use c-space
unbind-key C-b
set -g prefix C-Space
bind Space send-prefix
# enable things like alt-hjkl. See https://github.com/tmux/tmux/wiki/Modifier-Keys
set -s extended-keys on
# set -as terminal-features 'xterm*:extkeys'
# vi stuff
setw -g mode-keys vi
unbind-key -T copy-mode-vi v
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# lots of this is based on https://gist.github.com/spicycode/1229612
bind-key v split-window -h
bind-key s split-window -v
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Resize by adding shift
bind -n M-J resize-pane -D 5
bind -n M-K resize-pane -U 5
bind -n M-H resize-pane -L 5
bind -n M-L resize-pane -R 5
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Alt-n/p to switch windows
bind -n M-p previous-window
bind -n M-n next-window
# Double tap space to toggle the last two windows
bind-key C-Space last-window
# Alt-N/P to move windows
bind-key -n M-P swap-window -t -1
bind-key -n M-N swap-window -t +1
# Ctrl-Alt-h/j/k/l to move panes
bind-key -n C-M-h swap-pane -d -t "{left-of}"
bind-key -n C-M-l swap-pane -d -t "{right-of}"
bind-key -n C-M-j swap-pane -d -t "{down-of}"
bind-key -n C-M-k swap-pane -d -t "{up-of}"
# default is choose-window, this shows panes as well
bind w choose-tree
bind C-w choose-tree
# ! is already mapped to break-pane by default
# bind-key b break-pane
# send this pane into target pane
bind @ choose-tree 'join-pane -ht %%'
# bring another pane into this pane, horizontally
bind '#' split-window -h \; choose-tree 'kill-pane ; join-pane -hs %%'
bind S split-window -h \; choose-tree 'kill-pane ; join-pane -hs %%'
# bring another pane into this pane, vertically
bind V split-window -v \; choose-tree 'kill-pane ; join-pane -vs %%'
# send this window to another session
bind W split-window -v \; choose-tree 'kill-pane ; move-window -t %%'
# bring another window into this session
bind E split-window -v \; choose-tree 'kill-pane ; move-window -s %%'
# visual notification of activity in other windows
set -g visual-activity off
setw -g monitor-activity off
# Automatically set window title
setw -g automatic-rename on
set -g set-titles on
set -g set-titles-string '#h | #S | #W'
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
bind r source-file ~/.tmux.conf
# this will automatically resize the screen up unless another client is actually
# looking at the session
setw -g aggressive-resize on
# Set XTerm key bindings
setw -g xterm-keys on
source-file ~/.config/tmux/bergheim-dark.conf