mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-10 17:24:32 +02:00
plugins/qmk: init
This commit is contained in:
parent
99068dab4b
commit
6440f4af87
3 changed files with 170 additions and 0 deletions
|
@ -63,6 +63,7 @@
|
||||||
./languages/parinfer-rust.nix
|
./languages/parinfer-rust.nix
|
||||||
./languages/plantuml-syntax.nix
|
./languages/plantuml-syntax.nix
|
||||||
./languages/python/jupytext.nix
|
./languages/python/jupytext.nix
|
||||||
|
./languages/qmk.nix
|
||||||
./languages/rust-tools.nix
|
./languages/rust-tools.nix
|
||||||
./languages/rustaceanvim.nix
|
./languages/rustaceanvim.nix
|
||||||
./languages/sniprun.nix
|
./languages/sniprun.nix
|
||||||
|
|
120
plugins/languages/qmk.nix
Normal file
120
plugins/languages/qmk.nix
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
helpers,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||||
|
name = "qmk";
|
||||||
|
originalName = "qmk.nvim";
|
||||||
|
defaultPackage = pkgs.vimPlugins.qmk-nvim;
|
||||||
|
|
||||||
|
maintainers = [maintainers.GaetanLepage];
|
||||||
|
|
||||||
|
settingsOptions = {
|
||||||
|
name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
example = "LAYOUT_preonic_grid";
|
||||||
|
description = ''
|
||||||
|
The name of your layout, for example `LAYOUT_preonic_grid` for the preonic keyboard, for
|
||||||
|
zmk this can just be anything, it won't be used.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
layout = mkOption {
|
||||||
|
type = with types; listOf str;
|
||||||
|
example = [
|
||||||
|
"x x"
|
||||||
|
"x^x"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
The keyboard key layout.
|
||||||
|
|
||||||
|
The layout config describes your layout as expected by qmk_firmware.
|
||||||
|
As qmk_firmware is simply expecting an array of key codes, the layout is pretty much up to
|
||||||
|
you.
|
||||||
|
|
||||||
|
A layout is a list of strings, where each string in the list represents a single row.
|
||||||
|
Rows must all be the same width, and you'll see they visually align to what your keymap
|
||||||
|
looks like.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
variant = helpers.defaultNullOpts.mkEnumFirstDefault ["qmk" "zmk"] ''
|
||||||
|
Chooses the expected hardware target.
|
||||||
|
'';
|
||||||
|
|
||||||
|
timeout = helpers.defaultNullOpts.mkUnsignedInt 5000 ''
|
||||||
|
Duration of `vim.notify` timeout if using `nvim-notify`.
|
||||||
|
'';
|
||||||
|
|
||||||
|
auto_format_pattern = helpers.defaultNullOpts.mkStr "*keymap.c" ''
|
||||||
|
The autocommand file pattern to use when applying `QMKFormat` on save.
|
||||||
|
'';
|
||||||
|
|
||||||
|
comment_preview = {
|
||||||
|
position = helpers.defaultNullOpts.mkEnumFirstDefault ["top" "bottom" "inside" "none"] ''
|
||||||
|
Control the position of the preview, set to `none` to disable (`inside` is only valid for
|
||||||
|
`variant=qmk`).
|
||||||
|
'';
|
||||||
|
|
||||||
|
keymap_overrides = helpers.defaultNullOpts.mkAttrsOf types.str "{}" ''
|
||||||
|
A dictionary of key codes to text replacements, any provided value will be merged with the
|
||||||
|
existing dictionary, see [key_map.lua](https://github.com/codethread/qmk.nvim/blob/main/lua/qmk/config/key_map.lua) for details.
|
||||||
|
'';
|
||||||
|
|
||||||
|
symbols =
|
||||||
|
helpers.defaultNullOpts.mkAttrsOf types.str
|
||||||
|
''
|
||||||
|
{
|
||||||
|
space = " ";
|
||||||
|
horz = "─";
|
||||||
|
vert = "│";
|
||||||
|
tl = "┌";
|
||||||
|
tm = "┬";
|
||||||
|
tr = "┐";
|
||||||
|
ml = "├";
|
||||||
|
mm = "┼";
|
||||||
|
mr = "┤";
|
||||||
|
bl = "└";
|
||||||
|
bm = "┴";
|
||||||
|
br = "┘";
|
||||||
|
}
|
||||||
|
''
|
||||||
|
''
|
||||||
|
A dictionary of symbols used for the preview comment border chars see [default.lua](https://github.com/codethread/qmk.nvim/blob/main/lua/qmk/config/default.lua) for details.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
name = "LAYOUT_preonic_grid";
|
||||||
|
layout = [
|
||||||
|
"x x"
|
||||||
|
"x^x"
|
||||||
|
];
|
||||||
|
variant = "qmk";
|
||||||
|
timeout = 5000;
|
||||||
|
auto_format_pattern = "*keymap.c";
|
||||||
|
comment_preview = {
|
||||||
|
position = "top";
|
||||||
|
keymap_overrides = {};
|
||||||
|
symbols = {
|
||||||
|
space = " ";
|
||||||
|
horz = "─";
|
||||||
|
vert = "│";
|
||||||
|
tl = "┌";
|
||||||
|
tm = "┬";
|
||||||
|
tr = "┐";
|
||||||
|
ml = "├";
|
||||||
|
mm = "┼";
|
||||||
|
mr = "┤";
|
||||||
|
bl = "└";
|
||||||
|
bm = "┴";
|
||||||
|
br = "┘";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
49
tests/test-sources/plugins/languages/qmk.nix
Normal file
49
tests/test-sources/plugins/languages/qmk.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
minimal = {
|
||||||
|
plugins.qmk = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
name = "LAYOUT_preonic_grid";
|
||||||
|
layout = [
|
||||||
|
"x x"
|
||||||
|
"x^x"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
plugins.qmk = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
name = "LAYOUT_preonic_grid";
|
||||||
|
layout = [
|
||||||
|
"x x"
|
||||||
|
"x^x"
|
||||||
|
];
|
||||||
|
variant = "qmk";
|
||||||
|
timeout = 5000;
|
||||||
|
auto_format_pattern = "*keymap.c";
|
||||||
|
comment_preview = {
|
||||||
|
position = "top";
|
||||||
|
keymap_overrides = {};
|
||||||
|
symbols = {
|
||||||
|
space = " ";
|
||||||
|
horz = "─";
|
||||||
|
vert = "│";
|
||||||
|
tl = "┌";
|
||||||
|
tm = "┬";
|
||||||
|
tr = "┐";
|
||||||
|
ml = "├";
|
||||||
|
mm = "┼";
|
||||||
|
mr = "┤";
|
||||||
|
bl = "└";
|
||||||
|
bm = "┴";
|
||||||
|
br = "┘";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue