2023-04-17 21:38:57 +00:00
|
|
|
{
|
|
|
|
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.package];
|
|
|
|
})
|
|
|
|
|
2023-04-17 21:38:57 +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>
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
]);
|
|
|
|
}
|