Added vim mappings to tmux.
David Blume

David Blume commited on 2020-06-25 17:59:12
Showing 2 changed files, with 34 additions and 2 deletions.

... ...
@@ -1,6 +1,34 @@
1
+# C-b already in use by vim for page up. Use screen's prefix.
1 2
 set -g prefix C-a
2 3
 unbind C-b
3 4
 bind C-a send-prefix
5
+
6
+# No delay for escape key press (vim mode changes)
7
+set -sg escape-time 0
8
+
9
+# Vim style pane splitting
10
+bind-key v split-window -h
11
+bind-key s split-window -v
12
+
13
+# Vim style pane selection
14
+bind h select-pane -L
15
+bind j select-pane -D 
16
+bind k select-pane -U
17
+bind l select-pane -R
18
+
19
+# Use Alt-vim keys without prefix key to switch panes
20
+bind -n M-h select-pane -L
21
+bind -n M-j select-pane -D 
22
+bind -n M-k select-pane -U
23
+bind -n M-l select-pane -R
24
+
25
+# Use Alt-arrow keys without prefix key to switch panes
26
+bind -n M-Left select-pane -L
27
+bind -n M-Right select-pane -R
28
+bind -n M-Up select-pane -U
29
+bind -n M-Down select-pane -D
30
+
31
+# Theme
4 32
 set -g status-keys vi
5 33
 set -g status-fg white
6 34
 set -g status-bg colour235
... ...
@@ -12,3 +40,6 @@ setw -g mode-keys vi
12 40
 setw -g automatic-rename off
13 41
 setw -g window-status-current-format '#[fg=yellow]#I:#F:#T#[default]'
14 42
 setw -g window-status-format '#I:#F:#W'
43
+
44
+# prefix, C-Arrow doesn't work from PuTTY. Needs TERM to be xterm
45
+set -g terminal-overrides "xterm*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@"
... ...
@@ -52,8 +52,9 @@ See [config.dlma.com](http://config.dlma.com) for more.
52 52
         7. [visual-star-search](http://got-ravings.blogspot.com/2008/07/vim-pr0n-visual-search-mappings.html), so * and # work in visual mode too.
53 53
         8. Assorted favorite colors like [desert](https://github.com/dblume/desert.vim).
54 54
 3. .gitconfig and .gitignore
55
-4. .inputrc, for a [partially matched command history traversal](http://askubuntu.com/questions/59846/bash-history-search-partial-up-arrow/59855#59855).
56
-5. .ssh/config, for a [fix for CVE-2016-0777](https://news.ycombinator.com/item?id=10901588). (Or upgrade to OpenSSH 7.1p2 released Jan 14, 2016 from http://www.openssh.com.)
55
+4. .tmux.conf
56
+5. .inputrc, for a [partially matched command history traversal](http://askubuntu.com/questions/59846/bash-history-search-partial-up-arrow/59855#59855).
57
+6. .ssh/config, for a [fix for CVE-2016-0777](https://news.ycombinator.com/item?id=10901588). (Or upgrade to OpenSSH 7.1p2 released Jan 14, 2016 from http://www.openssh.com.)
57 58
 
58 59
 #### What's not installed
59 60
 
60 61