Skip to main content
added 10 characters in body
Source Link
Chris Johnsen
  • 20.7k
  • 8
  • 67
  • 55

The -temacs-copy is not a typo. The leading dash means that this is an option to the bind-keys command (along with an argument for the option). It is equivalent to -t emacs-copy, if you like that better.

Copy mode uses a different set of bindings than the normal modeand commands1 than the “normal mode”. The copy-pipe command is only available in the alternate “mode” bindings tables. When mode-keys is emacs, copy mode will use the emacs-copy table, so you need to bind M-w to copy-pipe in the that table.

bind-key -temacs-copy M-w copy-pipe "xclip -i -selection clipboard" 

Be careful making too many “no prefix” bindings. They will make it difficult to type those bound keys to a program running inside tmux (e.g. when you want to type C-y to a tty-mode instance of Emacs running inside tmux). You can always (prefix) bind some key that does send-keys C-y, but that might make it more cumbersome to type if you need it often enough.


1 The alternate table bindings also use a different command set from the normal bindings. Only movement and editing commands are available. With the exception of copy-pipe, these commands do not take any arguments (this is what the man page means with it says “One command in accepts an argument”; the “in” is probably a typo or an editing mistake).

The -temacs-copy is not a typo. The leading dash means that this is an option to the bind-keys command (along with an argument for the option). It is equivalent to -t emacs-copy, if you like that better.

Copy mode uses a different set of bindings than the normal mode1. When mode-keys is emacs, copy mode will use the emacs-copy table, so you need to bind M-w to copy-pipe in the that table.

bind-key -temacs-copy M-w copy-pipe "xclip -i -selection clipboard" 

Be careful making too many “no prefix” bindings. They will make it difficult to type those bound keys to a program running inside tmux (e.g. when you want to type C-y to a tty-mode instance of Emacs running inside tmux). You can always (prefix) bind some key that does send-keys C-y, but that might make it more cumbersome to type if you need it often enough.


1 The alternate table bindings also use a different command set from the normal bindings. Only movement and editing commands are available. With the exception of copy-pipe, these commands do not take any arguments (this is what the man page means with it says “One command in accepts an argument”; the “in” is probably a typo or an editing mistake).

The -temacs-copy is not a typo. The leading dash means that this is an option to the bind-keys command (along with an argument for the option). It is equivalent to -t emacs-copy, if you like that better.

Copy mode uses a different set of bindings and commands1 than the “normal mode”. The copy-pipe command is only available in the alternate “mode” bindings tables. When mode-keys is emacs, copy mode will use the emacs-copy table, so you need to bind M-w to copy-pipe in the that table.

bind-key -temacs-copy M-w copy-pipe "xclip -i -selection clipboard" 

Be careful making too many “no prefix” bindings. They will make it difficult to type those bound keys to a program running inside tmux (e.g. when you want to type C-y to a tty-mode instance of Emacs running inside tmux). You can always (prefix) bind some key that does send-keys C-y, but that might make it more cumbersome to type if you need it often enough.


1 Only movement and editing commands are available. With the exception of copy-pipe, these commands do not take any arguments (this is what the man page means with it says “One command in accepts an argument”; the “in” is probably a typo or an editing mistake).

Source Link
Chris Johnsen
  • 20.7k
  • 8
  • 67
  • 55

The -temacs-copy is not a typo. The leading dash means that this is an option to the bind-keys command (along with an argument for the option). It is equivalent to -t emacs-copy, if you like that better.

Copy mode uses a different set of bindings than the normal mode1. When mode-keys is emacs, copy mode will use the emacs-copy table, so you need to bind M-w to copy-pipe in the that table.

bind-key -temacs-copy M-w copy-pipe "xclip -i -selection clipboard" 

Be careful making too many “no prefix” bindings. They will make it difficult to type those bound keys to a program running inside tmux (e.g. when you want to type C-y to a tty-mode instance of Emacs running inside tmux). You can always (prefix) bind some key that does send-keys C-y, but that might make it more cumbersome to type if you need it often enough.


1 The alternate table bindings also use a different command set from the normal bindings. Only movement and editing commands are available. With the exception of copy-pipe, these commands do not take any arguments (this is what the man page means with it says “One command in accepts an argument”; the “in” is probably a typo or an editing mistake).