neovim-flake/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 23:55:27 +02:00
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
2023-04-17 23:55:27 +02: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>
'';
})
]);
}