neovim-flake/modules/plugins/utility/preview/glow/config.nix
Gerg-L 8d5f23035d
treewide: cleanup (#324)
* statix, deadnix, alejandra

* _file

* _module.args

* concatStringsSep "\n" -> concatLines
concatStringsSep "\n" map -> concatMapStringsSep "\n"

* mkShell nativeBuildInputs -> packages
2024-07-08 21:57:58 +00:00

34 lines
783 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.luaConfigRC.glow = entryAnywhere ''
require('glow').setup({
glow_path = "${pkgs.glow}/bin/glow"
});
'';
};
}