-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
99 lines (77 loc) · 3.12 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
set -g default-terminal "screen-256color"
# Be more like screen since that's what I have to use at work
set -g prefix c-a
# Use C-s to send commands to the inner window of nested sessions
bind s send-prefix
# Ctrl-a d switches panes (overrides "detach from session" hotkey)
bind C-d last-pane
bind d last-pane
# Rebind the session key to allow switching windows quickly
bind C-s last-window
bind s last-window
# Let Ctrl-space do the same thing
bind Space last-window
bind C-Space last-window
# Same rename hotkey as screen
bind A command-prompt "rename-window '%%'"
# Make the current window cyan and bold
set -g status-bg black
set -g status-fg white
setw -g window-status-current-bg yellow
setw -g window-status-current-attr bold
# vim style copy-paste
bind y copy-mode
bind o paste-buffer
#bind -t vi-copy v begin-selection
#bind -t vi-copy y copy-selection
#bind -t vi-copy Escape cancel
# alow native xterm scrolling?
#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
#bind -n WheelUpPane copy-mode
# use vim motion keys while in copy mode
set-window-option -g mode-keys vi
# mouse support (annoying since it takes over all mouse interaction, but sometimes useful when pairing)
#set -g mode-mouse on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on
# I'm not hardcore enough for military time
set-window-option -g clock-mode-style 12
# reload tmux.conf
bind r source-file ~/.tmux.conf \; display-message " ✱ ~/.tmux.conf is reloaded"
# tmux is so slow by default (this allows for faster key repetition)
# On one machine, having it too slow causes garbage characters to print
# On another, having it not 0 causes home/end/ctrl-arrow/etc to not work :(
set -sg escape-time 0
set-option -g history-limit 10000
# disallow scripts from renaming the window (i.e. to the hostname:path on centos)
set-option -g allow-rename off
# something in this chain: cygwin -> ssh -> tmux -> vim wasn't respecting
# my arrow keys, and this fixes it.
#set -g xterm-keys on
# don't constrain the screen size based on clients connected to this session, rather
# constrain it based on clients connected to each specific window.
setw -g aggressive-resize on
# Tmux Plugin Manager - prefix + I to install plugins, U to update, alt+u to remove
set -g @plugin 'tmux-plugins/tpm'
# Default settings, handles reattach-to-user-namespace, etc
set -g @plugin 'tmux-plugins/tmux-sensible'
# Default pane control hotkeys
set -g @plugin 'tmux-plugins/tmux-pain-control'
# Allows saving and restoring of tmux sessions
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Use (n)vim's built in session restoring
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
# Override key bindings (shouldn't ever have to do this manually though)
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
## Automatically save and restore tmux sessions
set -g @plugin 'tmux-plugins/tmux-continuum'
# When the OS boots, open iTerm window and restore tmux in it
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm'
# Automatic restore
set -g @continuum-restore 'on'
run '~/.tmux/plugins/tpm/tpm'