1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-28 16:19:49 +01:00
neovim-flake/modules/plugins/utility/preview/glow/config.nix

35 lines
783 B
Nix
Raw Normal View History

{
pkgs,
config,
lib,
...
}: let
2024-03-24 01:14:39 +01:00
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.binds) mkBinding pushDownDefault;
2024-03-24 01:14:39 +01:00
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 {
2024-02-25 17:39:05 +01:00
"<leader>pm" = "+Preview Markdown";
};
2024-03-24 01:14:39 +01:00
vim.luaConfigRC.glow = entryAnywhere ''
require('glow').setup({
glow_path = "${pkgs.glow}/bin/glow"
});
'';
};
}