2024-02-13 13:33:10 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2024-07-13 17:02:45 +02:00
|
|
|
inherit (lib.strings) stringLength concatMapStringsSep;
|
2024-03-24 01:14:39 +01:00
|
|
|
inherit (lib.modules) mkIf;
|
2024-02-13 13:33:10 +01:00
|
|
|
|
|
|
|
cfg = config.vim.utility.preview.markdownPreview;
|
|
|
|
in {
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
vim.startPlugins = [pkgs.vimPlugins.markdown-preview-nvim];
|
|
|
|
|
2024-07-13 17:02:45 +02:00
|
|
|
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;
|
|
|
|
mkdp_open_ip = mkIf (stringLength cfg.customIP > 0) cfg.customIP;
|
|
|
|
mkdp_port = mkIf (stringLength cfg.customPort > 0) cfg.customPort;
|
|
|
|
};
|
2024-02-13 13:33:10 +01:00
|
|
|
};
|
|
|
|
}
|