summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/tmux.conf16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/tmux.conf b/core/tmux.conf
index 2a0e161..d0d3ef8 100644
--- a/core/tmux.conf
+++ b/core/tmux.conf
@@ -14,7 +14,8 @@ set -g pane-border-status top
14set -g pane-border-format "#P" 14set -g pane-border-format "#P"
15 15
16# Explicitly swap current pane with a pane index you type in 16# Explicitly swap current pane with a pane index you type in
17bind-key P command-prompt -p "swap with pane #:" "swap-pane -d -t '%%'" 17bind-key S command-prompt -p "swap with pane #:" "swap-pane -d -t '%%'"
18bind-key P command-prompt -p "go to pane #:" "select-pane -t '%%'"
18# Manual: :swap-pane -s <src> -t <dst> 19# Manual: :swap-pane -s <src> -t <dst>
19 20
20# Vim-style pane resizing (prefix + H/J/K/L), magnitude 1 21# Vim-style pane resizing (prefix + H/J/K/L), magnitude 1
@@ -23,6 +24,14 @@ bind -r J resize-pane -D 1
23bind -r K resize-pane -U 1 24bind -r K resize-pane -U 1
24bind -r L resize-pane -R 1 25bind -r L resize-pane -R 1
25 26
27# Copy-mode cursor line (counted up from the bottom, matches the : goto-line prompt) in the status line;
28# the status bar redraws every second, the top-right copy-mode indicator does not follow the cursor
29# : goto-line only scrolls the view; also put the cursor on the bottom row so the status line shows the typed number
30bind-key -T copy-mode-vi : command-prompt -p "(goto line)" { send-keys -X goto-line "%%" ; send-keys -X bottom-line }
31set -g status-interval 1
32set -g status-right-length 70
33set -g status-right "#{?pane_in_mode,line #{e|+:#{scroll_position},#{e|-:#{e|-:#{pane_height},1},#{copy_cursor_y}}}/#{history_size} ,}\"#{=21:pane_title}\" %H:%M %d-%b-%y"
34
26# ===== Shared clipboard: RAM file /dev/shm/clip/buf on CLIP_HOST ===== 35# ===== Shared clipboard: RAM file /dev/shm/clip/buf on CLIP_HOST =====
27%hidden CLIP_HOST="root@p.noml.ch" 36%hidden CLIP_HOST="root@p.noml.ch"
28# One persistent ssh link (opens on first use, one key touch). 37# One persistent ssh link (opens on first use, one key touch).
@@ -31,13 +40,16 @@ bind -r L resize-pane -R 1
31# push (yank): copy mode v to select, then y / Enter / mouse drag 40# push (yank): copy mode v to select, then y / Enter / mouse drag
32%hidden YANK="$CLIP 'umask 077; mkdir -p /dev/shm/clip && cat >/dev/shm/clip/new && mv /dev/shm/clip/new /dev/shm/clip/buf'" 41%hidden YANK="$CLIP 'umask 077; mkdir -p /dev/shm/clip && cat >/dev/shm/clip/new && mv /dev/shm/clip/new /dev/shm/clip/buf'"
33bind-key -T copy-mode-vi v send-keys -X begin-selection 42bind-key -T copy-mode-vi v send-keys -X begin-selection
34bind-key -T copy-mode-vi y send-keys -X copy-pipe-no-clear "$YANK" 43# y = yank selection; with no selection, y y = yank the whole line
44bind-key -T copy-mode-vi y if-shell -F '#{selection_present}' { send-keys -X copy-pipe-no-clear "$YANK" } { switch-client -T copy-yy }
45bind-key -T copy-yy y send-keys -X select-line \; send-keys -X copy-pipe-no-clear "$YANK"
35bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "$YANK" 46bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "$YANK"
36bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "$YANK" 47bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "$YANK"
37# pull (paste): prefix + ] fetches the buffer into tmux, then pastes it; 48# pull (paste): prefix + ] fetches the buffer into tmux, then pastes it;
38# no buffer on CLIP_HOST yet (exit 3, e.g. after its reboot) = paste tmux's own buffer 49# no buffer on CLIP_HOST yet (exit 3, e.g. after its reboot) = paste tmux's own buffer
39bind-key ] run-shell "f=\$(mktemp); $CLIP '[ -f /dev/shm/clip/buf ] || exit 3; cat /dev/shm/clip/buf' >\$f; r=\$?; [ \$r -eq 0 ] && tmux load-buffer \$f; rm -f \$f; [ \$r -eq 0 ] || [ \$r -eq 3 ] && tmux paste-buffer" 50bind-key ] run-shell "f=\$(mktemp); $CLIP '[ -f /dev/shm/clip/buf ] || exit 3; cat /dev/shm/clip/buf' >\$f; r=\$?; [ \$r -eq 0 ] && tmux load-buffer \$f; rm -f \$f; [ \$r -eq 0 ] || [ \$r -eq 3 ] && tmux paste-buffer"
40# ===== end shared clipboard ===== 51# ===== end shared clipboard =====
52# TODO: try `set -g set-clipboard off` later (tmux default "external" sends copies to the local terminal clipboard via OSC 52); unrelated to the shared clipboard above
41 53
42# Linux only: true-color regardless of what TERM the outer terminal/distro sets 54# Linux only: true-color regardless of what TERM the outer terminal/distro sets
43if-shell 'uname | grep -q Darwin' {} { 55if-shell 'uname | grep -q Darwin' {} {