mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-22 20:43:27 +00:00
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7d50f183037f3b983a7c79aee1113d516a6a6964
30 lines
707 B
Nix
30 lines
707 B
Nix
{
|
|
config,
|
|
lib,
|
|
options,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.nvim.binds) mkKeymap pushDownDefault;
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
inherit (lib.nvim.lua) toLuaObject;
|
|
|
|
cfg = config.vim.utility.preview.glow;
|
|
inherit (options.vim.utility.preview.glow) mappings;
|
|
in {
|
|
config.vim = mkIf cfg.enable {
|
|
startPlugins = ["glow-nvim"];
|
|
|
|
keymaps = [
|
|
(mkKeymap "n" cfg.mappings.openPreview ":Glow<CR>" {desc = mappings.openPreview.description;})
|
|
];
|
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
"<leader>pm" = "+Preview Markdown";
|
|
};
|
|
|
|
pluginRC.glow = entryAnywhere ''
|
|
require('glow').setup(${toLuaObject cfg.setupOpts})
|
|
'';
|
|
};
|
|
}
|