Tmux : Use p to paste and JK to scroll.

This commit is contained in:
Dmitry Voronin 2024-09-01 04:19:19 +03:00
parent 8daa18b4f9
commit 99812fd1c1
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
7 changed files with 40 additions and 54 deletions

View file

@ -1,8 +1,6 @@
{ ... }: let { ... }: {
mod = "M";
in {
text = '' text = ''
unbind-key C-b unbind-key C-b
bind -n ${mod}-r source-file ~/.config/tmux/tmux.conf bind -n M-r source-file ~/.config/tmux/tmux.conf
''; '';
} }

View file

@ -1,13 +1,11 @@
{ config, ... }: let { config, ... }: let
mod = "M";
fg = config.style.color.bg.dark; fg = config.style.color.bg.dark;
selection = config.style.color.selection; selection = config.style.color.selection;
in { in {
text = '' text = ''
setw -g mode-keys vi setw -g mode-keys vi
bind -n ${mod}-v copy-mode bind -n M-v copy-mode
bind -n ${mod}-V choose-buffer; bind -n M-p choose-buffer;
bind -T copy-mode-vi v send -X begin-selection bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy" bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"

View file

@ -1,8 +1,6 @@
{ ... }: let { ... }: {
mod = "M";
in {
text = '' text = ''
bind -n ${mod}-p copy-mode -u bind -n M-K copy-mode -u
bind -n ${mod}-n send-keys Pagedown bind -n M-J send-keys Pagedown
''; '';
} }

View file

@ -1,13 +1,11 @@
{ ... }: let { ... }: {
mod = "M";
in {
text = '' text = ''
bind -n ${mod}-z detach-client bind -n M-z detach-client
bind -n ${mod}-Z detach-client -a bind -n M-Z detach-client -a
bind -n ${mod}-( switch-client -p bind -n M-( switch-client -p
bind -n ${mod}-) switch-client -n bind -n M-) switch-client -n
bind -n ${mod}-g choose-session -Z bind -n M-g choose-session -Z
set -g window-size smallest set -g window-size smallest
''; '';

View file

@ -1,6 +1,4 @@
{ config, ... }: let { config, ... }: let
mod = "M";
accent = config.style.color.accent; accent = config.style.color.accent;
bg = config.style.color.bg.regular; bg = config.style.color.bg.regular;
# fg = style.color.fg.light; # fg = style.color.fg.light;
@ -9,27 +7,27 @@
stepHorizontal = 1; stepHorizontal = 1;
in { in {
text = '' text = ''
bind -n ${mod}-\\ split-window -h -c "#{pane_current_path}" bind -n M-\\ split-window -h -c "#{pane_current_path}"
bind -n ${mod}-- split-window -v -c "#{pane_current_path}" bind -n M-- split-window -v -c "#{pane_current_path}"
bind -n ${mod}-= select-layout tiled bind -n M-= select-layout tiled
bind -n ${mod}-_ select-layout even-vertical bind -n M-_ select-layout even-vertical
bind -n ${mod}-| select-layout even-horizontal bind -n M-| select-layout even-horizontal
bind -n ${mod}-k resize-pane -U ${toString stepVertical} bind -n M-k resize-pane -U ${toString stepVertical}
bind -n ${mod}-j resize-pane -D ${toString stepVertical} bind -n M-j resize-pane -D ${toString stepVertical}
bind -n ${mod}-h resize-pane -L ${toString stepHorizontal} bind -n M-h resize-pane -L ${toString stepHorizontal}
bind -n ${mod}-l resize-pane -R ${toString stepHorizontal} bind -n M-l resize-pane -R ${toString stepHorizontal}
bind -n ${mod}-A swap-pane -U bind -n M-A swap-pane -U
bind -n ${mod}-D swap-pane -D bind -n M-D swap-pane -D
unbind '"' unbind '"'
unbind % unbind %
bind -n ${mod}-a select-pane -L bind -n M-a select-pane -L
bind -n ${mod}-d select-pane -R bind -n M-d select-pane -R
bind -n ${mod}-w select-pane -U bind -n M-w select-pane -U
bind -n ${mod}-s select-pane -D bind -n M-s select-pane -D
bind -n ${mod}-c kill-pane bind -n M-c kill-pane
bind -n ${mod}-C kill-pane -a bind -n M-C kill-pane -a
set -g pane-border-style "fg=#${bg}" set -g pane-border-style "fg=#${bg}"
set -g pane-active-border-style "fg=#${accent}" set -g pane-active-border-style "fg=#${accent}"

View file

@ -1,12 +1,10 @@
{ config, ... }: let { config, ... }: let
mod = "M";
accent = config.style.color.accent; accent = config.style.color.accent;
# bg = style.color.bg.dark; # bg = style.color.bg.dark;
fg = config.style.color.fg.light; fg = config.style.color.fg.light;
in { in {
text = '' text = ''
bind-key -n ${mod}-f set-option -g status; bind-key -n M-f set-option -g status;
set -g status-left-length 50 set -g status-left-length 50
set -g status-position bottom set -g status-position bottom
set -g status-justify left set -g status-justify left

View file

@ -1,17 +1,15 @@
{ ... }: let { ... }: {
mod = "M";
in {
text = '' text = ''
bind -n ${mod}-Escape new-window -c "#{pane_current_path}" bind -n M-Escape new-window -c "#{pane_current_path}"
bind -n ${mod}-t new-window -c "#{pane_current_path}" bind -n M-t new-window -c "#{pane_current_path}"
bind -n ${mod}-x kill-window bind -n M-x kill-window
bind -n ${mod}-X kill-window -a bind -n M-X kill-window -a
bind -n ${mod}-e next-window bind -n M-e next-window
bind -n ${mod}-q previous-window bind -n M-q previous-window
bind -n ${mod}-E swap-window -t +1\; select-window -t +1 bind -n M-E swap-window -t +1\; select-window -t +1
bind -n ${mod}-Q swap-window -t -1\; select-window -t -1 bind -n M-Q swap-window -t -1\; select-window -t -1
''; '';
} }