-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
100 lines (79 loc) · 3.81 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
96
97
98
99
100
# set scroll history to 100,000 lines
set-option -g history-limit 10000
# modern colors
# vim normal color with this config
set -g default-terminal "xterm-256color"
# unbind the prefix and bind it to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# avoid ESC delay
set -s escape-time 0
# use vim mode
setw -g mode-keys vi
# tmux copy mode using 'v', 'V', 'C-v', 'y'
# by default, only 'V' (visual line selection) works
#
# must use single-quote below
bind -T copy-mode-vi 'v' send -X begin-selection
bind -T copy-mode-vi 'C-v' send -X rectangle-toggle
bind -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# move between panes with vi keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# move window using ctrl+h ctrl+l
# bind -r C-h select-window -t :-
# bind -r C-l select-window -t :+
# move window repeatly with n/p
bind -r n select-window -t :+
bind -r p select-window -t :-
# https://superuser.com/questions/1560523/how-do-i-resize-tmux-pane-by-holding-down-prefix-and-arrow-key-for-a-while#:~:text=To%20resize%20tmux%20panes%2C%20you,%2C%20U%2C%20L%2C%20R.
# adjust pane size using ctrl+hjkl
bind-key -r -T prefix C-h resize-pane -L 2
bind-key -r -T prefix C-l resize-pane -R 2
bind-key -r -T prefix C-k resize-pane -U 2
bind-key -r -T prefix C-j resize-pane -D 2
# mouse on
set -g mouse on
# Easy config reload: use <prefix> + R
# when you are not in tmux-session, use tmux source-file ~/.tmux.conf
bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# Easy rename window: use <prefix> + N
# reenable automatic renaming for the current window
bind N setw automatic-rename on \; display-message "automatic rename enabled"
# create new windows/panes in current same directory
bind c new-window -c "#{pane_current_path}"
bind "\"" split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# enable/disable synchronous input to all panes
bind C-Y set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
# renumber windows sequentially after closing any of them
set -g renumber-windows on
# start window numbers at 1 to match keyboard order with tmux order
set -g base-index 1
# status bar preview
set -g status-left-length 20
set -g status-left '#{?pane_input_off,#[fg=colour160],#[fg=colour136]}[#[fg=colour136]#S:#I.#P#{?pane_input_off,#[fg=colour160],#[fg=colour136]}] '
# complicated version status-bar
# set -g status-right '#[fg=colour166]#([ "$(tmux show-option -g prefix)" != "prefix C-a" ] && echo "($(tmux show-option -g prefix | cut -c 8-)) ")#[fg=colour33]%Y.%m.%d #{?client_prefix,#[fg=colour160],#[fg=colour61]}- #[fg=colour64]%H:%M #{?client_prefix,#[fg=colour160],#[fg=colour61]}- #[fg=colour37]#([ -f $HOME/.name ] && cat $HOME/.name || hostname)'
set -g status-right '#[fg=colour166]#([ "$(tmux show-option -g prefix)" != "prefix C-a" ] && echo "($(tmux show-option -g prefix | cut -c 8-)) ")#[fg=colour247]%H:%M #{?client_prefix,#[fg=colour247],#[fg=colour247]}- #[fg=colour247]#([ -f $HOME/.name ] && cat $HOME/.name || hostname)'
#### color (Solarized 256)
set -g status-style bg=colour235,fg=colour136
setw -g window-status-style fg=colour230
setw -g window-status-current-style fg=colour166
setw -g window-status-activity-style fg=colour61
setw -g window-status-bell-style fg=colour61
# set -g pane-border-style fg=colour235
# set -g pane-active-border-style fg=colour240
set -g message-style bg=colour235,fg=colour166
set -g pane-border-style fg=colour240
set -g pane-active-border-style fg=colour2
# pane number display
set -g display-panes-active-colour colour166 #blue
set -g display-panes-colour colour33 #orange
# clock
setw -g clock-mode-colour colour64 #green
# allow local customization in ~/.tmux_local.conf
if-shell "[ -f ~/.tmux_local.conf ]" 'source ~/.tmux_local.conf'