nvf/modules/plugins/utility/preview/markdown-preview/config.nix

26 lines
684 B
Nix
Raw Normal View History

{
pkgs,
config,
lib,
...
}: let
2024-10-30 11:01:16 +00:00
inherit (lib.strings) concatMapStringsSep;
2024-03-24 00:14:39 +00:00
inherit (lib.modules) mkIf;
cfg = config.vim.utility.preview.markdownPreview;
in {
config = mkIf cfg.enable {
vim.startPlugins = [pkgs.vimPlugins.markdown-preview-nvim];
vim.globals = {
mkdp_auto_start = cfg.autoStart;
mkdp_auto_close = cfg.autoClose;
mkdp_refresh_slow = cfg.lazyRefresh;
mkdp_filetypes = [(concatMapStringsSep ", " (x: "'" + x + "'") cfg.filetypes)];
mkdp_command_for_global = cfg.alwaysAllowPreview;
mkdp_open_to_the_world = cfg.broadcastServer;
2024-10-30 11:01:16 +00:00
mkdp_open_ip = cfg.customIP;
mkdp_port = cfg.customPort;
};
};
}