1

I want to change the key binding in tmux copy mode. This is my tmux config:

set-window-option -g mode-keys vi

So I use the vi keybindings for copy mode. But since I use the colemak keyboard layout which has the keys n,e,i,o instead of j,k,l,o I want to bind the following:

bind n down
bind e up
bind h left
bind i right

I know how binding keys works but I don't know how the key command for down, up, left, right.

1 Answer 1

2

See tmux list-keys:

bind-key  -T copy-mode  Up     send-keys  -X  cursor-up
bind-key  -T copy-mode  Down   send-keys  -X  cursor-down
bind-key  -T copy-mode  Left   send-keys  -X  cursor-left
bind-key  -T copy-mode  Right  send-keys  -X  cursor-right

So in your case you can do:

bind-key  -T copy-mode-vi  n  send-keys Down
bind-key  -T copy-mode-vi  e  send-keys Up
bind-key  -T copy-mode-vi  h  send-keys Left
bind-key  -T copy-mode-vi  i  send-keys Right
4
  • thanks it worked! although I don't understand how you got the solution from tmux list-keys since there it is called cursor-up and so on. Jun 6, 2021 at 15:37
  • I did. I still don't get it. Sorry. Jun 6, 2021 at 16:20
  • @lukaskitsche To be honest, I had to try it a couple of ways until I hit on the correct form. But the point of giving you the tmux list-keys method was so you know where to look for other mappings you may want to do, now that you have the form.
    – mattb
    Jun 6, 2021 at 16:33
  • Ok, thanks! I will look at it more deeply when I need it next time. Jun 6, 2021 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .