mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
binds/qmk: Rename to vim.utility.qmk
Move the `vim.binds.qmk` module to `vim.utility.qmk`.
This commit is contained in:
parent
ff81c41d61
commit
ea55488f04
7 changed files with 5 additions and 6 deletions
26
modules/plugins/utility/qmk/config.nix
Normal file
26
modules/plugins/utility/qmk/config.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.utility.qmk;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["qmk-nvim"];
|
||||
|
||||
pluginRC.qmk-nvim = entryAfter ["nvim-notify"] ''
|
||||
require('qmk').setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
|
||||
assertions = [{
|
||||
assertion = !(cfg.setupOpts.variant == "zmk") && !(cfg.setupOpts.comment_preview.position == "inside");
|
||||
message = "comment_preview.position can only be set to inside when using the qmk layoyt";
|
||||
}];
|
||||
};
|
||||
}
|
6
modules/plugins/utility/qmk/default.nix
Normal file
6
modules/plugins/utility/qmk/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./config.nix
|
||||
./qmk.nix
|
||||
];
|
||||
}
|
50
modules/plugins/utility/qmk/qmk.nix
Normal file
50
modules/plugins/utility/qmk/qmk.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) attrsOf enum lines str;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.utility.qmk = {
|
||||
enable = mkEnableOption "QMK and ZMK keymaps in nvim";
|
||||
|
||||
setupOpts = mkPluginSetupOption "qmk.nvim" {
|
||||
name = mkOption {
|
||||
type = str;
|
||||
description = "The name of the layout";
|
||||
};
|
||||
|
||||
layout = mkOption {
|
||||
type = lines;
|
||||
description = ''
|
||||
The keyboard key layout
|
||||
see <https://github.com/codethread/qmk.nvim?tab=readme-ov-file#Layout> for more details
|
||||
'';
|
||||
};
|
||||
|
||||
variant = mkOption {
|
||||
type = enum ["qmk" "zmk"];
|
||||
default = "qmk";
|
||||
description = "Chooses the expected hardware target";
|
||||
};
|
||||
|
||||
comment_preview = {
|
||||
position = mkOption {
|
||||
type = enum ["top" "bottom" "inside" "none"];
|
||||
default = "top";
|
||||
description = "Controls the position of the preview";
|
||||
};
|
||||
|
||||
keymap_overrides = mkOption {
|
||||
type = attrsOf str;
|
||||
default = {};
|
||||
description = ''
|
||||
Key codes to text replacements
|
||||
see <https://github.com/codethread/qmk.nvim/blob/main/lua/qmk/config/key_map.lua> for more details
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue