2023-04-17 23:38:57 +02:00
|
|
|
{
|
|
|
|
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;
|
2023-04-18 00:36:14 +02:00
|
|
|
|
|
|
|
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
|
2023-04-17 23:55:27 +02:00
|
|
|
})
|
|
|
|
|
2023-04-17 23:38:57 +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>
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
]);
|
|
|
|
}
|