-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtmux.conf
117 lines (90 loc) · 3.57 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
111
112
113
114
115
116
117
##################
# GLOBAL OPTIONS #
##################
set-option -g default-terminal "screen-256color"
set-option -gs escape-time 0
set-option -g base-index 1
setw -g aggressive-resize on
# https://gist.github.com/MohamedAlaa/2961058
setw -g mode-keys vi
### in copy-mode (started with prefix [):
# v to begin visual selection
# y to copy visual selection to clipboard
# C-v to toggle rectangular selection
# paste to terminal using Ctrl-Shift-v
# 'run' trick from oh-my-tmux
# >= v2.4
run -b 'tmux bind-key -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
run -b 'tmux bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "xclip -in -selection clipboard" 2> /dev/null || true'
# < v2.4
run -b 'tmux bind-key -t vi-copy v begin-selection 2> /dev/null || true'
run -b 'tmux bind-key -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind-key -t vi-copy y copy-pipe "xclip -in -selection clipboard" 2> /dev/null || true'
# large history
set-option -g history-limit 10000
# border colors
# setw -g mode-bg black
set -g status-bg colour11
set -g status-fg colour8
set -g pane-border-fg colour11
set -g pane-active-border-fg green
set -g pane-active-border-bg default
# show current window written in white on orange bg
set -g status-justify left
setw -g window-status-current-fg colour9
setw -g window-status-current-bg white
setw -g window-status-current-attr reverse
setw -g window-status-current-format '#I|#W#F'
setw -g window-status-format '#I|#W#F'
set -g status-left-length 16
# not setting these yet bc I'm ok with the default
# set-option -g status-left '» #T#[default]'
# set-option -g status-right '#[fg=red,bold][[ #(git branch) branch ]] #[fg=cyan]»» #[fg=blue,bold]###S #[fg=magenta]%R %m-%d#(acpi | cut -d ',' -f 2)#[default]'
set -g status-right-length 80
set -g status-right '#(date) @#(hostname)'
# Automatically set window title
setw -g automatic-rename on
# Information in terminal title: hostname, current window name
set-option -g set-titles on
set-option -g set-titles-string '#H:#W'
############
# BINDINGS #
############
# http://unix.stackexchange.com/questions/130730/how-to-quickly-send-commands-to-nested-tmux-sessions
bind-key -n C-S-b send-prefix
# reload config
bind-key r source-file ~/.tmux.conf
bind c new-window -c '#{pane_current_path}'
bind '"' split-window -v -c '#{pane_current_path}'
bind % split-window -h -c '#{pane_current_path}'
bind C new-session
# list sessions: prefix s
# list windows: prefix w
# toggle between last active windows: prefix l
# toggle between last active sessions: prefix L
# break pane: prefix :break-pane or prefix !
# %% = prompt for window.pane [-V|H] # vert|hor split
bind-key J command-prompt "joinp -t:%%"
###########
# PLUGINS #
###########
# install: prefix I
# update: prefix U
# uninstall: prefix alt-u
set -g @plugin 'tmux-plugins/tpm'
# Fuzzy extracting of filepaths, URLs, git hashes from current pane
set -g @plugin 'laktak/extrakto'
set -g @extrakto_key "/"
# Smart pane switching with awareness of Vim splits.
set -g @plugin 'christoomey/vim-tmux-navigator'
# Continuous saving of tmux-environment, and restoring at tmux start
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
set -g @resurrect-processes 'tig zathura mpv'
set -g @resurrect-strategy-vim 'session'
set -g @resurrect-save-command-strategy 'linux_procfs'
# machine-specific settings
run -b "[ -e ~/.files/local_tmux.conf ] && tmux source ~/.files/local_tmux.conf || true"
# Initialize tmux plugin manager (keep line at the very bottom)
run '~/.tmux/plugins/tpm/tpm'