mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
binds/qmk: init (#1083)
* binds/qmk: init Create the `vim.binds.qmk` module with `enable` and `setupOpts`. * Clean up release notes Add consistent style and formatting to release notes Co-authored-by: raf <raf@notashelf.dev> * Clean up release notes (again) * binks/qmk: remove unneeded function * binds/qmk: Rename to `vim.utility.qmk` Move the `vim.binds.qmk` module to `vim.utility.qmk`. * utility/qmk: add defaults and asserts Add default values and assertions for required options. * utility/qmk: rename to utility/qmk-nvim * utility/qmk-nvim: improve assertion readability * utility/qmk-nvim: Fix links broken in module rename * Fix release notes * Add final newline to release notes --------- Co-authored-by: raf <raf@notashelf.dev>
This commit is contained in:
parent
80a2944418
commit
b7d321fd88
7 changed files with 111 additions and 6 deletions
36
modules/plugins/utility/qmk-nvim/config.nix
Normal file
36
modules/plugins/utility/qmk-nvim/config.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
|
||||
cfg = config.vim.utility.qmk-nvim;
|
||||
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 == "qmk" && cfg.setupOpts.comment_preview.position != "inside";
|
||||
message = "comment_preview.position can only be set to inside when using the qmk layoyt";
|
||||
}
|
||||
{
|
||||
assertion = cfg.setupOpts.name != null;
|
||||
message = "qmk-nvim requires 'vim.utility.qmk.setupOpts.name' to be set.";
|
||||
}
|
||||
{
|
||||
assertion = cfg.setupOpts.layout != null;
|
||||
message = "qmk-nvim requires 'vim.utility.qmk.setupOpts.layout' to be set.";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue