1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00
nixvim/plugins/by-name/typst-vim/default.nix
saygo-png 29ec33e1a8 plugins: remove deprecations "after 24.11" or less
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-10-18 18:31:00 +00:00

78 lines
1.8 KiB
Nix

{
lib,
helpers,
...
}:
with lib;
lib.nixvim.plugins.mkVimPlugin {
name = "typst-vim";
globalPrefix = "typst_";
description = "A Neovim plugin for Typst, a modern typesetting system.";
maintainers = [ maintainers.GaetanLepage ];
imports = [
# TODO: added 2025-04-07, remove after 25.05
(lib.nixvim.mkRemovedPackageOptionModule {
plugin = "typst-vim";
packageName = "typst";
})
];
dependencies = [ "typst" ];
extraOptions = {
keymaps = {
silent = mkOption {
type = types.bool;
description = "Whether typst-vim keymaps should be silent.";
default = false;
};
watch = helpers.mkNullOrOption types.str "Keymap to preview the document and recompile on change.";
};
};
extraConfig = cfg: {
keymaps =
with cfg.keymaps;
helpers.keymaps.mkKeymaps
{
mode = "n";
options.silent = silent;
}
(
optional (watch != null) {
# mode = "n";
key = watch;
action = ":TypstWatch<CR>";
}
);
};
settingsOptions = {
cmd = helpers.defaultNullOpts.mkStr "typst" ''
Specifies the location of the Typst executable.
'';
pdf_viewer = helpers.mkNullOrOption types.str ''
Specifies pdf viewer that `typst watch --open` will use.
'';
conceal_math = helpers.defaultNullOpts.mkFlagInt 0 ''
Enable concealment for math symbols in math mode (i.e. replaces symbols with their actual
unicode character).
Warning: this can affect performance
'';
auto_close_toc = helpers.defaultNullOpts.mkFlagInt 0 ''
Specifies whether TOC will be automatically closed after using it.
'';
};
settingsExample = {
cmd = "typst";
conceal_math = 1;
auto_close_toc = 1;
};
}