-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
111 lines (83 loc) · 3.37 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
# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
set -s escape-time 1
# Ensure that we can send Ctrl-A to other apps
bind C-a send-prefix
bind a last-window
# Pass proper keys to emacs
set-window-option -g xterm-keys on
# Set the base index for windows to 1 instead of 0
set -g base-index 1
# Set the base index for panes to 1 instead of 0
setw -g pane-base-index 1
# Reload the file with Prefix r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Set the default folder for the current session to the current path
bind v attach -c "#{pane_current_path}" \; display "Set default session path to #{pane_current_path}"
# splitting panes with | and -
bind | split-window -h
bind - split-window -v
# moving between panes with Prefix h,j,k,l
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Quick window selection
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
# Quick window swapping
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# Kidnap the last-selected pane for the current window
bind '\' join-pane -s !
# Pane resizing panes with 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
set -g mouse on
# Do not copy selection and cancel copy mode on drag end event
# Prefer iTerm style selection: select, then mouse click to copy to buffer
unbind -T copy-mode-vi MouseDragEnd1Pane
bind -T copy-mode-vi MouseDown1Pane select-pane \;\
send-keys -X copy-pipe "pbcopy" \;\
send-keys -X clear-selection
# Set the default terminal mode to 256color mode
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
# disable activity alerts
setw -g monitor-activity off
set -g visual-activity off
# enable vi keys.
setw -g mode-keys vi
set-option -g renumber-windows on
set-option -g allow-rename off
# Display the current pane's title in the terminal application's title bar
set-option -g set-titles on
set-option -g set-titles-string "#S[#W] - #T"
# a bit more scrollback than the default ~2000
set-option -g history-limit 10000
set -g default-shell /bin/zsh
set -g default-command "reattach-to-user-namespace -l /bin/zsh"
source-file ~/.tmux/minimalist
# https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future
# Setup 'v' to begin selection as in Vim
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Pick up from the last saved environment if tmux is restarted
set -g @continuum-restore 'on'
# Enable focus events in vim (advice from :CheckHealth)
set-option -g focus-events on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# Toggle synchronized panes — override tmux-sessionist
bind S run-shell "if [[ `tmux show-options -w | grep 'synchronize-panes.*on'` ]]; then toggle=off; else export toggle=on; fi; tmux display-message \"Synchronize: \$toggle\"; tmux set-option -w synchronize-panes \$toggle &> /dev/null"