mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-23 22:00:42 +00:00
8d5f23035d
* statix, deadnix, alejandra * _file * _module.args * concatStringsSep "\n" -> concatLines concatStringsSep "\n" map -> concatMapStringsSep "\n" * mkShell nativeBuildInputs -> packages
35 lines
783 B
Nix
35 lines
783 B
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
inherit (lib.nvim.binds) mkBinding pushDownDefault;
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
|
|
cfg = config.vim.utility.preview.glow;
|
|
self = import ./glow.nix {
|
|
inherit lib config pkgs;
|
|
};
|
|
inherit (self.options.vim.utility.preview.glow) mappings;
|
|
in {
|
|
config = mkIf cfg.enable {
|
|
vim.startPlugins = ["glow-nvim"];
|
|
|
|
vim.maps.normal = mkMerge [
|
|
(mkBinding cfg.mappings.openPreview ":Glow<CR>" mappings.openPreview.description)
|
|
];
|
|
|
|
vim.binds.whichKey.register = pushDownDefault {
|
|
"<leader>pm" = "+Preview Markdown";
|
|
};
|
|
|
|
vim.luaConfigRC.glow = entryAnywhere ''
|
|
require('glow').setup({
|
|
glow_path = "${pkgs.glow}/bin/glow"
|
|
});
|
|
'';
|
|
};
|
|
}
|