forked from sharpsaw/tmux-dots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
147 lines (103 loc) · 5.49 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# ——— Surprising Stuff, Up Front ———————————————————————————————————————————————
set -g base-index 1
# ——— Smarter Starting Paths ———————————————————————————————————————————————————
# Newly split shells start with the same $PWD as the shell you split from:
set -u default-path
# new-window's are $HOME.
bind ^c run "cd; tmux new-window"
bind c run "cd; tmux new-window"
# Note: In newer tmux versions (1.6?) you can do new-window -c $HOME
# ——— See the Keybinding Scripts: ——————————————————————————————————————————————
# keymux-altnums — Makes Alt+1, Alt+2, etc. switch windows.
# keymux-prefix — Redo the prefix key (good for nested sessions)
# ——— Vi-key navigation -———————————————————————————————————————————————————————
# Use vi copy mode even if $EDITOR is not set to vi/vim
setw -g mode-keys vi
# Spiffy Alt+[hjkl] pane nav thanks to @nviennot!
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
# Nudge panes by 10, via capital HJKL
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
# easier access to page-up and page-down in copy mode
bind -t vi-copy C-k page-up
bind -t vi-copy C-j page-down
# ——— Misk Key speedups ————————————————————————————————————————————————————————
# ALt+Tab to cycle panes (assuming your WM doesn't steal the keybinding)
# TODO: Make it more Alt-Tabby, so you can cycle further. For now it's OK.
bind -n M-Tab last-pane
# Rename window, but don't require clearing preexisting title:
bind , command-prompt "rename-window '%%'"
# ——— Be screen-like for the rest ——————————————————————————————————————————————
bind ^[ copy-mode
# detach ^D d
bind ^D detach
# displays *
bind * list-clients
# next ^@ ^N sp n
bind ^@ next-window
bind ^N next-window
bind ' ' next-window
bind n next-window
# title A
bind A command-prompt "rename-window %%"
# other ^A
bind ^P previous-window
bind p previous-window
bind BSpace previous-window
# windows ^W w
bind ^W list-windows
bind w list-windows
# quit \
bind \ confirm-before "kill-server"
# redisplay ^L # But not 'l' (-rking)
bind ^L refresh-client
# ——— Misc Settings ————————————————————————————————————————————————————————————
set -g history-limit 99999
# Still requires tmux -2 on older versions (I think before 1.6 or 1.7)
set -g default-terminal "screen-256color"
# The 1000ms setting is insane, by default. Ruins Alt+__ for no reason.
set-option escape-time 50
set -g visual-activity on
setw -g monitor-activity on
setw -g automatic-rename off
# ——— Deprecated Bindings ——————————————————————————————————————————————————————
# These are nice, but can't be used in vim (since ^w- and ^w| are already taken)
# Instead, ^b% and ^b" (the default tmux bindings) are preferred.
# Turn panes like [ ] into [ | ]
bind | split-window -h
# Turn panes like [ ] into [———]
bind - split-window
# ——— Cosmetics ————————————————————————————————————————————————————————————————
set -g status-utf8 on
set -g status-justify centre
set -g status-bg black
set -g status-right "#[fg=cyan]sess▶#S #[fg=white]user▶#(whoami) #[fg=red]host▶#H"
# TODO: Put something useful on the left
# set -g status-left-length 30
# set -g status-left ""
setw -g window-status-bell-attr default
setw -g window-status-bell-fg red
setw -g window-status-activity-attr bold
setw -g window-status-format "#[fg=cyan]#F#[fg=white]#I#[fg=cyan]≡#[fg=white]#12W"
setw -g window-status-current-format "#[fg=red]▶#[fg=white]#I#[fg=red,bold]≡#[fg=white]#W"
set -g pane-border-fg colour238
set -g pane-border-bg black
set -g pane-active-border-fg white
set -g pane-active-border-bg black
set -g message-fg white
set -g message-bg black
set -g message-attr bright
# ——— Now Loop over ~/.tmux.d ——————————————————————————————————————————————————
# This is so we can have plugin-style configs. See below for an example use
run source-tmux-dot-d # FIXME upon server start, this gives an error.
# ——— Deprecated ———————————————————————————————————————————————————————————————
if '[ -n "$TMUXESC" ]' "set -g prefix C-$TMUXESC; unbind C-$TMUXESC; bind C-$TMUXESC last-window; bind $TMUXESC send-prefix"
if '[ -z "$TMUXESC" ]' "bind b send-prefix; bind C-b last-window"
# Better would be to put:
# run keymux-prefix a
# in your ~$USER-dots/.tmux.d/preferred-prefix