2023-04-17 21:38:57 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-08 02:16:46 +00:00
|
|
|
}: let
|
|
|
|
inherit (lib) nvim mkIf mkMerge;
|
|
|
|
|
2023-04-17 21:38:57 +00:00
|
|
|
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;
|
2023-04-17 22:36:14 +00:00
|
|
|
|
|
|
|
vim.treesitter.grammars = [cfg.treesitter.mdPackage cfg.treesitter.mdInlinePackage];
|
2023-04-17 21:55:27 +00:00
|
|
|
})
|
|
|
|
|
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>
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
]);
|
|
|
|
}
|