-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
112 lines (83 loc) · 3.62 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
color_fg="#c0caf5"
color_bg="#24283b"
color_blue="#7aa2f7"
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind k set-option -g status
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ',xterm-256color:Tc'
set-option -gas terminal-overrides "*:Tc"
set-option -gas terminal-overrides "*:RGB"
# disable sound bell
set -g bell-action none
# disable visual bell
set -g visual-bell off
set -g xterm-keys on
setw -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
bind-key -T copy-mode-vi 'Y' send -X copy-end-of-line
bind-key -T copy-mode-vi 'H' send -X start-of-line
bind-key -T copy-mode-vi 'L' send -X end-of-line
# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "pbcopy"
# bind-key -T copy-mode-vi y send-keys -X copy-pipe "pbcopy"
bind 'C-a' copy-mode
setw -g mouse on
set-window-option -g mode-keys vi
set-option -g history-limit 100000
# enable double/curly underline
set-option -gas terminal-overrides '*:Smulx=\E[4::%p1%dm'
set-option -gas terminal-overrides '*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'
set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
set-option -ga terminal-features ",alacritty:usstyle"
# нумерация окон с единицы вместо ноля
set -g base-index 1
set-option -g base-index 1
setw -g pane-base-index 1
set -g -w automatic-rename on
set -g renumber-windows on
set -g bell-action none
set -s escape-time 0
# default statusbar colors
set-option -g status-fg $color_fg
set-option -g status-bg $color_bg
bind-key -n M-\[ previous-window
bind-key -n M-\] next-window
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind 'h' if-shell "$is_vim" 'send-keys C-a h' { if -F '#{pane_at_left}' '' 'select-pane -L' }
bind 'j' if-shell "$is_vim" 'send-keys C-a j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' }
bind 'k' if-shell "$is_vim" 'send-keys C-a k' { if -F '#{pane_at_top}' '' 'select-pane -U' }
bind 'l' if-shell "$is_vim" 'send-keys C-a l' { if -F '#{pane_at_right}' '' 'select-pane -R' }
bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 1'
bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 1'
bind -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 1'
bind -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 1'
bind-key -n M-\{ swap-window -t -1\; select-window -t -1
bind-key -n M-\} swap-window -t +1\; select-window -t +1
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind t split-window -l 35% -c "#{pane_current_path}"
# set-hook -g pane-set-clipboard "run-shell 'tmux show-buffer | pbcopy'"
set -s set-clipboard on
# set default shell
set-option -g default-shell /bin/zsh
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g status-right-length 100
set -g status-left ""
set -g status-right "%a %d.%m %H:%M "
set -g status-justify left
set -g window-status-current-format "#[fg=$color_blue,bold]#I:#W"
set -g window-status-format "#[fg=$color_fg]#I:#W"
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
set -ag update-environment "SSH_CLIENT,SSH_TTY"
# WARN: Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'