-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
93 lines (75 loc) · 3.16 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
# See this for upgrades: https://github.com/rothgar/awesome-tmux
set -g default-terminal "screen-256color"
# set shell to zsh
# osx - brew installs zsh to /usr/local/bin
# set-option -g default-shell /usr/local/bin/zsh
# linux - apt installs zsh to /usr/bin
set-option -g default-shell /usr/bin/zsh
# don't rename window on running command
set-option -g allow-rename off
# Status bar customization
set -g status-bg black
set -g status-fg white
set -g status-interval 5
set -g status-left-length 90
set -g status-right-length 60
# right status bar shows local IP address and clock
set -g status-right "#[fg=brightblue]#(ip addr show wlp2s0 | grep 'inet[^6]' | awk '{print $2}') #[fg=white]%H:%M:%S %d-%b-%y"
# update every second
set -g status-interval 1
# window/pane coloring for versions < 2.9
# set-window-option -g window-status-current-fg colour166 #orange
# set-window-option -g window-status-current-bg default
# set-window-option -g window-status-current-attr bright
# set-option -g pane-border-fg colour235 #base02
# set-option -g pane-active-border-fg green #base01
# window/pane coloring for versions 2.9
set -g window-status-current-style bg="default",fg="colour166"
set -g window-active-style 'fg=colour250,bg=black'
set -g pane-border-style fg="colour235"
set -g pane-active-border-style fg="green"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
# osx - use pbcopy - http://www.rushiagr.com/blog/2016/06/16/everything-you-need-to-know-about-tmux-copy-pasting/
# bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel pbcopy
# linux - use xclip from apt
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# Managing splits shouldn't be such a pain
bind-key f split-window -h -c '#{pane_current_path}'
bind-key v split-window -v -c '#{pane_current_path}'
bind-key x kill-pane
bind-key c new-window
# Start window numbering at 1
set-option -g base-index 1
set-window-option -g pane-base-index 1
bind-key C-n next-window
bind-key C-p previous-window
# Window navigation
unbind l
set-option -g prefix C-b
bind-key C-b last-window
# Pane navigation like Vim
bind-key j select-pane -D
bind-key k select-pane -U
bind-key h select-pane -L
bind-key l select-pane -R
# Reload with configuration with r
bind-key r source-file ~/.tmux.conf \; display "Config Reloaded!"
# Mouse works as expected
set -g mouse on
# Allows for faster key repetition
set -s escape-time 0
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
# TODO: make conditional on tpm/plugins being installed: https://stackoverflow.com/questions/35016458/how-to-write-if-statement-in-tmux-conf-to-set-different-options-for-different-t
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-processes 'ssh vim less tail rerun watch'
run -b '~/.tmux/plugins/tpm/tpm'
# ressurect on startup
run -b '~/.tmux/plugins/tmux-resurrect/scripts/restore.sh'