mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-24 02:59:49 +01:00
33 lines
671 B
Nix
33 lines
671 B
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.vim.markdown.glow;
|
|
in {
|
|
config = (mkIf cfg.enable) {
|
|
vim.startPlugins = [
|
|
"glow-nvim"
|
|
];
|
|
|
|
vim.globals = {
|
|
"glow_binary_path" = "${pkgs.glow}/bin";
|
|
};
|
|
|
|
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,
|
|
})
|
|
'';
|
|
};
|
|
}
|