-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
165 lines (130 loc) · 4.78 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Use C-q instead of C-b
unbind C-b
set -g prefix C-q
bind C-q send-prefix
# Force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
# ez reload
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
bind-key M split-window -h "vim ~/.tmux.conf"
# Relax!
set -sg escape-time 0
set -sg repeat-time 600
# Mouse
set -g mouse on
# setw -g mouse-select-window on
# setw -g mouse-select-pane on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# Less stretching to get to the first item.
set -g base-index 1
setw -g pane-base-index 1
# Use vim keybindings in copy mode
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
unbind-key -T copy-mode-vi Space ; bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind-key -T copy-mode-vi Enter ; bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
unbind-key -T copy-mode-vi C-v ; bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
unbind-key -T copy-mode-vi [ ; bind-key -T copy-mode-vi [ send-keys -X begin-selection
unbind-key -T copy-mode-vi ] ; bind-key -T copy-mode-vi ] send-keys -X copy-selection
# More straight forward key bindings for splitting
unbind %
bind | split-window -h
bind h split-window -h
unbind '"'
bind - split-window -v
bind v split-window -v
# Moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Pane resizing
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Terminal emulator window title
set -g set-titles on
set -g set-titles-string '#S:#I.#P #W'
# UTF8
# set -g status-utf8 on
# Terminal junks!
set -g default-terminal "screen-256color"
# Bad Wolf
set -g status-fg white
set -g status-bg colour234
set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour39
set -g message-fg colour16
set -g message-bg colour221
set -g message-attr bold
# Custom status bar
# Powerline symbols: | | | |
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 5
set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour238,nobold]#[fg=colour15,bg=colour238,bold] #I.#P #[fg=colour238,bg=colour234,nobold]'
set -g status-right '#[fg=colour245]| #(date +"%a") %d %b %R #[fg=colour237] #[fg=colour247,bg=colour237] #[fg=colour16,bg=colour247,bold] #h '
set -g window-status-format "#[fg=white,bg=colour234] #I #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39] #[fg=colour16,bg=colour39,noreverse,bold] #I #W #[fg=colour39,bg=colour234,nobold]"
# Activity
setw -g monitor-activity on
set -g visual-activity on
# Autorename sanely.
setw -g automatic-rename on
# Better name management
bind c new-window
bind , command-prompt "rename-window '%%'"
# CLEAR
bind -n C-k send-keys "clear; tmux clear-history" \; send-keys "Enter"
# # improve colors
# # set -g default-terminal "tmux-256color"
# # act like vim
# setw -g mode-keys vi
# bind h select-pane -L
# bind j select-pane -D
# bind k select-pane -U
# bind l select-pane -R
# bind-key -r C-h select-window -t :-
# bind-key -r C-l select-window -t :+
# set -g prefix2 C-s
# # start window numbers at 1 to match keyboard order with tmux window order
# set -g base-index 1
# set-window-option -g pane-base-index 1
# # renumber windows sequentially after closing any of them
# set -g renumber-windows on
# # soften status bar color from harsh green to light gray
# set -g status-bg '#666666'
# set -g status-fg '#aaaaaa'
# # remove administrative debris (session name, hostname, time) in status bar
# # set -g status-left ''
# # set -g status-right ''
# # increase scrollback lines
# set -g history-limit 10000
# # prefix -> back-one-character
# bind-key C-b send-prefix
# # prefix-2 -> forward-incremental-history-search
# bind-key C-s send-prefix -2
# if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local'
# # remap prefix to Control + s
# set -g prefix C-s
# unbind C-b
# bind C-s send-prefix
# # force a reload of the config file
# unbind r
# bind r source-file ~/.tmux.conf
# # quick pane cycling
# unbind ^A
# bind ^A select-pane -t :.+
set-option -g default-command "reattach-to-user-namespace -l fish"
# st of plugins
# set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'