# PrefixLayers - A Plugin for Screen/Tmux users

**URL:** <https://community.keyboard.io/t/prefixlayers-a-plugin-for-screen-tmux-users/667>\
**Category:** Plugins\
**Created:** [November 3, 2017, 1:09am UTC](https://community.keyboard.io/t/prefixlayers-a-plugin-for-screen-tmux-users/667 "2017-11-03T01:09:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [November 3, 2017, 1:09am UTC](https://community.keyboard.io/t/prefixlayers-a-plugin-for-screen-tmux-users/667/1 "2017-11-03T01:09:31Z")

</div>

Plugin name: PrefixLayers  
Source URL: [https://github.com/jamesnvc/Kaleidoscope-PrefixLayer](https://github.com/jamesnvc/Kaleidoscope-PrefixLayer)

Description:

Inspired by this [neat idea](https://github.com/ilianaw/Model01-Firmware/commit/7dad53bf1855e68a4c93a1686cad5e75b539cb0b) and [@algernon suggesting it be a plugin](https://trunk.mad-scientist.club/@algernon/98920372754259733), 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!

---

<div class="post-metadata">

**Author:** ![craigdissel](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@craigdissel](https://community.keyboard.io/u/craigdissel)\
**Post date:** [November 3, 2017, 3:36am UTC](https://community.keyboard.io/t/prefixlayers-a-plugin-for-screen-tmux-users/667/2 "2017-11-03T03:36:09Z")

</div>

Awesome! Will give this a shot soon.

---

<div class="post-metadata">

**Author:** ![amos](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/amos/32/639_2.png) [@amos](https://community.keyboard.io/u/amos)\
**Post date:** [November 3, 2017, 6:04pm UTC](https://community.keyboard.io/t/prefixlayers-a-plugin-for-screen-tmux-users/667/3 "2017-11-03T18:04:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [November 3, 2017, 7:04pm UTC](https://community.keyboard.io/t/prefixlayers-a-plugin-for-screen-tmux-users/667/4 "2017-11-03T19:04:20Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [November 3, 2017, 7:08pm UTC](https://community.keyboard.io/t/prefixlayers-a-plugin-for-screen-tmux-users/667/5 "2017-11-03T19:08:13Z")

</div>

The aforementioned example: [https://github.com/jamesnvc/Kaleidoscope-PrefixLayer/blob/master/examples/PrefixLayer/PrefixLayer.ino#L22](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.
