2023-02-01 19:11:37 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2023-02-27 19:26:00 +00:00
|
|
|
with lib; let
|
|
|
|
cfg = config.vim.markdown.glow;
|
|
|
|
in {
|
|
|
|
config = (mkIf cfg.enable) {
|
2023-03-01 11:00:26 +00:00
|
|
|
vim.startPlugins = [
|
|
|
|
"glow-nvim"
|
|
|
|
];
|
|
|
|
|
2023-02-27 19:26:00 +00:00
|
|
|
vim.globals = {
|
|
|
|
"glow_binary_path" = "${pkgs.glow}/bin";
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
2023-02-27 19:26:00 +00:00
|
|
|
|
2023-03-01 11:00:26 +00:00
|
|
|
vim.configRC.glow-nvim = nvim.dag.entryAnywhere ''
|
|
|
|
autocmd FileType markdown noremap <leader>pm :Glow<CR>
|
|
|
|
'';
|
|
|
|
|
|
|
|
vim.luaConfigRC.glow-nvim = nvim.dag.entryAnywhere ''
|
|
|
|
require('glow').setup({
|
|
|
|
-- use glow path from vim.globals
|
|
|
|
path = vim.g.glow_binary_path,
|
|
|
|
border = "${toString cfg.border}",
|
|
|
|
pager = ${boolToString cfg.pager},
|
|
|
|
width = 120,
|
|
|
|
})
|
2023-02-27 19:26:00 +00:00
|
|
|
'';
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
|
|
|
}
|