-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
116 lines (99 loc) · 5.1 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
# set timezone
# set -g status-right '#(TZ="Europe/Prague" date +%%H:%%M)'
# change the prefix key to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# Add row history, default 2000
set -g history-limit 50000
# turn on mouse mode
set -g mouse on
# tmux buffer to clipboard
## if there is no support for setting clipboard using xterm escape sequence, this option should be off
set -s set-clipboard off
## tmux copy to system clipboard automatically (install xsel)
### xclip possible but not working (don't know why): "xclip -i -sel clip > /dev/null"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
## mouse copy to clipboard on drag od double-click (if disabled, you can copy to system clipboard with shift)
bind-key -T copy-mode-vi DoubleClick1Pane send-keys -X select-word \; run-shell "sleep .3s" \; send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
## mouse copy word to clipboard on double-click (if disabled, you can copy to system clipboard with shift)
bind-key -n DoubleClick1Pane copy-mode -M \; send-keys -X select-word \; run-shell "sleep .3s" \; send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
## mouse copy line to clipboard on triple-click (if disabled, you can copy to system clipboard with shift)
bind-key -n TripleClick1Pane copy-mode -M \; send-keys -X select-line \; run-shell "sleep .3s" \; send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
# easy tmux config reload
bind-key R source-file ~/.tmux.conf \; display-message " Config reloaded"
# additionla split panes options to %,"
bind-key _ split-window -v -c "#{pane_current_path}"
bind-key | split-window -h -c "#{pane_current_path}"
# join windows
bind-key j command-prompt -p "move pane from session (<session>:<pane number>):" "join-pane -s '%%'"
bind-key s command-prompt -p "send pane to session (<session>:<pane number>):" "join-pane -t '%%'"
# Move around panes with ALT + arrow keys.
bind-key -n M-Up select-pane -U
bind-key -n M-Left select-pane -L
bind-key -n M-Down select-pane -D
bind-key -n M-Right select-pane -R
# Shift arrow to switch windows
bind-key -n S-Left previous-window
bind-key -n S-Right next-window
# set copy mode keybindings to VIM (emacs deafult)
setw -g mode-keys vi
# Copy mode key binding
## Improved copy mode bash style text moves
bind-key -T copy-mode-vi Home send-keys -X start-of-line
bind-key -T copy-mode-vi End send-keys -X end-of-line
bind-key -T copy-mode-vi PageUp send-keys -X page-up
bind-key -T copy-mode-vi PageDown send-keys -X page-down
bind-key -T copy-mode-vi C-Left send-keys -X previous-word
bind-key -T copy-mode-vi C-Right send-keys -X next-word
bind-key -T copy-mode-vi S-Up send-keys -X halfpage-up
bind-key -T copy-mode-vi S-Down send-keys -X halfpage-down
## Improved copy mode vim moves
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Start windows and panes at 1, not 0
set-option -g base-index 1
set-option -g pane-base-index 1
set-window-option -g pane-base-index 1
# Renumber windows when closed
set-option -g renumber-windows on
# Some extra key bindings to select window by F<x>
bind-key -n F1 selectw -t:1
bind-key -n F2 selectw -t:2
bind-key -n F3 selectw -t:3
bind-key -n F4 selectw -t:4
bind-key -n F5 selectw -t:5
bind-key -n F6 selectw -t:6
bind-key -n F7 selectw -t:7
bind-key -n F8 selectw -t:8
bind-key -n F9 selectw -t:9
bind-key -n F10 selectw -t:10
bind-key -n F11 selectw -t:11
bind-key -n F12 selectw -t:12
# TMUX Plugin Manager (TPM) Plugins list
## install plugin (to install, press "prefix + I" within session)
## Resurect plugin
set -g @plugin 'tmux-plugins/tmux-resurrect'
## Dracula template
set -g @plugin 'dracula/tmux'
# Plugin configs
## Resurrect config
set -g @resurrect-capture-pane-contents 'on'
## Dracula template config
### Enable plugins - available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, ssh-session, attached-clients, network-vpn, weather, time, mpc, spotify-tui, playerctl, kubernetes-context, synchronize-panes
set -g @dracula-plugins "git network-vpn cpu-usage ram-usage time"
### Configuration
set -g @dracula-show-powerline true
set -g @dracula-refresh-rate 3
set -g @dracula-show-left-icon session
### Plugin colour change - available colors: white, gray, dark_gray, light_purple, dark_purple, cyan, green, orange, red, pink, yellow
### set -g @dracula-[plugin-name]-colors "[background] [foreground]"
set -g @dracula-time-colors "dark_gray white"
# Install and initialize TPM (keep this line at the very bottom of tmux.conf)
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
# TPM run at startup (should be last command in conf file)
## if installed from package manager example: run '/usr/share/tmux-plugin-manager/tpm'
run '~/.tmux/plugins/tpm/tpm'