forked from lqueryvg/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
172 lines (146 loc) · 5.6 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# Prefix {{{
# ----------
################
# For some reason Tmux won't allow CapsLock to be mapped.
# So, remap useless F10 key to CapsLock using external tools then
# let Tmux believe it's working with F10.
# On Windows, use AutoHotkey with the following script:
# Capslock::F10
# F10::Capslock
# then compile the script and put it in Startup
# On Linux, use xmodmap.
unbind C-b
set-option -g prefix F10 # prefix is F10 (really Caps Lock)
bind-key F10 last-window # F10 twice switches windows#
# }}}
# Misc# {{{
# ---------
#setw -g mode-mouse off
set -g mouse on
#setw -g mode-mouse on
#set -g mouse-utf8 off
# use vi keys
setw -g mode-keys vi
#
# Terminal emulator window title
set -g set-titles on
set -sg escape-time 5 # Tiny delay after each Escape press
# Otherwise gets when hittin Esc in vi.
# For some reason, value of zero breaks
# the tmux prefix altogether.
#set-option -gw xterm-keys on
set -g terminal-overrides 'xterm:colors=256'
set -g base-index 1 # because default 0 key is a long way from 1
# }}}
# Panes {{{
# ----------
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
# Panes
bind h select-pane -L
bind l select-pane -R
bind j select-pane -D
bind k select-pane -U
# resize pane by 5 chars, -r allows key repeat
bind -r C-h resize-pane -L 1
bind -r C-j resize-pane -D 1
bind -r C-k resize-pane -U 1
bind -r C-l resize-pane -R 1
# resize pane by 5 chars, -r allows key repeat
bind -r M-h resize-pane -L 5
bind -r M-j resize-pane -D 5
bind -r M-k resize-pane -U 5
bind -r M-l resize-pane -R 5
# force myself to stop using arrows
# these were for pane
bind Left display-message "use 'h' to go Left pane"
bind Right display-message "use 'l' to go Right pane"
bind Down display-message "use 'j' to go Down pane"
bind Up display-message "use 'k' to go left pane"
bind C-Left display-message "use 'Ctrl-h' to resize pane Left by 1"
bind C-Down display-message "use 'Ctrl-l' to resize pane Down by 1"
bind C-Up display-message "use 'Ctrl-j' to resize pane Up by 1"
bind C-Right display-message "use 'Ctrl-k' to resize pane Right by 1"
bind M-Left display-message "use 'Alt-h' to resize pane Left by 5"
bind M-Down display-message "use 'Alt-l' to resize pane Down by 5"
bind M-Up display-message "use 'Alt-j' to resize pane Up by 5"
bind M-Right display-message "use 'Alt-k' to resize pane Right by 5"
bind J display-message "choose source with pane to be joined to current" \; \
choose-window "join-pane -s '%%'"
# }}}
# selection {{{
# --------------
#bind -t vi-copy v begin-selection " this breaks block selection!!
#bind -t vi-copy y copy-selection
#bind -t vi-copy y copy-selection \; run-shell cp_tmux_sel.sh
#bind -t vi-copy y run-shell cp_tmux_sel.sh
#bind y run-shell "~/dotfiles/bin/cp_tmux_sel.sh"
bind-key -T copy-mode-vi Escape send-keys -X cancel
bind-key -T copy-mode-vi MouseDragEnd1Pane \
send-keys -X copy-selection \; \
run-shell cp_tmux_sel.sh
bind-key -T copy-mode-vi y \
send-keys -X copy-selection \; \
run-shell cp_tmux_sel.sh \; \
send-keys -X cancel
#bind-key -T copy-mode-vi MouseUp1Pane \
#send-keys -X cancel
# if double click on word, go into copy mode and select it
bind -T root DoubleClick1Pane \
select-pane \; \
copy-mode \; \
send-keys -X select-word
# if middle click while in copy mode, paste selection (if any)
bind-key -T copy-mode-vi MouseDown2Pane \
send-keys -X copy-selection-and-cancel \; \
run-shell cp_tmux_sel.sh \; \
paste-buffer
# display-message "hello"
#bind-key -T copy-mode-vi MouseDown2Pane display-message "hello"
#unbind-key -T copy-mode-vi MouseDown2Pane
#bind-key -T copy-mode-vi MouseDown3Pane display-message "hello"
set-option -g word-separators ' ,'
# BODGE: This should work by default (problem gone away?)
#bind-key -t vi-copy j cursor-down
# http://askubuntu.com/questions/507214/why-does-tmux-byobu-fill-my-screen-with-garbage-characters-when-i-copy-a-selecti
set -g set-clipboard off
# }}}
# windows {{{
bind - split-window
bind | split-window -h
bind '"' display-message "use '-' for horizontal split"
bind % display-message "use '|' for vertical split"
bind-key -r b select-window -t :- # prev window
bind p display-message "use 'b' for previous window"
#bind-key -r n select-window -t :+ # next window, this stays as default
# }}}
# Status Bar {{{
# --------------------------------------
#setw window-status-format '#I'\; setw window-status-current-format '#I'
# Default colors
set -g status-bg black
set -g status-fg white
# Left side of status bar
set -g status-left-length 20
set -g status-left '#[fg=green][#S]'
# Inactive windows in status bar
set-window-option -g window-status-format '#[fg=cyan,dim]#I#[fg=blue]:#[default]#W#[fg=grey,dim]#F'
# Current or active window in status bar
set-window-option -g window-status-current-format '#[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=white]#W#[fg=dim]#F'
# Alerted window in status bar. Windows which have an alert (bell, activity or content).
#set-window-option -g window-status-alert-fg red
#set-window-option -g window-status-alert-bg white
# Right side of status bar
set -g status-right '#[fg=green][#[fg=white]#T#[fg=green]]'
#--------------------------# }}}
# colours# {{{
set -g pane-active-border-style 'bg=blue,fg=white'
set -g pane-border-style 'bg=colour245,fg=blue'
## }}}
# plugins# {{{
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
run '~/.tmux/plugins/tpm/tpm'
## }}}
# vim:foldmethod=marker:foldlevel=0