PrefixLayers - A Plugin for Screen/Tmux users

Plugin name: PrefixLayers
Source URL: https://github.com/jamesnvc/Kaleidoscope-PrefixLayer

Description:

Inspired by this neat idea and @algernon suggesting it be a plugin, I made a plugin that lets you set a prefix sequence of keys to be tapped before every key on a particular layer.

The initial purpose was to have a TMUX layer that is mostly transparent and has every key in that layer prefixed with a Ctrl-b. It’s been generalized to have a list of layers and a sequence of keys to be sent for each layer. Posting about it here in case anyone finds it useful!

6 Likes

Awesome! Will give this a shot soon.

This looks interesting and useful. Will I be able to put layers on top of the prefix layer or will this mostly be on my single layer? I wonder if how this will compare to a one shot tmux key.

The idea is that the prefix is separate from the layer: In the example, the tmux layer is almost entirely transparent (just puts arrow keys on the layer), so most of the keys are just normal. Then, with the prefix set to be C-b, any of those normal keys pressed come out as C-b <normal-key>.

Does that make sense? I fear I haven’t explained it very well…

The aforementioned example: https://github.com/jamesnvc/Kaleidoscope-PrefixLayer/blob/master/examples/PrefixLayer/PrefixLayer.ino#L22

In practice, I’d make the key to switch to the _TMUX layer a one-shot, so you’d get effectively a one-shot tmux key.

1 Like