diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index b7396cbe..f5e9d0a0 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -135,9 +135,3 @@ - Add `vim.languages.zig.dap` support through pkgs.lldb dap adapter. Code Inspiration from `vim.languages.clang.dap` implementation. - -PartyWumpus: - -[typst-concealer]: https://github.com/PartyWumpus/typst-concealer - -- Add inline typst concealing support under `vim.languages.typst` using [typst-concealer]. diff --git a/flake.lock b/flake.lock index 62efe9ed..e1417c86 100644 --- a/flake.lock +++ b/flake.lock @@ -2636,11 +2636,11 @@ "plugin-typst-concealer": { "flake": false, "locked": { - "lastModified": 1737954973, - "narHash": "sha256-DV5RNMAdSePc5T3XAAGAbY5LB1G5tapQxtJEhT8DtDY=", + "lastModified": 1737944956, + "narHash": "sha256-YCkxM1xqY3gTrKVzRFI4fedOzhEeIq/dnYya/MST6Qo=", "owner": "PartyWumpus", "repo": "typst-concealer", - "rev": "e7ff35c359a7c8cf375cb02a97b23e76bd9bbe57", + "rev": "e3d5bc44dc4ea9d68f3cee271eee1a75ff7d59e9", "type": "github" }, "original": { diff --git a/modules/plugins/languages/typst.nix b/modules/plugins/languages/typst.nix index 33ea9588..1c090267 100644 --- a/modules/plugins/languages/typst.nix +++ b/modules/plugins/languages/typst.nix @@ -11,7 +11,6 @@ inherit (lib.attrsets) attrNames; inherit (lib.generators) mkLuaInline; inherit (lib.meta) getExe; - inherit (lib.nvim.binds) mkMappingOption mkKeymap; inherit (lib.nvim.lua) expToLua toLuaObject; inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption; inherit (lib.nvim.dag) entryAnywhere; @@ -169,47 +168,44 @@ in { }; }; typst-concealer = { - enable = mkEnableOption '' - [typst-concealer]: https://github.com/PartyWumpus/typst-concealer + enable = + mkEnableOption '' + [typst-concealer]: https://github.com/PartyWumpus/typst-concealer - Inline typst preview for Neovim via [typst-concealer] - ''; - - mappings = { - toggleConcealing = mkMappingOption "Enable typst-concealer in buffer" "TT"; - }; + Inline typst preview for Neovim via [typst-concealer] + '' + // {default = false;}; setupOpts = mkPluginSetupOption "typst-concealer" { do_diagnostics = mkOption { type = nullOr bool; + description = ''Should typst-concealer provide diagnostics on error?''; default = !cfg.lsp.enable; - description = "Should typst-concealer provide diagnostics on error?"; }; color = mkOption { type = nullOr str; + description = ''What color should typst-concealer render text/stroke with? (only applies when styling_type is "colorscheme")''; default = null; - example = "rgb(\"#f012be\")"; - description = "What color should typst-concealer render text/stroke with? (only applies when styling_type is 'colorscheme')"; }; enabled_by_default = mkOption { type = nullOr bool; + description = ''Should typst-concealer conceal newly opened buffers by default?''; default = null; - description = "Should typst-concealer conceal newly opened buffers by default?"; }; styling_type = mkOption { type = nullOr (enum ["simple" "none" "colorscheme"]); + description = ''What kind of styling should typst-concealer apply to your typst?''; default = null; - description = "What kind of styling should typst-concealer apply to your typst?"; }; ppi = mkOption { type = nullOr int; + description = ''What PPI should typst render at. Plugin default is 300, typst's normal default is 144.''; default = null; - description = "What PPI should typst render at. Plugin default is 300, typst's normal default is 144."; }; typst_location = mkOption { type = str; default = getExe pkgs.typst; - description = "Where should typst-concealer look for your typst binary?"; + description = ''Where should typst-concealer look for your typst binary?''; }; }; }; @@ -240,16 +236,10 @@ in { }) (mkIf cfg.extensions.typst-concealer.enable { - vim.lazy.plugins.typst-concealer = { - event = "BufRead *.typ"; - package = "typst-concealer"; - setupModule = "typst-concealer"; - setupOpts = cfg.extensions.typst-concealer.setupOpts; - - keys = [ - (mkKeymap "n" cfg.extensions.typst-concealer.mappings.toggleConcealing "lua require('typst-concealer').toggle_buf()" {desc = "Toggle typst-concealer in buffer";}) - ]; - }; + vim.startPlugins = ["typst-concealer"]; + vim.pluginRC.typst-concealer = entryAnywhere '' + require("typst-concealer").setup(${toLuaObject cfg.extensions.typst-concealer.setupOpts}) + ''; }) ]); }