Modifier: Comme l'a souligné @Sebastian Graf, tmux
a maintenant une commande native: send-keys -X select-word
pour sélectionner un mot. Ce qui suit, je pars pour la postérité ...
bind -n -T copy-mode-vi C-d send-keys b \; send -X begin-selection \; send-keys E
J'utilise ci-dessus au moins sélectionner le mot sous le curseur. Le raccourci est C-d
en s'inspirant de Sublime Text. Vous devrez également définir set-window-option -g mode-keys vi
, mais je crois que c'est par défaut. En mode vi, le b
déplace le curseur au début du mot actuel, puis commence la sélection avec begin-selection
, puis déplace le curseur jusqu'à la fin du mot courant avec E
.
Ainsi, vous pouvez également copier le mot:
bind -n -T copy-mode-vi C-d send-keys b \; send -X begin-selection \; send-keys E \; send -x copy-selection.
J'ai inclus toutes les commandes ici, parce que je ne pouvais pas trouver nulle part sur l'Internet qui fait formaté bien.
Function Vi Emacs
-------------------------------------------
Back to indentation ^ M-m
Bottom of history G M-<
Clear selection Esc C-g
Copy selection Enter M-w
Cursor down j Down
Cursor left h Left
Cursor right l Right
Cursor to bottom line L
Cursor to middle line M M-r
Cursor to top line H M-R
Cursor up k Up
Delete entire line d C-u
Delete/Copy to end of line D C-k
End of line $ C-e
Go to line : g
Half page down C-d M-Down
Half page up C-u M-Up
Jump forward f f
Jump backward F F
Jump again ; ;
Jump again in reverse , ,
Next page C-f PgDown
Next space W
Next space, end of word E
Next word w
Next word end e M-f
Paste buffer p C-y
Previous page C-b PgUp
Previous word b M-b
Previous space B
Quit mode q Esc
Rectangle toggle v R
Scroll down C-Down/C-e C-Down
Scroll up C-Up/C-y C-Up
Search again n n
Search again in reverse N N
Search backward ? C-r
Search forward / C-s
Start of line 0 C-a
Start selection Space C-Space
Top of history g M->
Transpose chars C-t
Veuillez vous montrant 'envoyer touches -X select-word', comme ici https://stackoverflow.com/a/46638561/388010 –
Merci, mis à jour ma réponse – tombh