From db3a35a116d93162d9bc07264ede37404b243f0a Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sun, 13 Apr 2025 11:14:50 +0200 Subject: [PATCH 1/8] rc: do not set options via luaConfigPre --- modules/wrapper/rc/config.nix | 10 +++++++++- modules/wrapper/rc/options.nix | 26 ++------------------------ 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/modules/wrapper/rc/config.nix b/modules/wrapper/rc/config.nix index ff8a4585..77a62d58 100644 --- a/modules/wrapper/rc/config.nix +++ b/modules/wrapper/rc/config.nix @@ -5,7 +5,7 @@ }: let inherit (builtins) map mapAttrs filter; inherit (lib.attrsets) mapAttrsToList; - inherit (lib.strings) concatLines concatMapStringsSep; + inherit (lib.strings) concatLines concatMapStringsSep optionalString; inherit (lib.trivial) showWarnings; inherit (lib.generators) mkLuaInline; inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere; @@ -72,6 +72,14 @@ in { dag = cfg.luaConfigRC; mapResult = result: concatLines [ + (optionalString (cfg.additionalRuntimePaths != []) '' + vim.opt.runtimepath:append(${toLuaObject cfg.additionalRuntimePaths}) + '') + (optionalString cfg.enableLuaLoader '' + if vim.loader then + vim.loader.enable() + end + '') cfg.luaConfigPre (concatMapStringsSep "\n" mkLuarcSection result) cfg.luaConfigPost diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index 4cd3026f..10abd77d 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -1,15 +1,7 @@ -{ - config, - lib, - ... -}: let +{lib, ...}: let inherit (lib.options) mkOption literalMD literalExpression; - inherit (lib.strings) optionalString; inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything; inherit (lib.nvim.types) dagOf; - inherit (lib.nvim.lua) listToLuaTable; - - cfg = config.vim; in { options.vim = { enableLuaLoader = mkOption { @@ -286,21 +278,7 @@ in { luaConfigPre = mkOption { type = str; - default = '' - ${optionalString (cfg.additionalRuntimePaths != []) '' - -- The following list is generated from `vim.additionalRuntimePaths` - -- and is used to append additional runtime paths to the - -- `runtimepath` option. - vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths}) - ''} - - ${optionalString cfg.enableLuaLoader '' - if vim.loader then - vim.loader.enable() - end - ''} - ''; - + default = ""; defaultText = literalMD '' By default, this option will **append** paths in [](#opt-vim.additionalRuntimePaths) From 1f6e2f3ca461f6d5ffa3f9676362f396eae708ff Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Sun, 13 Apr 2025 11:32:11 +0200 Subject: [PATCH 2/8] docs: update release notes --- docs/release-notes/rl-0.8.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 642599ba..e866e969 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -107,6 +107,8 @@ - Add `LazyFile` user event. - Migrate language modules from none-ls to conform/nvim-lint - Add tsx support in conform and lint +- Moved code setting additionalRuntimePaths and enableLuaLoader out of + luaConfigPre's default to prevent being overridden [diniamo](https://github.com/diniamo): From 46979fd94fc544b64819b7aaa7cb73c2d3ea0292 Mon Sep 17 00:00:00 2001 From: raf Date: Mon, 21 Apr 2025 06:54:30 +0000 Subject: [PATCH 3/8] docs: format options as inline code --- docs/release-notes/rl-0.8.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index f993a9e5..5dc3ca94 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -107,8 +107,8 @@ - Add `LazyFile` user event. - Migrate language modules from none-ls to conform/nvim-lint - Add tsx support in conform and lint -- Moved code setting additionalRuntimePaths and enableLuaLoader out of - luaConfigPre's default to prevent being overridden +- Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of + `luaConfigPre`'s default to prevent being overridden [diniamo](https://github.com/diniamo): From 4045c458dc3e3eaabbb94518a857651cff341542 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 21 Apr 2025 10:11:30 +0300 Subject: [PATCH 4/8] assistant/chatgpt: add missing dependencies --- modules/plugins/assistant/chatgpt/config.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/plugins/assistant/chatgpt/config.nix b/modules/plugins/assistant/chatgpt/config.nix index 95a36acf..b1066e5a 100644 --- a/modules/plugins/assistant/chatgpt/config.nix +++ b/modules/plugins/assistant/chatgpt/config.nix @@ -30,7 +30,16 @@ in { config = mkIf cfg.enable { vim = { - startPlugins = ["chatgpt-nvim"]; + startPlugins = [ + "chatgpt-nvim" + + # Dependencies + "nui-nvim" + "plenary-nvim" + ]; + + # ChatGPT.nvim explicitly depends on Telescope. + telescope.enable = true; pluginRC.chagpt = entryAnywhere '' require("chatgpt").setup(${toLuaObject cfg.setupOpts}) From 9220c27e85d6d30166473999622aab5b387f3466 Mon Sep 17 00:00:00 2001 From: Farouk Brown Date: Tue, 22 Apr 2025 17:55:21 +0100 Subject: [PATCH 5/8] languages/render-markdown-nvim: add file_types as list set file_types as listOf (nullOr str) to allow merging --- docs/release-notes/rl-0.8.md | 4 ++++ modules/plugins/languages/markdown.nix | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 5dc3ca94..06a3267a 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -344,3 +344,7 @@ [howird](https://github.com/howird): - Change python dap adapter name from `python` to commonly expected `debugpy`. + +[aionoid](https://github.com/aionoid): + +- Fix [render-markdown.nvim] file_types option type to list, to accept merging. diff --git a/modules/plugins/languages/markdown.nix b/modules/plugins/languages/markdown.nix index 62081549..008192e3 100644 --- a/modules/plugins/languages/markdown.nix +++ b/modules/plugins/languages/markdown.nix @@ -9,7 +9,7 @@ inherit (lib.modules) mkIf mkMerge; inherit (lib.options) mkEnableOption mkOption; inherit (lib.lists) isList; - inherit (lib.types) bool enum either package listOf str; + inherit (lib.types) bool enum either package listOf str nullOr; inherit (lib.nvim.lua) expToLua toLuaObject; inherit (lib.nvim.types) diagnostics mkGrammarOption mkPluginSetupOption; inherit (lib.nvim.dag) entryAnywhere; @@ -117,7 +117,13 @@ in { ''; }; - setupOpts = mkPluginSetupOption "render-markdown" {}; + setupOpts = mkPluginSetupOption "render-markdown" { + file_types = lib.mkOption { + type = listOf (nullOr str); + default = []; + description = "List of buffer filetypes to enable this plugin in. This will cause the plugin to attach to new buffers who have any of these filetypes."; + }; + }; }; }; From 95e2eec30b8d20c096c327ef5dd3887d7f859ae9 Mon Sep 17 00:00:00 2001 From: Farouk Brown Date: Tue, 22 Apr 2025 21:32:53 +0100 Subject: [PATCH 6/8] doc: format description to a multi-line string --- modules/plugins/languages/markdown.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/plugins/languages/markdown.nix b/modules/plugins/languages/markdown.nix index 008192e3..21b4f4af 100644 --- a/modules/plugins/languages/markdown.nix +++ b/modules/plugins/languages/markdown.nix @@ -121,7 +121,12 @@ in { file_types = lib.mkOption { type = listOf (nullOr str); default = []; - description = "List of buffer filetypes to enable this plugin in. This will cause the plugin to attach to new buffers who have any of these filetypes."; + description = '' + List of buffer filetypes to enable this plugin in. + + This will cause the plugin to attach to new buffers who + have any of these filetypes. + ''; }; }; }; From 3e3d7171c1b8354065adf9890c2e2a469441f300 Mon Sep 17 00:00:00 2001 From: Farouk Brown Date: Tue, 22 Apr 2025 22:36:11 +0100 Subject: [PATCH 7/8] ref: change file_types type to nullOr(listOf str) --- modules/plugins/languages/markdown.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/plugins/languages/markdown.nix b/modules/plugins/languages/markdown.nix index 21b4f4af..4563bc44 100644 --- a/modules/plugins/languages/markdown.nix +++ b/modules/plugins/languages/markdown.nix @@ -119,8 +119,8 @@ in { setupOpts = mkPluginSetupOption "render-markdown" { file_types = lib.mkOption { - type = listOf (nullOr str); - default = []; + type = nullOr (listOf str); + default = null; description = '' List of buffer filetypes to enable this plugin in. From 8ab559ccfe1e834b1a043896db21bafd26902e2e Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 23 Apr 2025 16:02:39 +0300 Subject: [PATCH 8/8] mini/cursorword: init --- modules/plugins/mini/cursorword/config.nix | 19 +++++++++++++++++++ .../plugins/mini/cursorword/cursorword.nix | 9 +++++++++ modules/plugins/mini/cursorword/default.nix | 6 ++++++ modules/plugins/mini/default.nix | 1 + npins/sources.json | 16 ++++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 modules/plugins/mini/cursorword/config.nix create mode 100644 modules/plugins/mini/cursorword/cursorword.nix create mode 100644 modules/plugins/mini/cursorword/default.nix diff --git a/modules/plugins/mini/cursorword/config.nix b/modules/plugins/mini/cursorword/config.nix new file mode 100644 index 00000000..bc5ab2cb --- /dev/null +++ b/modules/plugins/mini/cursorword/config.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.mini.cursorword; +in { + vim = mkIf cfg.enable { + startPlugins = ["mini-cursorword"]; + + pluginRC.mini-ai = entryAnywhere '' + require("mini.cursorword").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/mini/cursorword/cursorword.nix b/modules/plugins/mini/cursorword/cursorword.nix new file mode 100644 index 00000000..f2b8903a --- /dev/null +++ b/modules/plugins/mini/cursorword/cursorword.nix @@ -0,0 +1,9 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.mini.cursorword = { + enable = mkEnableOption "mini.cursorword"; + setupOpts = mkPluginSetupOption "mini.cursorword" {}; + }; +} diff --git a/modules/plugins/mini/cursorword/default.nix b/modules/plugins/mini/cursorword/default.nix new file mode 100644 index 00000000..f0aae6c8 --- /dev/null +++ b/modules/plugins/mini/cursorword/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./cursorword.nix + ./config.nix + ]; +} diff --git a/modules/plugins/mini/default.nix b/modules/plugins/mini/default.nix index 8f035285..f066b172 100644 --- a/modules/plugins/mini/default.nix +++ b/modules/plugins/mini/default.nix @@ -11,6 +11,7 @@ ./colors ./comment ./completion + ./cursorword ./diff ./doc ./extra diff --git a/npins/sources.json b/npins/sources.json index 05a8c173..7339ce8a 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -1020,6 +1020,22 @@ "url": "https://github.com/echasnovski/mini.completion/archive/35130cebc63ace7d6e4583f349af8cd3f3141af7.tar.gz", "hash": "0h5z5i62cc780bzw60rbizngvpyl4vk7j858pndyi2g572plz929" }, + "mini-cursorword": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "echasnovski", + "repo": "mini.cursorword" + }, + "pre_releases": false, + "version_upper_bound": null, + "release_prefix": null, + "submodules": false, + "version": "v0.15.0", + "revision": "6683f04509c380e3147cca368f90bbdb99641775", + "url": "https://api.github.com/repos/echasnovski/mini.cursorword/tarball/v0.15.0", + "hash": "0vqr4hkzq13ap6giyyp8asn5g6nnm406piq1a07a5nmkfxiskp9v" + }, "mini-diff": { "type": "Git", "repository": {