5 ms·
For what it's worth, you can just do this using Alt (i.e. 'meta'). No special terminal required. Just use `bind -n M-<X>` to say 'no prefix' and use meta-<X>.
by AlexSW 4y ago
For what it's worth, you can just do this using Alt (i.e. 'meta'). No special terminal required. Just use `bind -n M-<X>` to say 'no prefix' and use meta-<X>.
For example, `bind -n M-1 select-window -t 1` means Alt-1 goes to Window 1 for me.
I use Alt-h, Alt-j, Alt-k, Alt-l for vim-aware pane switching (with some vim config too), e.g. via `bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'`. I have a load of Alt-<X> mappings.
I use iTerm and Windows Terminal primarily, but it works on everything, really. Though sometimes you need to adjust what 'alt' means; in iTerm, you need to make Alt be Esc+ (I think).
- sodapopcan 4y agoMeta interferes with some of my vim bindings, though, as well as some readline bindings (`alt-f`, `alt-b`). I like using the system key because it's essentially unused in Alacritty and it provides a clean separation between tools. And actually, I didn't mention that my VinTmuxNav commands are bound to `alt-j` and the like so that I can still use `ctrl-h` and `ctrl-l` on the command line. [EDIT: ...and then alacritty binds `cmd-j` and friends to the meta version when inside vim] And yes, can confirm you do need to make Alt be Esc+ in iTerm!