-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
133 lines (113 loc) · 5.14 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
# Make things more 'screen'-like
set -g prefix C-a
set -g renumber-windows on
unbind C-b
bind C-a send-prefix
bind a send-prefix
bind C-p previous-window
bind C-a last-window
bind C-n next-window
bind C-space next-window
bind space next-window
bind t command-prompt "rename-window %%"
# Comment out as this means I can't select things with the mouse now.
## Can select windows with mouse
#set-option -g mouse-select-pane on
# Only constrains window size if small window is looking at it
setw -g aggressive-resize on
# Highlight active window
set-window-option -g window-status-current-style bg=blue,fg=green,bright
# Dim inactive windows
set-window-option -g window-status-style dim
# Changes color of title of message windows
setw -g message-style fg=blue,bg=white
# Allows reloading of tmux.conf inside of tmux
bind C-r source-file ~/.tmux/reset_all_keys.conf\; source-file ~/.tmux.conf\; display-message "~/.tmux.conf is reloaded"
# Set up status line at the bottom of the screen
set -g status-left-length 50
set -g status-left '#[fg=blue][ #[fg=red]#H#[fg=blue] ]['
set -g status-right '#[fg=blue]][ #[fg=blue]%Y-%m-%d #[fg=red]%H:%M#[default] ]'
# Modify how the cursor goes around windows
bind C-n select-pane -t :.+
bind C-p select-pane -t :.-
# Allow resetting of windows as various layouts.
bind T select-layout tiled
#bind W select-layout even-vertical
bind C-w select-layout even-vertical
# Keys below are what you get using 'OPTION' and 1-5
# on a mac
bind ± select-layout even-horizontal
bind ² select-layout even-vertical
bind ³ select-layout main-horizontal
bind ´ select-layout main-vertical
bind µ select-layout tiled
# And, because for some reason I don't get this # dotdiffignore
# sent to tmux when it's running ON the mac, the # dotdiffignore
# versions that you get using 'SHIFT' and 1-5 # dotdiffignore
bind ! select-layout even-horizontal # dotdiffignore
bind @ select-layout even-vertical # dotdiffignore
bind \# select-layout main-horizontal # dotdiffignore
bind $ select-layout main-vertical # dotdiffignore
# Various ways to split window panes
bind % split-window -h
bind 5 split-window -hf
bind C-5 split-window -hbf
bind "'" split-window
bind \; split-window -b
bind j split-window # Current window vertical split at bottom of screen
bind k split-window -b # Current window vertical split at top of screen
bind l split-window -h # Current window horizontal split at right of screen
bind h split-window -bh # Current window horizontal split at left of screen
bind J split-window -f # Current window vertical split at bottom of screen
bind K split-window -bf # Current window vertical split at top of screen
bind L split-window -hf # Current window horizontal split at right of screen
bind H split-window -bhf # Current window horizontal split at left of screen
bind C-j split-window -f # Full width vertical split at bottom of screen
bind C-k split-window -bf # Full width vertical split at top of screen
bind C-l split-window -fh # Full width horizontal split at right of screen
bind C-\; split-window -fh
bind C-h split-window -bfh # Full width horizontal split at left of screen
# Set up keybinding to send all commands to all panes simultaneously
bind C-s set-window-option synchronize-panes
# Scrollback buffer n lines
set -g history-limit 500000
# Use ^u to clear the current buffer
bind C-u clear-history
# Some custom script file bindings so I can name my new windows
bind C run-shell ~/.tmux/foo.sh
bind C-C run-shell ~/.tmux/foo.sh
bind C-f run-shell ~/.tmux/four.sh
bind Z run-shell ~/.tmux/baz.sh
bind c run-shell ~/.tmux/single-window.sh
bind C-i run-shell ~/.tmux/eight-window.sh
bind C-y run-shell ~/.tmux/six-window-double-headline.sh
bind I run-shell ~/.tmux/sixteen-window.sh
bind C-t run-shell ~/.tmux/ten-window.sh
bind G run-shell ~/.tmux/twelve-window.sh
bind C-/ run-shell ~/.tmux/set-ten-window-layout.sh
bind M-/ run-shell ~/.tmux/set-twelve-window-layout.sh
bind C-\\ run-shell ~/.tmux/set-ten-window-layout.sh
bind M-\\ run-shell ~/.tmux/set-twelve-window-layout.sh
bind . run-shell ~/.tmux/rename-window.sh
bind > move-window
bind < move-window -r
# Shortcut for swapping panes in a window
# Taken from https://thoughtbot.com/upcase/videos/tmux-advanced-workflow
bind-key s display-panes\; command-prompt -p "pane #: " "swap-pane -t '%%'"
# Shortcut for joining a pane from another window to the current pane
bind-key M command-prompt -p "join pane from: " "join-pane -v -s '%%'"
# Shortcut for joining the current pane to another pane in another window
bind-key m command-prompt -p "join pane to: " "join-pane -v -t '%%'"
# REMINDERS:
# - Do C-a [ to enter select mode and C-a ] to paste the buffer
# - To get pane numbers C-a q
# - To switch two panes with each other: C-a :swap-pane -s <source_pane_number> -t <target_pane_number>
set -g pane-border-style fg=blue
set -g pane-active-border-style bg=blue
# Set the terminal to be 256 color
set -g default-terminal "screen-256color"
# Suggestions from nvim
#set-option -sg escape-time 10
#set-option -g focus-events on
#set-option -sa terminal-overrides ',xterm-256color:RGB'
#set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'