mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-22 12:33:29 +00:00
utility/glow: migrate to setupOpts API
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7d50f183037f3b983a7c79aee1113d516a6a6964
This commit is contained in:
parent
eda9bf28f3
commit
f3c3353ced
2 changed files with 14 additions and 5 deletions
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
options,
|
||||
|
|
@ -8,6 +7,7 @@
|
|||
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;
|
||||
|
|
@ -24,9 +24,7 @@ in {
|
|||
};
|
||||
|
||||
pluginRC.glow = entryAnywhere ''
|
||||
require('glow').setup({
|
||||
glow_path = "${pkgs.glow}/bin/glow"
|
||||
});
|
||||
require('glow').setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) str;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
inherit (config.vim.lib) mkMappingOption;
|
||||
in {
|
||||
imports = [
|
||||
|
|
@ -15,6 +18,14 @@ in {
|
|||
glow = {
|
||||
enable = mkEnableOption "markdown preview in neovim with glow";
|
||||
mappings.openPreview = mkMappingOption "Open preview" "<leader>p";
|
||||
setupOpts = mkPluginSetupOption "glow.nvim" {
|
||||
glow_path = mkOption {
|
||||
type = str;
|
||||
default = "${pkgs.glow}/bin/glow";
|
||||
example = "glow";
|
||||
description = "Path to the glow binary.";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue