-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtmux.conf
104 lines (83 loc) · 3.81 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
# Tmux Config for v2.5+
# Make sure to `brew install tmux zsh`
# Copy/symlink this file to ~/.tmux.conf
# Install TPM: https://github.com/tmux-plugins/tpm
# On first run press C-Space + I to install (U is for upgrade)
# Remove default binding, even tmux devs remap it to C-a
unbind C-b
# Cmd-Space :: macOS == Alt-Space :: iTerm == Ctrl-Space :: tmux
set -g prefix C-Space
#TODO: Send remote tmux prefix key with prefix2
#Please don't escape my Escape!
#https://stackoverflow.com/a/13843382
set -s escape-time 0
# Because vim-tmux-navigator maps C-l to move->left
# With this enabled you can use <prefix> C-l to clear the screen.
# FIXME: not working
bind C-l send-keys 'C-l'
# If gotty is installed, share it instantly with `<prefix> C-t`
if-shell 'which gotty > /dev/null 2>&1' \
"bind-key C-t new-window \"gotty tmux attach -t `tmux display -p '#S'`\""
# Use zsh as default shell preferring local(brew)>usr(ubuntu)>bin(*nix)
if-shell '[ -x /usr/local/bin/zsh ]' \
"set-option -g default-shell /usr/local/bin/zsh"
if-shell '[ -x /usr/bin/zsh ]' \
"set-option -g default-shell /usr/bin/zsh"
if-shell '[ -x /usr/zsh ]' \
"set-option -g default-shell /bin/zsh"
set-window-option -g mode-keys vi
# If you disable the tmux-yank plugin below then you can use following:
# Ref: https://shapeshed.com/custom-vim-bindings-in-tmux-2-4/
#bind-key -T copy-mode-vi 'v' send -X begin-selection
#bind-key -T copy-mode-vi 'V' send -X select-line
#bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle
#bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# TODO: Note that copy/pasting from/to remote tmux session over ssh is tricky
# But it is possible with set of scripts using OSC 52 Escape codes
# See: https://sunaku.github.io/tmux-yank-osc52.html
# Make sure iTerm2 has access to system clipboard
set-option -g set-clipboard on
# And make copy pasta with mouse, select automagically copies
set-option -g mouse on
# Please don't rename my windows after I set them manually.
set-option -g allow-rename off
# Keep the window/pane numbers in order and start counting from 1
set-option -g renumber-windows on
set-option -g base-index 1
set-option -g pane-base-index 1
# Make full use of True colors. See: https://gist.github.com/XVilka/8346728
set-option -sa terminal-overrides ',*256color*:Tc'
# tmux-resurrect options
# Tmux Plugin Manager for improved UX.
set -g @plugin 'tmux-plugins/tpm' # TPM itself
# Sensible defaults for tmux
set -g @plugin 'tmux-plugins/tmux-sensible'
# Ctrl-{|,-} to split pane vertically/horizontally
set -g @plugin 'tmux-plugins/tmux-pain-control'
# First mark `prefix+m` pane, then switch to session and join `prefix+t{h,v,f}`
set -g @plugin 'tmux-plugins/tmux-sessionist'
# Use Ctrl-{h,j,k,l} to move between tmux/vim.
# Don't forget to `Plug 'christoomey/vim-tmux-navigator'` in vim
set -g @plugin 'christoomey/vim-tmux-navigator'
# Save/Restore tmux sessions `prefix + Ctrl-s` and `prefix + Ctrl-r`
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @resurrect-capture-pane-contents 'on'
set -g @continuum-save-interval '2'
# If you can give iTerm2 access to system clipboard, then you can skip installing
# and using `reattach-to-user-namespace`. Tested on Mojave, High Sierra. YMMV!
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @shell_mode 'vi'
# For tmux logging, saving history, screen capture
#set -g @plugin 'tmux-plugins/tmux-logging'
set -g history-limit 100000
# Theme options for tmux-themepack. XXX: Use edkolev/tmuxline.vim?
set -g @plugin 'jimeh/tmux-themepack'
set-option -g @themepack 'powerline/double/magenta'
set-option -g status-position top
# Unused but interesting enough plugins
#set -g @plugin 'tmux-plugins/tmux-copycat'
#set -g @plugin 'tmux-plugins/tmux-urlview'
#set -g @plugin 'tmux-plugins/tmux-open'
# this needs to be the last line
run '~/.tmux/plugins/tpm/tpm'