-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
142 lines (105 loc) · 5.2 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
setenv LANG en_US.UTF-8
set-option -g prefix C-t
bind-key C-t send-prefix
unbind-key C-b
set-option -g default-shell /bin/zsh
set-option -g default-command "exec arch -arch arm64 /bin/zsh --login"
set-option -g focus-events on
set-option -s escape-time 0
# Split window from current path
bind-key \\ split-window -h -c '#{pane_current_path}'
# Vertical split window from current path
bind-key - split-window -v -c '#{pane_current_path}'
# New Window
bind-key c new-window -c '#{pane_current_path}'
# Swap & Select window in order
bind-key C-] swap-window -t +1\; select-window -t +1
bind-key C-[ swap-window -t -1\; select-window -t -1
# Mode window in order
bind-key C-l select-window -t +1
bind-key C-h select-window -t -1
# Custom mouse settings
set-option -g mouse on
unbind-key -T root MouseDown1Pane
unbind-key -T root MouseDown3Pane
# Start window index 1 origin
set-option -g base-index 1
# Pane Title
bind-key C-t run 'zsh -c "arr=( top off ) && tmux setw pane-border-status \${arr[\$(( \${arr[(I)#{pane-border-status}]} % 2 + 1 ))]}"'
bind-key : command-prompt -p "(rename-pane)" "select-pane -T %%"
# Resize pane
bind-key -r H resize-pane -L 5
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r L resize-pane -R 5
# Change active pane
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Reload config file
bind-key r source-file ~/.tmux.conf\; display-message "[tmux] ~/.tmux.conf reloaded!"
# sync
bind a setw synchronize-panes \; display "synchronize-panes #{?pane_synchronized,on,off}"
# Look up in a man-page
bind-key m command-prompt -p "Man:" "split-window 'man %%'"
# active
set-option -g default-terminal screen-256color
set-option -ga terminal-overrides ",xterm-256color:Tc"
# status bar
set-option -g status-position top
# like a vim
set-window-option -g mode-keys vi
set -g status-keys vi
bind-key v copy-mode \; display "Copy mode!"
bind-key p paste-buffer
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
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi c send-keys -X clear-selection
bind-key -T copy-mode-vi H send-keys -X start-of-line
bind-key -T copy-mode-vi L send-keys -X end-of-line
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
set-environment -g PATH "/usr/local/bin:/bin:/usr/bin"
TMUX_FZF_SED="/usr/local/opt/gnu-sed/libexec/gnubin/sed"
# TokyoNight colors for Tmux
# https://github.com/folke/tokyonight.nvim/blob/f247ee700b569ed43f39320413a13ba9b0aef0db/extras/tmux/tokyonight_night.tmux
set -g mode-style "fg=#7aa2f7,bg=#3b4261"
set -g message-style "fg=#7aa2f7,bg=#3b4261"
set -g message-command-style "fg=#7aa2f7,bg=#3b4261"
set -g pane-border-style "fg=#3b4261"
set -g pane-active-border-style "fg=#7aa2f7"
set -g status "on"
set -g status-justify "left"
set -g status-style "fg=#7aa2f7,bg=#16161e"
set -g status-left-length "100"
set -g status-right-length "100"
set -g status-left-style NONE
set -g status-right-style NONE
set -g status-left "#[fg=#15161e,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#16161e,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#16161e] #{prefix_highlight} #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161e,bg=#7aa2f7,bold] #h "
if-shell '[ "$(tmux show-option -gqv "clock-mode-style")" == "24" ]' {
set -g status-right "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#16161e] #{prefix_highlight} #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d %H:%M #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161e,bg=#7aa2f7,bold] #h "
}
setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#16161e"
setw -g window-status-separator ""
setw -g window-status-style "NONE,fg=#a9b1d6,bg=#16161e"
setw -g window-status-format "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[default] #I #W #F #[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]"
setw -g window-status-current-format "#[fg=#16161e,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I #W #F #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]"
# tmux-plugins/tmux-prefix-highlight support
set -g @prefix_highlight_output_prefix "#[fg=#e0af68]#[bg=#16161e]#[fg=#16161e]#[bg=#e0af68]"
set -g @prefix_highlight_output_suffix ""
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin"
run -b '~/.tmux/plugins/tpm/tpm'