-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtmux.conf
182 lines (148 loc) · 6.41 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# terminal color설정
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
#Reload
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# prefix키변경
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# 속도 향상
set-option -sg escape-time 1
# history
set -g history-limit 5000
# window 번호를 0이 아니라 1부터
set-option -g base-index 1
# pane 번호를 0이 아니라 1부터
set-window-option -g pane-base-index 1
# 윈도우를 닫으면, 남은 윈도우들의 번호를 다시 0부터 순차적으로 재정리
set-option -g renumber-windows on
#클립보드 연동관련 셋팅
# 이거실행하면 다운됨
#set -g default-command 'reattach-to-user-namespace $SHELL --login'
## Key Binds
# pane 분할을 v 와 s 로하고 현재 pane의 cwd를 이어받도록 함
unbind s
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
# 새 window 생성 때도 현재 cwd를 사용
bind c new-window -c "#{pane_current_path}"
# choose tree(세션 선택단축키 변경)
# bind p choose-tree
# vi 모드설정
# set-window-option -g mode-keys vi
# list-keys -T vi-copy
# set -g status-keys vi
# bind-key -T vi-copy 'v' begin-selection
# bind-key -T vi-copy 'y' copy-selection
# 페인 이동
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -n 'C-Space' if-shell "$is_vim" 'send-keys C-Space' 'select-pane -t:.+'
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
bind-key -T copy-mode-vi 'C-Space' select-pane -t:.+
# loud or quiet?
set-option -g visual-activity off
set-option -g visual-bell off
set-option -g visual-silence off
set-window-option -g monitor-activity off
set-option -g bell-action none
# ETC
set -g mouse on
set-option -g focus-events on
# # 상태줄 설정
# set-option -g status on
# set-option -g status-interval 1
# set-option -g status-justify centre
# set-option -g status-keys vi
# set-option -g status-position bottom
# set-option -g status-style fg=colour136,bg=colour235
# set-option -g status-left-length 20
# set-option -g status-left-style default
# set-option -g status-left "#[fg=green]#H #[fg=black]• #[fg=green,bright]#(uname -r)#[default]"
# set-option -g status-right-length 140
# set-option -g status-right-style default
# set-option -g status-right "#[fg=green,bg=default,bright]#(tmux-mem-cpu-load) "
# set-option -ag status-right "#[fg=red,dim,bg=default]#(uptime | cut -f 4-5 -d ' ' | cut -f 1 -d ',') "
# set-option -ag status-right " #[fg=white,bg=default]%a%l:%M:%S %p#[default] #[fg=blue]%Y-%m-%d"
# set-window-option -g window-status-style fg=colour244
# set-window-option -g window-status-style bg=default
# set-window-option -g window-status-current-style fg=colour166
# set-window-option -g window-status-current-style bg=default
# tpm tmux plugin manager
set-environment -g TMUX_PLUGIN_MANAGER_PATH ~/.config/tmux/.tmux/plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# list of tmux plugins
set -g @plugin "christoomey/vim-tmux-navigator"
set -g @plugin 'omerxx/tmux-sessionx' # default keybind "<prefix> o" to activate
set -g @sessionx-bind 'o'
# set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-cpu'
# set -g @plugin "tmux-plugins/tmux-resurrect" #persist tmux sessions after computer restart
# set -g @resurrect-capture-pane-contents "on"
set -g @plugin 'catppuccin/tmux'
# Configure the catppuccin plugin
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_window_status_style "rounded"
run ~/.config/tmux/plugins/tmux/catppuccin.tmux
# Make the status line pretty and add some modules
set -g status-right-length 100
set -g status-left-length 100
set -g status-left ""
set -g status-right "#{b:pane_current_path} "
set -agF status-right "#{E:@catppuccin_status_cpu}"
set -ag status-right "#{E:@catppuccin_status_session}"
set -ag status-right "#{E:@catppuccin_status_uptime}"
set -agF status-right "#{E:@catppuccin_status_battery}"
run ~/.config/tmux/plugins/tmux-plugins/tmux-cpu/cpu.tmux
run ~/.config/tmux/plugins/tmux-plugins/tmux-battery/battery.tmux
set -g @catppuccin_window_text "#{pane_current_command}"
set -g @catppuccin_window_current_text "#{pane_current_command}"
set -g @plugin 'sainnhe/tmux-fzf'
TMUX_FZF_LAUNCH_KEY="C-f"
set -g @plugin 'AngryMorrocoy/tmux-neolazygit'
set -g @open-lazygit 'g'
# pane border look and feel
# setw -g pane-border-status top
# setw -g pane-border-format ""
# setw -g pane-active-border-style "bg=#{@thm_bg},fg=#{@thm_overlay_0}"
# setw -g pane-border-style "bg=#{@thm_bg},fg=#{@thm_surface_0}"
# setw -g pane-border-lines single
## NOTE: Basic STATUS BAR ##
# set -g status-justify left
# set -g status-interval 2
# set -g status-position bottom
# set -g status-bg '#32364E'
# set -g status-fg '#CED6E2'
# set -g window-status-style "bg=#32364E,fg=#EEC4C1"
# set -g window-status-current-style "bg=#18181B,fg=#CED6E2"
## Show PREFIX on left side when c-b
# set -g status-left '#[fg=colour232,bg=#F7CA7A,bold]#{?client_prefix, <pre> ,}#[fg=#CED6E2,bg=#32364E,bold][#S] '
# set -g status-left-length 20
# Right side of status bar with custom date format and time
# set -g status-right '#[fg=#CED6E2,bg=#32364E] %d-%b-%y #[fg=#CED6E2,bg=#32364E] %H:%M:%S '
# set -g status-right ''
# set -g status-right-length 50
# initialize tmux plugin manager (keep this line at the bottom of the file)
run '~/.tmux/plugins/tpm/tpm'