forked from zhammer/hmux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
80 lines (75 loc) · 3.74 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
# Custom bindings
set -g prefix C-x
set -g mouse off
bind C-x send-prefix
bind r source-file ~/.tmux.conf \; display "~/.tmux.conf reloaded"
set -g base-index 1
setw -g pane-base-index 1
bind -r M-Up resize-pane -U 5
bind -r M-Down resize-pane -D 5
bind -r M-Left resize-pane -L 5
bind -r M-Right resize-pane -R 5
bind -n M-[ copy-mode
bind -n M-] paste-buffer
bind -T copy-mode C-Left send-keys -X previous-word
bind -T copy-mode C-Right send-keys -X next-word-end
bind -n M-t new-window -n tmux-conf -c ~/.tmux.d/
# Emacs bindings
set -g status-keys emacs
setw -g mode-keys emacs
bind -n M-x command-prompt
bind -n M-: command-prompt
bind g if-shell "cd #{pane_current_path} && git diff" \
"new-window -n git-diff -c '#{pane_current_path}' '( git diff --color=always --ignore-space-change --ignore-all-space && echo && git -c status.color=always status ) | less -r'"\
"display 'Not a git repository.'"
bind 0 if-shell "tmux display-message -p '#{window_panes}' | grep -v '^1$'"\
"kill-pane"\
"display 'Attempt to delete sole ordinary panel'"
bind 1 run-shell "tmux list-panes | grep -o '%[[:digit:]]\\+' | xargs -I{} sh -c \
'if [ #D != {} ]; then tmux kill-pane -t {}; fi'"
bind 2 split-window -v -c "#{pane_current_path}" \; select-pane -l
bind 3 split-window -h -c "#{pane_current_path}" \; select-pane -l
bind k confirm-before -p "kill-pane '#W:#P'? (y/n)" kill-pane
bind b command-prompt "find-window '%%'"
bind C-b choose-tree -w
bind -n C-b switch-client -T SWITCHWINDOW
bind -T SWITCHWINDOW 0 select-window -t :=0
bind -T SWITCHWINDOW 1 select-window -t :=1
bind -T SWITCHWINDOW 2 select-window -t :=2
bind -T SWITCHWINDOW 3 select-window -t :=3
bind -T SWITCHWINDOW 4 select-window -t :=4
bind -T SWITCHWINDOW 5 select-window -t :=5
bind -T SWITCHWINDOW 6 select-window -t :=6
bind -T SWITCHWINDOW 7 select-window -t :=7
bind -T SWITCHWINDOW 8 select-window -t :=8
bind -T SWITCHWINDOW 9 select-window -t :=9
# Help mode
bind -n C-h switch-client -T HELP \; display "C-h (Type ? for further options)-"
bind -T HELP k list-keys # Display all key bindings.
bind -T HELP c new-window -n 'Commands' "man -P 'less -p ^COMMANDS' tmux" # Show the Commands tmux man page section.
bind -T HELP v new-window -n 'Variables' "man -P 'less -p \"Variable name\"' tmux" # Show the Variables tmux man page section.
bind -T HELP F new-window -n 'Formats' "man -P 'less -p ^FORMATS' tmux" # Show the Formats tmux man page section.
bind -T HELP h new-window -n 'Hooks' "man -P 'less -p ^HOOKS' tmux" # Show the Hooks tmux man page section.
bind -T HELP H show-hooks -g # Display all active global hooks.
bind -T HELP e new-window -n 'Environment' "man -P 'less -p ^ENVIRONMENT' tmux" # Show the Environment tmux man page section.
bind -T HELP E showenv # Display the active local tmux environment.
bind -T HELP g showenv -g # Display the active global tmux environment.
bind -T HELP o show-options # Display the active local tmux options.
bind -T HELP O show-options -g # Display the active global tmux options.
bind -T HELP w show-window-options # Display the active local tmux _window_ options.
bind -T HELP W show-window-options -g # Display the active global tmux _window_ options.
bind -T HELP ? switch-client -T HELP \; new-window -n 'Help Page' "~/.tmux.d/help_doc_gen.py ~/.tmux.conf | less"
bind -T HELP q if-shell "echo #W | grep 'Help Page'" "send-keys q"
# Shtyle
set -g status-left-length 20
set-window-option -g xterm-keys on
set -g default-terminal "xterm-256color"
set -g status-style fg=black,bg=default
setw -g window-status-style fg=cyan
setw -g window-status-current-style fg=magenta
set -g message-fg default
set -g message-bg default
set -g message-attr bright
setw -g mode-style bg=blue,fg=white
# Settings
set -g display-time 2000