-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
executable file
·73 lines (55 loc) · 2.15 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
# 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-open'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tamorim/palenight-tmux'
set-option -g default-shell /bin/zsh
# Continuum automatic restore
set -g @continuum-restore 'on'
# Set Ctrl + a as prefix key
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# vi style bindings
set-window-option -g mode-keys vi
bind-key -r h select-pane -L
bind-key -r j select-pane -D
bind-key -r k select-pane -U
bind-key -r l select-pane -R
bind-key -r C-h resize-pane -L 5
bind-key -r C-j resize-pane -D 5
bind-key -r C-k resize-pane -U 5
bind-key -r C-l resize-pane -R 5
# Last session binding
bind-key b last-window
bind-key B switch-client -l
# Index starts from 1
set-option -g base-index 1
# Renumber windows when a window is closed
set-option -g renumber-windows on
# Reload ~/.tmux.conf
bind-key R source-file ~/.tmux.conf \; display-message 'Reloaded!'
# Use v on copy-mode to begin selection
bind-key -T copy-mode-vi 'v' send -X begin-selection
# Splits and window creation using current pane path
bind-key '/' split-window -h -c '#{pane_current_path}'
bind-key '-' split-window -v -c '#{pane_current_path}'
bind-key c new-window -c '#{pane_current_path}'
# Enable mouse mode
set -g mouse on
# Enable true color
set -g default-terminal "screen-256color"
set -ga terminal-overrides ',xterm-256color:Tc'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# Session fuzzy match
bind-key g new-window "tmux list-sessions | sed -E 's/:.*$//' | grep -v '^'$(tmux display-message -p '#S')'$' | fzf --reverse | xargs tmux switch-client -t"
# Pane conversion
bind-key J command-prompt -p "Join pane from:" "join-pane -s '%%'"
bind-key S command-prompt -p "Send pane to:" "join-pane -t '%%'"
# Run tmux-ressurrect restore on start-server
if-shell '[ "$(tmux list-sessions | wc -l )" -eq 0 ]' 'run-shell $HOME/.tmux/plugins/tmux-resurrect/scripts/restore.sh'