nvf/modules/languages/markdown/config.nix

31 lines
606 B
Nix
Raw Normal View History

{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.languages.markdown;
in {
config = mkIf cfg.enable (mkMerge [
2023-04-17 21:55:27 +00:00
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
2023-04-17 21:55:27 +00:00
})
(mkIf cfg.glow.enable {
vim.startPlugins = ["glow-nvim"];
vim.globals = {
"glow_binary_path" = "${pkgs.glow}/bin";
};
vim.configRC.glow = nvim.dag.entryAnywhere ''
autocmd FileType markdown noremap <leader>p :Glow<CR>
'';
})
]);
}