mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-11 04:33:29 +00:00
language/markdown: moved glow and markdown-preview to utlity/preview
This commit is contained in:
parent
7352558623
commit
319aaca06d
11 changed files with 145 additions and 104 deletions
28
modules/utility/preview/glow/config.nix
Normal file
28
modules/utility/preview/glow/config.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) nvim mkIf mkMerge mkBinding;
|
||||
|
||||
cfg = config.vim.utility.preview.glow;
|
||||
self = import ./glow.nix {
|
||||
inherit lib config pkgs;
|
||||
};
|
||||
mappings = self.options.vim.utility.preview.glow.mappings;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = ["glow-nvim"];
|
||||
|
||||
vim.maps.normal = mkMerge [
|
||||
(mkBinding cfg.glow.mappings.openPreview ":Glow<CR>" mappings.openPreview.description)
|
||||
];
|
||||
|
||||
vim.luaConfigRC.glow = nvim.dag.entryAnywhere ''
|
||||
require('glow').setup({
|
||||
glow_path = "${pkgs.glow}/bin/glow"
|
||||
});
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue