commit 880a48cb593f4ca10b6b6d1cd8000e80f2731e90
parent 507fb75bb792d15d188bc02b2a66f7c6e8065c9d
Author: Alex Balgavy <alex@balgavy.eu>
Date: Sun, 28 Mar 2021 12:52:06 +0200
tmux: more key bindings (translate, mouse, etc.)
Diffstat:
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/tmux/tmux-dark.conf b/tmux/tmux-dark.conf
@@ -3,11 +3,11 @@
# "set" == "set-option"
set -g history-limit 30000
set -g mouse on
+set -g terminal-overrides 'xterm*:smcup@:rmcup@'
+set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-command $SHELL
set -g default-shell $SHELL
set -g default-terminal "xterm-256color"
-set -g terminal-overrides 'xterm*:smcup@:rmcup@'
-set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g pane-active-border-style fg='#f59970'
set -g set-titles on
set -g set-titles-string '#H:#S.#I.#P #W #T'
@@ -24,6 +24,7 @@ set -g visual-activity on
set -g base-index 1 # start numbering windows at 1, easier to reach
set -g renumber-windows on
set -s escape-time 0
+set -g set-clipboard off
# }}}
# Window options {{{
setw -g mode-keys vi
@@ -65,11 +66,14 @@ bind C new-session
# Tmux clipboard to system clipboard
bind Y run-shell "tmux show-buffer | clc" \; display-message "Tmux clipboard -> System clipboard"
-bind -T copy-mode-vi 'Y' send-keys -X copy-selection \; run-shell "tmux show-buffer | clc"
+bind -T copy-mode-vi 'Y' send -X copy-pipe-and-cancel "clc"
# Search youtube
bind-key -T copy-mode-vi 'u' send-keys -X copy-selection \; new-window -n youtube \; send-keys -t youtube 'pipe-viewer "$(tmux show-buffer)" && tmux kill-window' 'Enter'
+# Translate to english
+bind-key -T copy-mode-vi 'T' send -X copy-selection-and-cancel \; display-popup -E 'trans "$(tmux show-buffer)" | less -RiX'
+
# Cancel
bind-key -T copy-mode-vi 'i' send-keys -X cancel
@@ -95,8 +99,6 @@ bind C-k next-window
# Moving windows
unbind H
unbind L
-bind -r L swap-window -t +1
-bind -r H swap-window -t -1
bind -r L swap-window -t +1 \; next-window
bind -r H swap-window -t -1 \; previous-window
diff --git a/tmux/tmux-light.conf b/tmux/tmux-light.conf
@@ -4,11 +4,12 @@
set -g history-limit 30000
set -g mouse on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
+set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-command $SHELL
set -g default-shell $SHELL
set -g default-terminal "xterm-256color"
-set -g pane-border-style fg=#a4a4a4
set -g pane-active-border-style fg=#ff5500
+set -g pane-border-style fg=#a4a4a4
set -g set-titles on
set -g set-titles-string '#H:#S.#I.#P #W #T'
set -g status-bg '#e4e4e4'
@@ -23,6 +24,7 @@ set -g visual-activity on
set -g base-index 1 # start numbering windows at 1, easier to reach
set -g renumber-windows on
set -s escape-time 0
+set -g set-clipboard off
# }}}
# Window options {{{
setw -g mode-keys vi
@@ -63,11 +65,14 @@ bind C new-session
# Tmux clipboard to system clipboard
bind Y run-shell "tmux show-buffer | clc" \; display-message "Tmux clipboard -> System clipboard"
-bind -T copy-mode-vi 'Y' send-keys -X copy-selection \; run-shell "tmux show-buffer | clc"
+bind -T copy-mode-vi 'Y' send -X copy-pipe-and-cancel "clc"
# Search youtube
bind-key -T copy-mode-vi 'u' send-keys -X copy-selection \; new-window -n youtube \; send-keys -t youtube 'pipe-viewer "$(tmux show-buffer)" && tmux kill-window' 'Enter'
+# Translate to english
+bind-key -T copy-mode-vi 'T' send -X copy-selection-and-cancel \; display-popup -E 'trans "$(tmux show-buffer)" | less -RiX'
+
# Cancel
bind-key -T copy-mode-vi 'i' send-keys -X cancel