-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
139 lines (104 loc) · 4.41 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
# set ` (tic) as the default prefix key combination
# and unbind C-b to free it up
unbind C-b
set -g prefix `
# use send-prefix to pass ` (tic) through to application
bind ` send-prefix
# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1
# Force tmux switch to next open session
set-option -g detach-on-destroy off
# Open $HOME when creating new window
bind c new-window -c "$HOME"
# Reload current pane
bind r respawn-pane -k -c "#{pane_current_path}"
# use PREFIX | to split window horizontally and PREFIX - to split vertically
bind | split-window -h
bind - split-window -v
# map Vi movement keys as pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes using PREFIX H, J, K, L
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
# Sync panes
bind C-s set-window-option synchronize-panes
# mouse control
set -g mouse on
# ----------------------
# Clipboard
# ----------------------
# use vim keybindings in copy mode
setw -g mode-keys vi
# setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel
# update default binding of 'Enter' to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel
# enable mouse copy on drag
bind-key -T copy-mode-vi MouseDragEnd1Pane
# ----------------------
# set some pretty colors
# ----------------------
# set pane colors - hilight the active pane
set-option -g pane-border-style fg=colour250 #base02
#set-option -g pane-border-style colour240
set-option -g pane-active-border-style fg=colour33 #blue
#set-option -g pane-active-border-style fg=colour240 #base01
# colorize messages in the command line
set-option -g message-style fg=brightred,bg=black
# ----------------------
# Status Bar
# -----------------------
set-option -g status on # turn the status bar on
#set -g status-utf8 on # set utf-8 for the status bar
set -g status-interval 5 # set update frequencey (default 15 seconds)
set -g status-justify centre # center window list for clarity
# set-option -g status-position top # position the status bar at top of screen
# visual notification of activity in other windows
setw -g monitor-activity on
set -g visual-activity on
# set color for status bar
set-option -g status-style fg=yellow,bg=default
# set window list colors - red for active and cyan for inactive
set-window-option -g window-status-style fg="#666666",bg=default,dim
set-window-option -g window-status-current-style fg=brightred,bg=default,bright
# show host name and IP address on left side of status bar
set -g status-left-length 85
# Show host, load averages, and an indicator for the prefix key
set -g status-left "#[fg=green]: #h : #[fg=brightblue]#(uptime | rev | cut -d ' ' -f 1-3 | rev) #{?client_prefix,#[fg=colour2]^A,} "
# executable and pathname
set -g window-status-format '#I❯#(echo "#{pane_current_path}" | rev | cut -d'/' -f-1 | rev) '
set -g window-status-current-format '#[fg=blue]#I#[fg=blue]❯#[fg=red]#(echo "#{pane_current_path}" | rev | cut -d'/' -f-1 | rev) '
# show session name, window & pane number, date and time on right side of status bar
set -g status-right-length 80
set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]: %d %b %Y #[fg=green]: %l:%M %p :"
# List of 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'
set -g @plugin 'tmux-plugins/tmux-copycat'
# Bootstrap tpm if needed
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
run '~/.tmux/plugins/tpm/tpm'
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-restore 'on'
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm'
# https://waylonwalker.com/tmux-fzf-session-jump/
bind C-j display-popup -E "\
tmux list-sessions -F '#{?session_attached,,#{session_name}}' |\
sed '/^$/d' |\
fzf --reverse --header jump-to-session --preview 'tmux capture-pane -pt {}' |\
xargs tmux switch-client -t"
# https://tangledhelix.com/blog/2012/04/28/iterm2-keymaps-for-tmux/
# Getting hexcodes: $ xxd -psg
bind C-p popup -E "~/scripts/tt.sh"