Comments (2)
Thanks. I didn't know yaml had an alias system, that'll come in handy.
That does exactly what I was asking for, probably better than any of my proposals.
from keymap-drawer.
Hey, thanks for the nice thought out post. For this I prefer to use YAML anchors and aliases. Even though I am not a fan of most of YAML's features, this is one that came in handy frequently. Basically, you can assign an anchor to a node with &ref
syntax and refer to it later via *ref
, a contrived example:
LGUI: &lgui
tap: $$mdi:monitor-dashboard$$
held: Left
LEFT_GUI: *lgui
# above keys have identical values
RGUI:
<<: *lgui
held: Right
# overrides `held` field from above two
(As an aside, I find oq
helpful to work with yamls, e.g. oq -i yaml -o simpleyaml
can expand aliases like above and print the final result.)
You can see I (ab)use this in the keyboard layouts YAML to reduce repetition: https://github.com/caksoylar/keymap-drawer/blob/main/resources/zmk_keyboard_layouts.yaml
This is similar to your approach 1 in principle, except it is using the configuration syntax features rather than a feature from the keymap-drawer side. Let me know what you think, i.e. if that is good enough. I'd prefer to not add complexity if not needed.
from keymap-drawer.
Related Issues (20)
- Separate Combos on ZMK HOT 4
- Get help action to add to ZMK archive. HOT 6
- Upgrading to `v0.13.0` lose `trans_legend` config HOT 4
- MoErgo's Glove80's triggering the assert "Number of keys on layer {} does not match physical layout specification" HOT 2
- feature request: add support for overlaid devicetree node property values HOT 5
- TRANS keys some times not picked up correctly HOT 2
- View is cut off when combo description is offset HOT 4
- bug: `draw_separate` does not work anymore HOT 3
- Tabler icons are not loaded anymore HOT 8
- tabler `viewbox` regex issue HOT 2
- parse: keyboard name detection fails for files in nix store HOT 4
- Allow loading SVG icons from the filesystem HOT 3
- Fix stdout redirect issues on Windows related to encodings
- Feature request: use browser local storage to remember the yaml HOT 4
- Pull in symbols for numbers automatically from zmk config HOT 4
- Feature Request: List with checkbox to only export some layers HOT 5
- Please add Kanata as input source HOT 6
- Feature Request: Using local layout file HOT 3
- Feature request: Display multiple keys that could activate a layer HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keymap-drawer.