-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
146 lines (107 loc) · 3.92 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
#
# Config
#
# set-option -g default-shell /bin/zsh
set -g default-terminal "screen-256color"
set -ag terminal-overrides ",alacritty:RGB"
setw -g xterm-keys on
set -s escape-time 10 # faster command sequences
set -sg repeat-time 600 # increase repeat timeout
set -s focus-events on
set -g history-limit 100000
# Sort sessions by name
bind s choose-tree -s -O name
# Tmux prefix
# Use ctl-space for the prefix to free-up ctrl-b (which is very useful).
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
bind -r \; last-window
# Don't zero-index windows (makes switching with the keypad much nicer)
set -g base-index 1
setw -g pane-base-index 1
# History
set -g history-limit 10000
# No escape delay
set -sg escape-time 0
# No tab rename
set -g allow-rename off
# Vi
setw -g mode-keys vi
# Activity monitor
setw -g monitor-activity on
set -g visual-activity off
# Cursor shape change for nvim
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
# Key Bindings
#
# force a reload of the config file
bind R source-file ~/.tmux.conf \; display-message " Reloaded!"
# window splitting
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# resize panes
bind -r H resize-pane -L 1
bind -r J resize-pane -D 1
bind -r K resize-pane -U 1
bind -r L resize-pane -R 1
# Cut and Paste
bind-key -Tcopy-mode-vi Enter send -X copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -Tcopy-mode-vi y send -X copy-pipe "reattach-to-user-namespace pbcopy"
# create 'v' alias for selecting text
bind-key -Tcopy-mode-vi v send -X begin-selection
# clear screen
bind -r C send-keys -R \; clear-history \; send-keys Enter;
###############################
# Pane and Window Switching
###############################
# Vim Tmux Navigator
# https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'"
bind-key 'h' if-shell "$is_vim" 'send-keys F6' 'select-pane -L'
bind-key 'j' if-shell "$is_vim" 'send-keys F7' 'select-pane -D'
bind-key 'k' if-shell "$is_vim" 'send-keys F8' 'select-pane -U'
bind-key 'l' if-shell "$is_vim" 'send-keys F9' 'select-pane -R'
# mouse
set -g mouse on
unbind -T copy-mode-vi MouseDragEnd1Pane
#######################
# Status Bar
#######################
# Get readline in prompt, wooo
set -g status-keys emacs
# set refresh interval for status bar
set -g status-interval 30
# status bar
set -g status-justify left
# show session, window, pane in left status bar
set -g status-left '#{?pane_synchronized,#[bg=colour220],#[fg=colour16,bg=colour241]} #S #[fg=colour235,bg=colour238]▏'
set -g status-left-length 60
set -g status-right-length 38
set -g status-right '#{pomodoro_status} #[fg=colour220]#{?pane_synchronized,SYNC #[fg=colour235]▏,} #[fg=colour244]#(date "+%a %b%d") #[fg=colour235]▏ #[fg=colour249]#(date "+%I:%M%p") #[fg=colour235]'
set -g status-justify left
# syncronize panes
bind a setw synchronize-panes
#######################
# Colours
#######################
set -g window-status-current-format ' #F #W '
set -g window-status-format ' #F #W '
set -g window-status-activity-style fg=colour234,bg=colour238
set -g status-style fg=colour233,bg=colour238
set -g window-status-style fg=colour234,bg=colour238
set-window-option -g window-status-current-style '#{?pane_synchronized,bg=colour220,bg=colour244}'
set -g message-style fg=colour246,bg=colour238
set -g pane-border-style fg=colour234,bg=colour236
set -g pane-active-border-style fg=colour234,bg=colour236
#######################
# Plugins
#######################
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
setenv -g TMUX_PLUGIN_MANAGER_PATH "$HOME/.tmux/plugins/"
set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin"
run "~/.tmux/plugins/tpm/tpm"