9

I've setup the alt + arrow keys bindings for changing tab in vim (in .vimrc):

map <silent><A-Right> :tabnext<CR> 
map <silent><A-Left> :tabprevious<CR> 

this however does not work under byobu with tmux backend, I guess because it is remapped by byobu.

I tried setting:

unbind -n M-right
unbind -n M-left

in .tmux.conf or .byobu/keybindings.tmux without success.

Anyone has a suggestion on how to fix it?

Andrea Zonca
  • 735
  • 1
  • 8
  • 13

2 Answers2

13

You're so close! You're just missing the capitalization of "R" in M-Right and "L" in M-Left.

Just add the following to ~/.byobu/keybindings.tmux:

unbind -n M-Right
unbind -n M-Left

And then press F5 to reload your profile.

Full Disclosure: I am the author and maintainer of Byobu.

Dustin Kirkland
  • 14,458
  • 3
  • 69
  • 93
  • thanks! but still it doesn't work, Alt-left and Alt-right still move word by word. And my vim keybindings do not work. I tried both uppercase and lowercase. – Andrea Zonca Aug 09 '13 at 18:49
  • Hmm, I made the same mistake in my instructions. Try what's above. That's working perfectly for me... – Dustin Kirkland Aug 12 '13 at 14:41
  • tried again with this configuration, also created a new user just to test this, still it does not work. I have byobu version 5.17 tmux 1.6 on 12.04.2 LTS. – Andrea Zonca Aug 12 '13 at 18:21
  • Hmm, can you try updating to the latest Byobu release from the ppa? `sudo apt-add-repository ppa:byobu/ppa && sudo apt-get update && sudo apt-get install -y byobu` – Dustin Kirkland Aug 13 '13 at 02:20
  • thanks, updated to: `byobu version 5.55 tmux 1.6`, but still does not work. tested with no success also on another Ubuntu 12.04.2 LTS. I had to create `keybindings.tmux` myself, is it possible that it is not actually read? – Andrea Zonca Aug 13 '13 at 06:20
  • Hmm, you have something else going on here, I'm afraid. I've tested this on 3 different system, and it's working as described across the board... Perhaps try moving your ~/.byobu out of the way, and letting Byobu create a new one for you. – Dustin Kirkland Aug 13 '13 at 13:08
  • no way, now it correctly created `keybindings.tmux` for me, I added the `unbind` commands, run `byobu-tmux`, press F5, but still it moves word by word. – Andrea Zonca Aug 13 '13 at 18:34
  • I'll mark the answer as accepted, there must be something wrong in my systems. – Andrea Zonca Aug 13 '13 at 18:34
  • I also needed the settings in `.tmux.conf` from here: http://askubuntu.com/a/145227/198237 – Ciprian Tomoiagă Dec 18 '16 at 03:15
  • I initially did similar unbinds in ~/.byobu/.tmux.conf, and it worked, but toggling Byobu F-keys off and back on (with Shift-F12) lost the unbinds. So, you indeed need to do this in ~/.byobu/keybindings.tmux, or Byobu won't pick it up correctly. – Kankaristo Nov 27 '20 at 09:38
5

If you cannot manage to disable specific keybindings, you can toggle Byobu's keybindings off/on using Shift+F12 – which is what I use a lot (e.g. to interact with Midnight Commander). I just miss a possibility to have the current status of that displayed in the status bar (are keybindings currently active – or have I turned them off?) – but that's a different issue ;)

Izzy
  • 3,540
  • 4
  • 30
  • 58
  • thank you for the shortcut, and I totally agree with you regarding the latter case –  Feb 18 '17 at 10:46
  • Thank you for this! I've accidentally disabled those and this is what re-enabled them. – meridius Oct 01 '19 at 14:52