neovim-flake/modules/plugins/utility/preview/glow/config.nix
diniamo a0197fe1bb treewide: migrate to pluginRC for correct DAG order
The "new" DAG order is as follows:
- (luaConfigPre)
- globalsScript
- basic
- theme
- pluginConfigs
- extraPluginConfigs
- mappings
- (luaConfigPost)
2024-07-18 10:25:58 +02:00

34 lines
780 B
Nix

{
pkgs,
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.binds) mkBinding pushDownDefault;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.preview.glow;
self = import ./glow.nix {
inherit lib config pkgs;
};
inherit (self.options.vim.utility.preview.glow) mappings;
in {
config = mkIf cfg.enable {
vim.startPlugins = ["glow-nvim"];
vim.maps.normal = mkMerge [
(mkBinding cfg.mappings.openPreview ":Glow<CR>" mappings.openPreview.description)
];
vim.binds.whichKey.register = pushDownDefault {
"<leader>pm" = "+Preview Markdown";
};
vim.pluginRC.glow = entryAnywhere ''
require('glow').setup({
glow_path = "${pkgs.glow}/bin/glow"
});
'';
};
}