2024-02-13 13:33:10 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2024-03-24 01:14:39 +01:00
|
|
|
inherit (lib.modules) mkIf mkMerge;
|
2024-04-14 16:20:30 +02:00
|
|
|
inherit (lib.nvim.binds) mkBinding pushDownDefault;
|
2024-03-24 01:14:39 +01:00
|
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
2024-02-13 13:33:10 +01:00
|
|
|
|
|
|
|
cfg = config.vim.utility.preview.glow;
|
|
|
|
self = import ./glow.nix {
|
|
|
|
inherit lib config pkgs;
|
|
|
|
};
|
2024-07-08 23:57:58 +02:00
|
|
|
inherit (self.options.vim.utility.preview.glow) mappings;
|
2024-02-13 13:33:10 +01:00
|
|
|
in {
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
vim.startPlugins = ["glow-nvim"];
|
|
|
|
|
|
|
|
vim.maps.normal = mkMerge [
|
2024-02-13 15:45:47 +01:00
|
|
|
(mkBinding cfg.mappings.openPreview ":Glow<CR>" mappings.openPreview.description)
|
2024-02-13 13:33:10 +01:00
|
|
|
];
|
|
|
|
|
2024-02-26 04:52:21 +01:00
|
|
|
vim.binds.whichKey.register = pushDownDefault {
|
2024-02-25 17:39:05 +01:00
|
|
|
"<leader>pm" = "+Preview Markdown";
|
|
|
|
};
|
|
|
|
|
2024-07-15 12:40:05 +02:00
|
|
|
vim.pluginRC.glow = entryAnywhere ''
|
2024-02-13 13:33:10 +01:00
|
|
|
require('glow').setup({
|
2024-02-13 15:45:47 +01:00
|
|
|
glow_path = "${pkgs.glow}/bin/glow"
|
|
|
|
});
|
2024-02-13 13:33:10 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|