Fri, 03 Jun 2016 13:39:59 -0700
add interactive_comments
192 | 1 | # $Id: screen-keys.conf,v 1.7 2010-07-31 11:39:13 nicm Exp $ |
2 | # | |
3 | # By Nicholas Marriott. Public domain. | |
4 | # | |
5 | # This configuration file binds many of the common GNU screen key bindings to | |
6 | # appropriate tmux key bindings. Note that for some key bindings there is no | |
7 | # tmux analogue and also that this set omits binding some commands available in | |
8 | # tmux but not in screen. | |
9 | # | |
10 | # Note this is only a selection of key bindings and they are in addition to the | |
11 | # normal tmux key bindings. This is intended as an example not as to be used | |
12 | # as-is. | |
13 | ||
14 | # Set the prefix to ^A. | |
15 | unbind C-b | |
16 | set -g prefix ^A | |
17 | bind a send-prefix | |
18 | ||
19 | # Bind appropriate commands similar to screen. | |
20 | # lockscreen ^X x | |
21 | unbind ^X | |
22 | bind ^X lock-server | |
23 | unbind x | |
24 | bind x lock-server | |
25 | ||
26 | # screen ^C c | |
27 | unbind ^C | |
28 | bind ^C new-window | |
29 | unbind c | |
30 | bind c new-window | |
31 | ||
32 | # detach ^D d | |
33 | unbind ^D | |
34 | bind ^D detach | |
35 | ||
36 | # displays * | |
37 | unbind * | |
38 | bind * list-clients | |
39 | ||
40 | # next ^@ ^N sp n | |
41 | unbind ^@ | |
42 | bind ^@ next-window | |
43 | unbind ^N | |
44 | bind ^N next-window | |
45 | unbind " " | |
46 | bind " " next-window | |
47 | unbind n | |
48 | bind n next-window | |
49 | ||
50 | # title A | |
51 | unbind A | |
52 | bind A command-prompt "rename-window %%" | |
53 | ||
54 | # other ^A | |
55 | unbind ^A | |
56 | bind ^A last-window | |
57 | ||
58 | # prev ^H ^P p ^? | |
59 | unbind ^H | |
60 | bind ^H previous-window | |
61 | unbind ^P | |
62 | bind ^P previous-window | |
63 | unbind p | |
64 | bind p previous-window | |
65 | unbind BSpace | |
66 | bind BSpace previous-window | |
67 | ||
68 | # windows ^W w | |
69 | unbind ^W | |
70 | bind ^W list-windows | |
71 | unbind w | |
72 | bind w list-windows | |
73 | ||
74 | # quit \ | |
75 | unbind '\' | |
76 | bind '\' confirm-before "kill-server" | |
77 | ||
78 | # kill K k | |
79 | unbind K | |
80 | bind K confirm-before "kill-window" | |
81 | unbind k | |
82 | bind k confirm-before "kill-window" | |
83 | ||
84 | # redisplay ^L l | |
85 | unbind ^L | |
86 | bind ^L refresh-client | |
87 | ||
88 | # split -v | | |
89 | unbind | | |
90 | bind | split-window | |
91 | ||
92 | # :kB: focus up | |
93 | unbind Tab | |
94 | bind Tab select-pane -t:.+ | |
95 | unbind BTab | |
96 | bind BTab select-pane -t:.- | |
97 | ||
98 | # " windowlist -b | |
99 | unbind '"' | |
100 | bind '"' choose-window | |
101 | ||
102 | ||
103 | unbind l | |
104 | ||
105 | ||
106 | # $Id: vim-keys.conf,v 1.2 2010-09-18 09:36:15 nicm Exp $ | |
107 | # | |
108 | # vim-keys.conf, v1.2 2010/09/12 | |
109 | # | |
110 | # By Daniel Thau. Public domain. | |
111 | # | |
112 | # This configuration file binds many vi- and vim-like bindings to the | |
113 | # appropriate tmux key bindings. Note that for many key bindings there is no | |
114 | # tmux analogue. This is intended for tmux 1.3, which handles pane selection | |
115 | # differently from the previous versions | |
116 | ||
117 | # split windows like vim | |
118 | # vim's definition of a horizontal/vertical split is reversed from tmux's | |
119 | bind s split-window -v | |
120 | bind v split-window -h | |
121 | ||
122 | # move around panes with hjkl, as one would in vim after pressing ctrl-w | |
123 | bind h select-pane -L | |
124 | bind j select-pane -D | |
125 | bind k select-pane -U | |
126 | bind l select-pane -R | |
127 | ||
128 | # resize panes like vim | |
129 | # feel free to change the "1" to however many lines you want to resize by, only | |
130 | # one at a time can be slow | |
131 | bind < resize-pane -L 3 | |
132 | bind > resize-pane -R 3 | |
133 | bind - resize-pane -D 3 | |
134 | bind + resize-pane -U 3 | |
135 | ||
136 | # bind : to command-prompt like vim | |
137 | # this is the default in tmux already | |
138 | bind : command-prompt | |
139 | ||
140 | # vi-style controls for copy mode | |
141 | setw -g mode-keys vi | |
142 | ||
143 | ############ end vim-keys.conf | |
144 | ||
145 | ## Addt'l customization | |
146 | set-window-option -g mode-keys vi | |
147 | bind-key h select-pane -L | |
148 | bind-key j select-pane -D | |
149 | bind-key k select-pane -U | |
150 | bind-key l select-pane -R | |
151 | ||
152 | # Look good | |
278 | 153 | set -g default-terminal "screen-256color" |
192 | 154 | |
236
5f84469c2b05
imported patch mhoward-mbp
Meredith Howard <mhoward@roomag.org>
parents:
194
diff
changeset
|
155 | set -g mouse on |
5f84469c2b05
imported patch mhoward-mbp
Meredith Howard <mhoward@roomag.org>
parents:
194
diff
changeset
|
156 | |
277
5a1849a8608a
Disable mouse copy-mode
Meredith Howard <mhoward@roomag.org>
parents:
236
diff
changeset
|
157 | # I think I'd rather enter copy-mode intentionally |
5a1849a8608a
Disable mouse copy-mode
Meredith Howard <mhoward@roomag.org>
parents:
236
diff
changeset
|
158 | # bind -n WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M |
5a1849a8608a
Disable mouse copy-mode
Meredith Howard <mhoward@roomag.org>
parents:
236
diff
changeset
|
159 | # bind -n WheelDownPane select-pane -t= \; send-keys -M |
192 | 160 | |
161 | # Change cursor in vim to distinguish between insert and command mode | |
278 | 162 | set -g terminal-overrides '*88col*:colors=88,*256col*:colors=256,xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007:Cc=\E]12;%p1%s\007:Cr=\E]112\007:Cs=\E]50;CursorShape=%?%p1%{3}%<%t%{0}%e%p1%{2}%-%;%d\007' |
192 | 163 | |
164 | # Start tab numbering at 1 | |
165 | set -g base-index 1 | |
278 | 166 | set -g pane-base-index 1 |
167 | set -g renumber-windows on | |
192 | 168 | |
169 | # Allows for faster key repetition | |
278 | 170 | set -sg escape-time 0 |
192 | 171 | |
278 | 172 | set -g pane-border-style bg=colour232,fg=colour235 |
173 | set -g pane-active-border-style bg=colour232,fg=colour239 | |
174 | set -g window-active-style bg=colour232 | |
175 | ||
176 | set -g status-bg colour235 | |
177 | set -g status-fg cyan | |
192 | 178 | |
279 | 179 | set -g set-titles on |
180 | set -g set-titles-string "#h(#S)" | |
181 | ||
192 | 182 | source ~/.tmux.conf.local |
183 |