-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtmux.conf
More file actions
149 lines (121 loc) · 4.58 KB
/
Copy pathtmux.conf
File metadata and controls
149 lines (121 loc) · 4.58 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Use vi bindings
setw -g mode-keys vi
set-option -g status-keys vi
# Allow nested tmux sessions by making "C-b b" possible for sending a control
# sequence to a nested session
bind-key b send-prefix
# XXX Not supported with version in CentOS 7
set-window-option -g mouse off
# Add true color support
# $TERM, fix colors / use true colors
# set -g default-terminal "tmux-256color"
set -g default-terminal "screen-256color"
# XXX this seems to be the setting breaking neomutt
# (artefacts in index after opening the pager)
# set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
# reload
bind-key R respawn-window
# Start Window Numbering at 1
set -g base-index 1
## Copy mode
# http://jasonwryan.com/blog/2011/06/07/copy-and-paste-in-tmux/
#
# Copying between tmux frames
# ctrl-b [ - enter copy mode
# move cursor to the start or end of the desired text string
# space - to activate selection
# V - to activate full line selection
# move cursor to cover the required content
# y - to copy system clipboard
# ctrl-b ] - to paste system clipboard
# URL view
bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'
# Shortcut for resizing panes
bind up resize-pane -U 5
bind down resize-pane -D 5
bind left resize-pane -L 5
bind right resize-pane -R 5
# pane movement
bind-key @ command-prompt -p "create pane from:" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
# window movement / renumbering like in screen's :number
bind-key m command-prompt -p "move window to:" "swap-window -t '%%'"
bind-key . command-prompt "move-window -r -t '%%'"
# Use zsh (login shell by default)
# https://superuser.com/questions/968942/why-does-tmux-create-new-windows-as-login-shells-by-default
# http://openbsd-archive.7691.n7.nabble.com/tmux-and-login-shells-td170948.html
# Use ZSH from homebrew on MacOS X
# if-shell "uname | grep -q Darwin" "set -g default-shell '/usr/local/bin/zsh'" "set -g default-shell '/bin/zsh'"
# Disable automatic changes of titles
set -g set-titles on
# set -g set-titles-string "#T"
set-window-option -g automatic-rename on
set-window-option -g allow-rename on
set -g renumber-windows on
set-option -g status-position "top"
# Tmux resurect
# prefix + Ctrl-s - save
# prefix + Ctrl-r - restore
# Restore more programms
set -g @resurrect-processes 'neomutt'
# set -g @resurrect-processes 'ssh mutt psql mysql sqlite3'
# set -g @resurrect-processes '"sudo journalctl -fxn"'
# Resurrect vim session (see https://github.com/tpope/vim-obsession)
#set -g @resurrect-strategy-vim 'session'
set -g @resurrect-strategy-nvim 'session'
# Resurrect pane content
set -g @resurrect-capture-pane-contents 'on'
# Custome tmux session
# new -s work -n work neomutt
# new -s work -n mail 'neomutt'
# new-window -n dashboard 'dashboard'
# new-window -n local
# select-window -t mail
# Tmux continuum
set -g @continuum-restore 'on'
# Managing plugins using TPM
# prefix+I to install
# prefix+U to update
# Logging
# Screenshot: prefix + alt + p
# Save complete history: prefix + alt + shift + p
# Unable to get some special char working
#set -g @almost-sensible 'off'
# arcticicestudio/nord-tmux \
set -g @tpm_plugins ' \
dracula/tmux \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-continuum \
tmux-plugins/tmux-yank \
tmux-plugins/tmux-pain-control \
tmux-plugins/tmux-copycat \
tmux-plugins/tmux-open \
tmux-plugins/tmux-prefix-highlight \
tmux-plugins/tmux-sessionist \
tmux-plugins/tmux-logging \
tmux-plugins/tpm \
'
# Dracula theme options
# https://draculatheme.com/tmux
set -g @dracula-show-battery false
set -g @dracula-show-network false
set -g @dracula-show-weather false
set -g @dracula-show-fahrenheit false
set -g @dracula-cpu-usage false
set -g @dracula-ram-usage false
set -g @dracula-gpu-usage false
set -g @dracula-show-powerline true
set -g @dracula-show-left-sep
set -g @dracula-show-right-sep
set -g @dracula-military-time true
set -g @dracula-show-left-icon 💀
set -g @dracula-border-contrast true
# Bootstrap tpm if needed
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# Initialize TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'
# Source local configuration if any
if '[ -f ~/.tmux.local.conf ]' 'run ~/.tmux.local.conf'