update
[configs.git] / .tmux.conf
1 unbind-key C-b
2 set-option -g prefix C-p
3 bind-key p send-prefix
4 bind-key C-p last-window
5
6 setw -g window-status-format "#[bg=blue]#[fg=white]#I #W"
7 setw -g window-status-current-format "#[fg=white,bold]#[bg=cyan]#I #W"
8 set -g window-status-separator ' | '
9
10 set -g status-justify left
11 set -g status-fg white
12 set -g status-bg blue
13 set -g status-right ''
14 set -g status-left-length 100
15
16 set -g message-command-style "bold,fg=red,bg=blue"
17 set -g message-style "bold,fg=red,bg=blue"
18
19 set -g automatic-rename off
20
21 # Greather history
22 set -g history-limit 100000
23
24 # New session with prefix + C
25 bind-key C new-session \; command-prompt "rename-session %%"
26
27 # New window + title
28 bind-key c new-window \; command-prompt "rename-window %%"
29
30 # Shift arrow to switch windows
31 bind -n S-Left  previous-window
32 bind -n S-Right next-window
33
34 # Move windows with arrow keys
35 bind-key -n C-S-Left swap-window -t -1
36 bind-key -n C-S-Right swap-window -t +1
37
38 #  The default command key bindings are:
39 #
40 #  [           Enter copy mode to copy text or view the history.
41 #
42 #  Function                     vi              emacs
43 #  --------                     --              -----
44 #  Half page down               C-d             M-Down
45 #  Half page up                 C-u             M-Up
46 #  Next page                    C-f             Page down
47 #  Previous page                C-b             Page up
48 #  Scroll down                  C-Down or C-e   C-Down
49 #  Scroll up                    C-Up or C-y     C-Up
50 #  Search again                 n               n
51 #  Search again in reverse      N               N
52 #  Search backward              ?               C-r
53 #  Search forward               /               C-s
54 setw -g mode-keys vi
55
56 # Toggle mouse on with prefix + m
57 bind m \
58         set -g mouse on \;\
59         display 'Mouse: on'
60 # Toggle mouse off with prefix + M
61 bind M \
62         set -g mouse off \;\
63         display 'Mouse: off'
64
65 # Use escape for copy mode
66 unbind [
67 bind Escape copy-mode
68 # use vi style to select/copy/paste
69 bind-key -T copy-mode-vi v send -X begin-selection
70 bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
71 bind p paste-buffer
72
73 # useful to scroll but breaks copy&paste
74 # setw -g mouse on
75 # Scroll with the mouse
76 #bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'"
77
78 # No delay for escape key press
79 set -sg escape-time 0
80
81 # Reload tmux config
82 bind r source-file ~/.tmux.conf
83
84 # Automatically set window title
85 #set-window-option -g automatic-rename on
86 #set-option -g set-titles on
87
88 #set -g terminal-overrides 'xterm*:smcup@:rmcup@'