-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
94 lines (68 loc) · 3.24 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
set -g @plugin 'tmux-plugins/tmux-yank'
set -g default-terminal "xterm-256color"
#set -g default-terminal "screen-256color"
# Use <C-a> instead of the default <C-b> as Tmux prefix
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# Options to enable mouse support in Tmux
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Escape time for libtermkey
# (see https://github.com/neovim/neovim/issues/2036):
set -sg escape-time 10
# Act more like vi:
set-window-option -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
unbind p
bind p paste-buffer
bind-key -r -T prefix C-l resize-pane -R 5
bind-key -r -T prefix C-h resize-pane -L 5
bind-key -r -T prefix C-j resize-pane -D 5
bind-key -r -T prefix C-k resize-pane -U 5
# Edited for move to tmux 3.3
# bind -T vi-copy v send -X begin-selection
# bind -T vi-copy y send -X copy-selection
# Switch between first and last key
# Thanks to https://superuser.com/questions/429558/how-to-switch-between-two-latest-windows-in-tmux
bind-key C-a last-window
# in 2023 this is what worked to copy https://unix.stackexchange.com/questions/131011/use-system-clipboard-in-vi-copy-mode-in-tmux
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'
# Define my custom menu bar
# status bar colors
set -g status-bg black
set -g status-fg white
# alignment settings
set-option -g status-justify centre
# status left options
set-option -g status-left '#[fg=green][#[bg=black,fg=cyan]#S#[fg=green]]'
set-option -g status-left-length 20
# https://unix.stackexchange.com/questions/131011/use-system-clipboard-in-vi-copy-mode-in-tmux
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'pbcopy'
# window list options
# setw -g automatic-rename on
# set-window-option -g window-status-format '#[fg=cyan,dim]#I#[fg=blue]:#[default]#W#[fg=grey,dim]#F'
# set-window-option -g window-status-current-format '#[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=colour230]#W#[fg=dim]#F'
# set -g base-index 1
# window list options
setw -g automatic-rename on
setw -g window-status-current-format ' #[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=colour230]#{b:pane_current_path}(#W#[fg=dim])#F'
setw -g window-status-format ' #[fg=cyan,dim]#I#[fg=red]#{b:pane_current_path}:#W#[fg=grey](#W#[fg=dim])#F'
setw -g base-index 1
# status right options
set -g status-right '#[fg=cyan,bold] #(hostname |cut -d "." -f1) #(if [ -d ${HOME}/fbsource ]; then echo "fbcode|"; fi)#(if [ -d ${HOME}/configerator ]; then echo "configerator|"; fi)#(if [ -d ${HOME}/www ]; then echo "www|"; fi)#[fg=red]%H:%M %d-%b-%y#[default]'
# For Tmux >= 2.1
set -g mouse on
# I want to be notified when a command finishes: https://stackoverflow.com/questions/23755063/alert-in-tmux-when-a-process-completes
set-window-option -g visual-bell on
set-window-option -g bell-action other
# Let the visual bell be on for longer
set -g display-time 4000
# be sure to see note* below
# set -g window-status-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
# set -g window-status-current-format '#I:#(pwd="#{pane_current_path}"; echo ${pwd####*/})#F'
set-option -g history-limit 100000
# Post OSX 10.10 this is necessary to access clipboard
set-option -g default-command "reattach-to-user-namespace -l bash"