~tommoa/dots

ref: 55ef81233d6785d97d8abc101d73fe0952807dd0 dots/.tmux.conf -rw-r--r-- 4.3 KiB
55ef8123Tom Almeida zsh: Add vi-mode maps 6 months ago
                                                                                
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
# If we're in an SSH session, use C-b for prefix, otherwise use C-space
if-shell 'test -n "${SSH_CLIENT}"' \
	'unbind C-space;set -g prefix C-b;bind C-b send-prefix' \
	'unbind C-b; set -g prefix C-space; bind C-space send-prefix'

set-option -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ',xterm-256color:Tc'
set-option -g renumber-windows on

setw -g mode-keys vi
set -s escape-time 0
set-option -g focus-events on

set -g set-titles on
set -g set-titles-string "#S: #W"

set -g mouse on

bind-key -n M-K new-window -c "#{pane_current_path}"
bind-key -n M-k new-window
bind-key -n M-[ switch-client -p
bind-key -n M-] switch-client -n
bind-key -n M-\\ switch-client -l
bind-key -n M-\' choose-tree -Zs
bind-key -n M-o choose-tree -Zw
bind-key -n M-1 select-window -t :1
bind-key -n M-2 select-window -t :2
bind-key -n M-3 select-window -t :3
bind-key -n M-4 select-window -t :4
bind-key -n M-5 select-window -t :5
bind-key -n M-6 select-window -t :6
bind-key -n M-7 select-window -t :7
bind-key -n M-8 select-window -t :8
bind-key -n M-9 select-window -t :9
bind-key -n M-0 select-window -t :0
bind-key -n M-. select-window -n
bind-key -n M-, select-window -p
bind-key -n M-y select-window -l
bind-key -n M-< swap-window -t -1
bind-key -n M-> swap-window -t +1
bind-key -n M-V split-window -h -c "#{pane_current_path}"
bind-key -n M-B split-window -v -c "#{pane_current_path}"
bind-key -n M-v split-window -h
bind-key -n M-b split-window -v
bind-key -n M-P command-prompt -I "" "rename-window '%%'"
bind-key -n M-W command-prompt -I "" "rename-session '%%'"
bind-key -n M-z resize-pane -Z
bind-key -n M-r select-pane -L
bind-key -n M-t select-pane -R
bind-key -n M-f select-pane -U
bind-key -n M-s select-pane -D
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
bind-key -n "M-R" run-shell 'old=$(tmux display -p "#{pane_index}"); tmux select-pane -L; tmux swap-pane -t "${old}"'
bind-key -n "M-S" run-shell 'old=$(tmux display -p "#{pane_index}"); tmux select-pane -D; tmux swap-pane -t "${old}"'
bind-key -n "M-F" run-shell 'old=$(tmux display -p "#{pane_index}"); tmux select-pane -U; tmux swap-pane -t "${old}"'
bind-key -n "M-T" run-shell 'old=$(tmux display -p "#{pane_index}"); tmux select-pane -R; tmux swap-pane -t "${old}"'
bind-key -n "M-S-Left" run-shell 'old=$(tmux display -p "#{pane_index}"); tmux select-pane -L; tmux swap-pane -t "${old}"'
bind-key -n "M-S-Down" run-shell 'old=$(tmux display -p "#{pane_index}"); tmux select-pane -D; tmux swap-pane -t "${old}"'
bind-key -n "M-S-Up" run-shell 'old=$(tmux display -p "#{pane_index}"); tmux select-pane -U; tmux swap-pane -t "${old}"'
bind-key -n "M-S-Right" run-shell 'old=$(tmux display -p "#{pane_index}"); tmux select-pane -R; tmux swap-pane -t "${old}"'
bind-key -n M-x kill-pane
bind-key -n M-X kill-window
bind-key -n M-/ copy-mode

bind-key -T copy-mode-vi n send-keys -X cursor-down
bind-key -T copy-mode-vi e send-keys -X cursor-up
bind-key -T copy-mode-vi i send-keys -X cursor-right
bind-key -T copy-mode-vi k send-keys -X search-again
bind-key -T copy-mode-vi j send-keys -X next-word-end

# If we're in X11, use xclip, otherwise use wl-copy
if-shell 'test -n "${DISPLAY}"' \
    'bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "wl-copy"' \
    'bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"'

bind-key -T copy-mode-vi N send-keys -X scroll-down
bind-key -T copy-mode-vi E send-keys -X scroll-up
bind-key -T copy-mode-vi I send-keys -X bottom-line
bind-key -T copy-mode-vi K send-keys -X search-reverse
bind-key -T copy-mode-vi J send-keys -X next-space-end

# Set status bar
set -g status-left "#[fg=black,bg=blue,bold] #S "
set -g status-right "#[fg=magenta] %b %d, %Y #[fg=white,nobold,noitalics,nounderscore]|#[fg=brightmagenta] %H:%M #[fg=white]|#[fg=green] #H "
set -g status-interval 1
set -g status on
set -g status-justify centre
set -g status-bg black
set -g status-fg white

# Windows
set -g window-status-format " #[fg=brightblack]#I #[fg=brightblack]#W"
set -g window-status-current-format " #[fg=cyan]#I#[fg=cyan,nobold,noitalics,nounderscore] #[fg=cyan]#W"
set -g window-status-separator " |"

# Panes
set -g display-panes-colour black
set -g display-panes-active-colour brightblack

# Clock
setw -g clock-mode-colour cyan