-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtmux.conf
100 lines (84 loc) · 3.71 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
# reload tmux
bind r source-file ~/.tmux.conf \; display "TMUX Config Reloaded"
# https://github.com/tmux/tmux/issues/543
# brew install reattach-to-user-namespace
# set -g default-shell $SHELL
# set -g default-command "reattach-to-user-namespace -l ${SHELL}"
# Start window number with 1
set-option -g base-index 1
# update numbering when 1 windows is closed
set-option -g renumber-windows on
set-window-option -g pane-base-index 1
set -g default-terminal "screen-256color"
# move to top the navigation
set-option -g status-position top
set -g status-keys vi
set -g history-limit 50000
setw -g mode-keys vi
set -g mouse on
setw -g monitor-activity on
# Focus events
set-option -g focus-events on
set-option -sg escape-time 10 #https://github.com/neovim/neovim/wiki/Building-Neovim#optimized-builds
# Cycle panes with C-b C-b
unbind ^B
bind ^B select-pane -t :.+
unbind ^k
# split shortcut
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
# aggressive resize
set-window-option -g aggressive-resize on
# Resize pane shortcuts
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# select pane
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"
bind-key -n 'C-\' if-shell "$is_vim" "send-keys 'C-\\'" "select-pane -l"
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
# Copy keys
bind P paste-buffer
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
bind-key -T copy-mode-vi 'r' send-keys -X rectangle-toggle
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
bind -r k clear-history
# THEME
# This tmux statusbar config was created by tmuxline.vim
# Dec 2022
set -g message-style bg="colour31"
set -g message-style fg="colour231"
set -g message-command bg="colour31"
set -g message-command fg="colour231"
set -g pane-active-border-style fg="colour254"
set -g pane-border-style fg="colour240"
set -g status "on"
set -g status-style "none"
set -g status-bg "colour234"
set -g status-justify "left"
set -g status-left-style "none"
set -g status-left-length "100"
set -g status-right-style "none"
set -g status-right-length "100"
setw -g window-status-style fg="colour250"
setw -g window-status-style "none"
setw -g window-status-activity-style bg="colour234"
setw -g window-status-activity-style "none"
setw -g window-status-activity-style fg="colour250"
setw -g window-status-separator ""
setw -g window-status-style bg="colour234"
set -g status-left "#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold,nounderscore,noitalics]"
set -g status-right "#[fg=colour236,bg=colour234,nobold,nounderscore,noitalics]#[fg=colour247,bg=colour236] %Y-%m-%d %H:%M #[fg=colour252,bg=colour236,nobold,nounderscore,noitalics]#[fg=colour235,bg=colour252] #h "
setw -g window-status-format "#[fg=colour244,bg=colour234] #I #[fg=colour250,bg=colour234] #W "
setw -g window-status-current-format "#[fg=colour234,bg=colour31,nobold,nounderscore,noitalics]#[fg=colour117,bg=colour31] #I #[fg=colour231,bg=colour31,bold] #W #[fg=colour31,bg=colour234,nobold,nounderscore,noitalics]"