-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
151 lines (129 loc) · 4.61 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
#################
# General Setting
#################
# 256 color
# set -g default-terminal "screen-256color"
# set -g default-terminal "tmux-256color"
# set -g default-terminal "xterm-256color"
set-option -g default-terminal "screen-256color"
# set-option -g default-command bash
# Use <C-a> instead of the default <C-b> as Tmux prefix
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# Options enable mouse support in Tmux
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# set -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window on
# set-option -g mouse on
set -g mouse on
# Keep current working directory when open new window or panes
bind c new-window -c "#{pane_current_path}"
bind % split-window -hc "#{pane_current_path}"
bind '"' split-window -vc "#{pane_current_path}"
# Set focus-events on (important for Neovim autoread)
set -g focus-events on
#################
# Windows
#################
## Change window status style
#setw -g window-status-fg cyan
#setw -g window-status-bg default
#setw -g window-status-attr dim
set-window-option -g window-status-current-style "fg=black,bg=green"
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
#################
# Pains
#################
# Act more like vim:
set-window-option -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
unbind p
bind p paste-buffer
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
## Change pane border colors
#set -g pane-border-fg green
#set -g pane-border-bg black
set -g pane-active-border-style "bg=#444444,fg=default"
# set -g pane-active-border-style "bg=#585858,fg=default"
# Keep showing window numbe when <prefix> q
bind -T prefix e display-panes -d 0
#################
# Status Bar
#################
# Change status line color
set -g status-fg white
set -g status-bg black
## Set reflesh interval (default 15 sec)
# set -g status-interval 60
## Shift window list to center
set -g status-justify centre
## Enable visual knowtification
setw -g monitor-activity on
set -g visual-activity on
## Move status bar to top
set -g status-position top
## status left
set -g status-left-length 40
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P"
## status right
set -g status-right-length 80
# set -g status-right "Online:#{online_status} Battery:#{battery_icon} #{battery_percentage} #{battery_remain} #[fg=cyan]%m-%d (%j) %a %H:%M %z"
set -g status-right "#[fg=cyan]%m-%d (%j) %a %H:%M %z"
## change Battery icons
set -g @batt_charged_icon "❀"
set -g @batt_charging_icon "⚡︎"
set -g @batt_discharging_icon "🔋"
set -g @batt_attached_icon "😐"
# pain border status
set -g pane-border-status bottom
set -g pane-border-format " #{pane_index}:#{pane_current_command} #($HOME/dotfiles/.config/tmux/pane-border-format.sh #{pane_current_path})#{pane_current_path}"
set -g status-interval 5
#################
# Command line
#################
## command line color
set-option -g message-style fg=white,bright,bg=black
#################
# Clipboard
#################
# https://qiita.com/yuki-k/items/2a28b40f0bd49b2bcb21
# bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "xsel -ip && xsel -op | xsel -ib"
# bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "xsel -ip && xsel -op | xsel -ib"
# bind -t vi-copy Enter copy-pipe "xclip -i -selection clipboard"
# bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -i --clipboard"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i"
# bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
#################
# Plugins
#################
# https://github.com/tmux-plugins/tpm
# install tpm
# $ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Plugins
# set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-open'
# set -g @plugin 'tmux-plugins/tmux-online-status'
# set -g @plugin 'tmux-plugins/tmux-battery'
# Restore tmux environment after system restart.
# set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'tmux-plugins/tmux-continuum'
# pref + I to install plugins.
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# run -b '~/.tmux/plugins/tpm/tpm'
#################
# Config for nvim
#################
# https://github.com/neovim/neovim/wiki/FAQ#esc-in-tmux-or-gnu-screen-is-delayed
set-option -sg escape-time 10