-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
162 lines (127 loc) · 3.72 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
# Option
# set environment for plugin dir
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.config/tmux/plugins'
# put status bar to the top
set-option -g status-position top
# set default shell
if-shell 'uname | grep -q Darwin' \
'set-option -g default-shell /bin/zsh' \
'set-option -g default-shell /usr/bin/zsh'
if-shell 'uname | grep -q Darwin' \
'set-option -g default-command "reattach-to-user-namespace -l zsh"' \
''
# make shift+arrows, ctrl+arrow etc work in Vim
set -g xterm-keys on
# disable mouse mode
set -g mouse off
# focus events enabled for terminals that support them
set -g focus-events on
# set the default terminal mode to true color mode
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
# address vim mode switching delay
set -s escape-time 0
# messages are displayed for 1.5 seconds
set -g display-time 1500
# increase scroll back buffer size
set -g history-limit 10000
# set the base index for window and pane to 1 instead of 0
set -g base-index 1
set -g pane-base-index 1
set -g allow-rename off
# status setting
set -g status-interval 7
set -g status-right "#{sysstat_cpu} | #{sysstat_mem} | %y-%m-%d %R"
#set -g status-right "#{sysstat_cpu} | #{sysstat_mem} | #[fg=black]%y-%m-%d %R#[default]"
# enable vi keys
setw -g mode-keys vi
# unbind C-[
bind-key -T M-[ copy-mode
bind-key -T copy-mode-vi C-[ send -X cancel
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# emacs key bindings in tmux command prompt
set -g status-keys emacs
# Binding
# unbind default prefix C-b
unbind C-b
# unbind other useless keys to avoid misoperation
unbind Up
unbind Down
unbind Left
unbind Right
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right
unbind M-Up
unbind M-Down
unbind M-Left
unbind M-Right
unbind Space
unbind %
unbind '"'
unbind {
unbind }
unbind M-1
unbind M-2
unbind M-3
unbind M-4
unbind M-5
unbind M-n
unbind M-o
unbind M-p
unbind PPage
# setting the prefix from C-b to `
set -g prefix `
set -g prefix2 C-M-Space
# setting the delay between prefix and command
# bind to new one
bind ` send-prefix
# reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# splitting panes with | and -
bind | split-window -h
bind - split-window -v
# maximize pane, e.g. for copying
bind z resize-pane -Z
# resize pane
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
#bind P paste-buffer
# Plugin for TPM
set -g @plugin 'tmux-plugins/tpm'
## bind I to install plugin
set -g @plugin 'tmux-plugins/tmux-resurrect'
## bind C+s to save window
## bind C+r to restore window
set -g @resurrect-save-bash-history 'on'
set -g @resurrect-capture-pane-contents 'off'
set -g @resurrect-strategy-vim 'session'
set -g @plugin 'tmux-plugins/tmux-copycat'
## bind / to do regex search
## bind C+f simple file search
## bind C+g jumping over git status files
## bind A-h jumping overSHA-1 hashes
## bind C-u url search
## bind C-d number search
## bind A-i ip address search
set -g @plugin 'christoomey/vim-tmux-navigator'
## bind h select-pane -L
## bind j select-pane -D
## bind k select-pane -U
## bind l select-pane -R
set -g @plugin 'tmux-plugins/tmux-yank'
## bind y to [norm] yank cmdline; [copy] copy selection to system clipboard
## bind Y to [norm] yank PWD; [copy] copy selection and paste to command line
#set -g @plugin 'tmux-plugins/tmux-continuum'
#set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'egel/tmux-gruvbox'
# set -g status-bg colour240
# setw -g window-status-format '#[fg=colour12,bg=colour240]#I'
run '~/.config/tmux/plugins/tpm/tpm'
# Visual Effect
set -g @colors-solarized '256'