-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
95 lines (84 loc) · 3.8 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
## command prefix
set-option -g prefix C-f
bind-key C-f send-prefix
unbind-key C-b
## basic global settings
set-option -s escape-time 0
set-option -g default-terminal "screen-256color"
set-option -g history-limit 10000
set-option -g base-index 1
set-window-option -g pane-base-index 1
set-option -g allow-rename on
set-option -g set-titles on
set-option -g set-titles-string '#W (#h)'
set-option -ga terminal-overrides ",xterm*:smcup@:rmcup@"
set-option -g aggressive-resize on
set-option -g update-environment -r
set-option -g repeat-time 300 # this may need tweaking to suit your preferences
set-option -g display-panes-time 2000
set-window-option -g automatic-rename off
set-window-option -g allow-rename off
## enable mouse
set-option -g mouse on
#set-option -g mouse-resize-pane on
#set-option -g mouse-select-pane on
#set-option -g mouse-select-window on
## reload tmux config
bind r source-file ~/.tmux.conf \; display-message "Configuration reloaded."
## vi settings
set-option -g mode-keys vi
set-option -g status-keys vi
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-selection
## vi-style pane selection and resizing
# move - no prefix using alt. If any of your terminal apps use alt + [hjkl] then this will conflict.
bind-key -n M-h select-pane -L
bind-key -n M-j select-pane -D
bind-key -n M-k select-pane -U
bind-key -n M-l select-pane -R
# move
bind-key -r C-h select-pane -L
bind-key -r C-j select-pane -D
bind-key -r C-k select-pane -U
bind-key -r C-l select-pane -R
# resize
bind-key -r h resize-pane -L 5
bind-key -r j resize-pane -D 5
bind-key -r k resize-pane -U 5
bind-key -r l resize-pane -R 5
## split panes and cycling
bind-key \\ split-window -h -c '#{pane_current_path}'
bind-key - split-window -v -c '#{pane_current_path}'
bind-key C-n next-window
bind-key C-p previous-window
# move with alt+[np] and no prefix
bind-key -n M-n next-window
bind-key -n M-p previous-window
## Write pane history to a file
bind-key P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'
## clear scrollback history (-n means it doesn't need the command prefix)
bind -n C-k clear-history
## colors (solarized dark)
set -g status-bg black
set -g status-fg yellow
set -g status-attr default
setw -g window-status-fg brightblue
setw -g window-status-bg default
setw -g window-status-current-fg yellow
setw -g window-status-current-bg default
setw -g window-status-current-attr dim
set -g pane-border-fg black
set -g pane-border-bg default
set -g pane-active-border-fg yellow
set -g pane-active-border-bg default
set -g message-bg black
set -g message-fg yellow
set -g display-panes-active-colour yellow
set -g display-panes-colour brightblue
setw -g clock-mode-colour yellow
set -g status-left "[#S:#P]"
## this doesn't work.
##bind s neww "$(ps -ao pid,tty,args | sort | awk '$1 ~ /#{pane_pid}/{VAR=$2} $2 ~ VAR && $3 ~ /ssh/{$1=\"\"; $2=\"\"; print}')"
#bind-key S neww "$(ps -eo 'ppid command' | sed -n '/^ *#{pane_pid}/s/ *#{pane_pid} //p')"
#bind w neww "$(ps -eo 'ppid command' | sed -n '0,/#{pane_pid}/s/#{pane_pid}//p')"
#bind q neww "$(ps -eo 'ppid command' | sed -n '0,/12928/s/#{pane_pid}//p')"