mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
binds/qmk: init
Create the `vim.binds.qmk` module with `enable` and `setupOpts`.
This commit is contained in:
parent
f578f82b4d
commit
ef9609c207
7 changed files with 101 additions and 0 deletions
26
modules/plugins/utility/binds/qmk/config.nix
Normal file
26
modules/plugins/utility/binds/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.binds.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";
|
||||
}];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue