-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
136 lines (119 loc) · 5.51 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
# Basic
run $XDG_CONFIG_HOME/tmux/plugins/catppuccin/tmux/catppuccin.tmux
run-shell 'tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6- | tr -d \"[a-z]\")'
if-shell '[ $(echo "$TMUX_VERSION >= 3.3" | bc) = 1 ]' {
set-option -g allow-passthrough on
} {
# some basic mocha colors
set -g @ctp_bg "#24273a"
set -g @ctp_surface_1 "#494d64"
set -g @ctp_fg "#cad3f5"
set -g @ctp_mauve "#c6a0f6"
set -g @ctp_crust "#181926"
# status line
set -gF status-style "bg=#{@ctp_bg},fg=#{@ctp_fg}"
# windows
set -gF window-status-format "#[bg=#{@ctp_surface_1},fg=#{@ctp_fg}] ##I ##T "
# set -gF window-status-current-format "#[bg=#{@ctp_mauve},fg=#{@ctp_crust}] ##I ##T
}
set-option -g focus-events on
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color:Tc" # for True color support on tmux
set -ga terminal-overrides ',*:U8=0' # East Asian Width
#set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' # for change cursor shape function in neovim
set -sg escape-time 0 # for neovim escape
if-shell '[ -e /usr/bin/fish ]' {
set-option -g default-shell "/usr/bin/fish"
}
if-shell '[ -e /usr/local/bin/fish ]' {
set-option -g default-shell "/usr/local/bin/fish"
}
#set-window-option -g utf8 on
set-window-option -g mode-keys vi # Vi like keybind
# move to current directory when opening new pane
bind-key 'c' new-window -c '#{pane_current_path}'
bind-key '"' split-window -vc '#{pane_current_path}'
bind-key '%' split-window -hc '#{pane_current_path}'
# display status line when copy mode
bind-key [ copy-mode \; display "(Copy mode)"
bind-key Escape copy-mode \; display "(Copy mode)"
set-option -g display-time 1000
# mouse setting
#set-option -g mode-mouse on
#set-option -g mouse-select-pane on
#set-option -g mouse-resize-pane on
#set-option -g mouse-select-window on
set-option -g history-limit 100000
# setting select pane keybind to vi like
bind -r k select-pane -U
bind -r j select-pane -D
bind -r h select-pane -L
bind -r l select-pane -R
# use command name as window name
setw -g automatic-rename on
# set title of terminal emulator
set -g set-titles on
# update environment variable
set -g update-environment " COLORTERM DISPLAY KRB5CCNAME SSH_AGENT_PID SSH_ASKPASS SSH_AUTH_SOCK SSH_CONNECTION WAYLAND_DISPLAY WT_PROFILE_ID WINDOWID WT_SESSION XAUTHORITY"
# no more need to setting clipboard for each platform.
# we should use OSC 52
## tmux buffer to/from system clipboard
#if-shell -b '[ "$(uname)" = "Darwin" ]' {
# set -s copy-command "pbcopy"
# bind ] run "tmux set-buffer \"$(pbpaste)\"; tmux paste-buffer"
# display "using pbcopy as copy-command"
#} {
# if-shell -b '[ -e /mnt/c/Users/$USER/scoop/apps/win32yank/current/win32yank.exe ]' {
# set -s copy-command "/mnt/c/Users/$USER/scoop/apps/win32yank/current/win32yank.exe -i --crlf"
# bind ] run "tmux set-buffer \"$(/mnt/c/Users/$USER/scoop/apps/win32yank/current/win32yank.exe -o --lf)\"; tmux paste-buffer"
# display "using win32yank.exe as copy-command"
# } {
# if-shell -b '[ -n "$SSH_CONNECTION" ] && command -v $HOME/go/bin/lemonade > /dev/null' {
# set -s copy-command "$HOME/go/bin/lemonade copy"; \
# bind ] run "tmux set-buffer \"$($HOME/go/bin/lemonade paste)\"; tmux paste-buffer"
# display "using lemonade as copy-command"
# } {
# if-shell -b '[ -n "$WAYLAND_DISPLAY" ] && command -v wl-copy > /dev/null' {
# set -s copy-command "wl-copy --foreground --primary --type text/plain"
# bind ] run "tmux set-buffer \"$(wl-paste --no-newline --primary)\"; tmux paste-buffer"
# display "using wl-copy as copy-command"
# } {
# if-shell -b '[ -n "$WAYLAND_DISPLAY" ] && command -v waycopy > /dev/null' {
# set -s copy-command "waycopy -t text/plain"
# bind ] run "tmux set-buffer \"$(waypaste -t text/plain)\"; tmux paste-buffer"
# display "using waycopy as copy-command"
# } {
# if-shell -b '[ -n "$DISPLAY" ] && command -v xsel > /dev/null' {
# set -s copy-command "xsel --nodetach -i -p"
# bind ] run "tmux set-buffer \"$(xsel -o -p)\"; tmux paste-buffer"
# display "IS_X11: $IS_X11"
# display "using xsel as copy-command"
# } {
# if-shell -b '[ -n "$DISPLAY" ] && command -v xclip > /dev/null' {
# set -s copy-command "xclip -quiet -i -selection primary"
# bind ] run "tmux set-buffer \"$(xclip -o -selection primary)\"; tmux paste-buffer"
# display "using xclip as copy-command"
# } {
# display "cannot find valid copy-command"
# }
# }
# }
# }
# }
# }
#}
#set -s set-clipboard off
set -s set-clipboard external
# start selection in copy mode with v (like vim visual mode)
bind -Tcopy-mode-vi v send -X begin-selection
# yank selected text in copy mode with y (like vim)
bind -Tcopy-mode-vi y send -X copy-pipe-and-cancel
# mouse drag is also use as 'yank' command
bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel
# C-b C-r loading tmux.conf
unbind r
bind C-r source-file ~/.tmux.conf \; display-message "reloaded"
## screensaver
#set -g lock-after-time 1500
## what is the weather
#set -g lock-command 'watch -e -c -t -n 3600 "curl -s4 wttr.in/$CITY | head -27"'