From 6bdc52cd772e8708db8e32d3533ce4674943ccef Mon Sep 17 00:00:00 2001 From: Nikita <68944906+BANanaD3V@users.noreply.github.com> Date: Mon, 10 Mar 2025 12:51:19 +0300 Subject: [PATCH 1/3] languages/markdown: Add markview renderer --- docs/release-notes/rl-0.8.md | 1 + modules/plugins/languages/markdown.nix | 19 +++++++++++++++++++ npins/sources.json | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 1a5b7e4c..78d9fc36 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -241,3 +241,4 @@ [BANanaD3V](https://github.com/BANanaD3V): - `alpha` is now configured with nix. +- Add `markview-nvim` markdown renderer. diff --git a/modules/plugins/languages/markdown.nix b/modules/plugins/languages/markdown.nix index ac098a1c..648513e7 100644 --- a/modules/plugins/languages/markdown.nix +++ b/modules/plugins/languages/markdown.nix @@ -133,6 +133,18 @@ in { }; }; }; + markview-nvim = { + enable = + mkEnableOption "" + // { + description = '' + [markview.nvim]: https://github.com/OXY2DEV/markview.nvim + + [markview.nvim] - a hackable markdown, Typst, latex, html(inline) & YAML previewer + ''; + }; + setupOpts = mkPluginSetupOption "markview-nvim" {}; + }; }; }; @@ -159,5 +171,12 @@ in { require("render-markdown").setup(${toLuaObject cfg.extensions.render-markdown-nvim.setupOpts}) ''; }) + + (mkIf cfg.extensions.markview-nvim.enable { + vim.startPlugins = ["markview-nvim"]; + vim.pluginRC.markview-nvim = entryAnywhere '' + require("markview").setup(${toLuaObject cfg.extensions.markview-nvim.setupOpts}) + ''; + }) ]); } diff --git a/npins/sources.json b/npins/sources.json index daad4177..093fa820 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -773,6 +773,18 @@ "url": "https://github.com/horriblename/lzn-auto-require/archive/ef746afb55467984ef3200d9709c8059ee0257d0.tar.gz", "hash": "1mgka1mmvpd2gfya898qdbbwrp5rpqds8manjs1s7g5x63xp6b98" }, + "markview-nvim": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "OXY2DEV", + "repo": "markview.nvim" + }, + "branch": "main", + "revision": "6c92a6455e97c954a4a419265a032fedd69846f6", + "url": "https://github.com/OXY2DEV/markview.nvim/archive/6c92a6455e97c954a4a419265a032fedd69846f6.tar.gz", + "hash": "01sw4iscnciyifpba4cwjb6fs95wrkk60xvqq67b8d5j8yb5449a" + }, "mind-nvim": { "type": "Git", "repository": { From fee3bbe536b5bf484aedebafa5130b485068b64f Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 10 May 2025 07:54:24 +0300 Subject: [PATCH 2/3] languages/markdown: fix formatting --- modules/plugins/languages/markdown.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/languages/markdown.nix b/modules/plugins/languages/markdown.nix index aadb0c40..23848835 100644 --- a/modules/plugins/languages/markdown.nix +++ b/modules/plugins/languages/markdown.nix @@ -193,7 +193,7 @@ in { require("markview").setup(${toLuaObject cfg.extensions.markview-nvim.setupOpts}) ''; }) - + (mkIf cfg.extraDiagnostics.enable { vim.diagnostics.nvim-lint = { enable = true; From 054e4a3b9c8be8609b5134e058becd15b96eb4c2 Mon Sep 17 00:00:00 2001 From: Christoph Koehler Date: Thu, 8 May 2025 18:52:16 -0600 Subject: [PATCH 3/3] feat: add treesitter textobjects --- docs/release-notes/rl-0.8.md | 2 ++ modules/plugins/treesitter/default.nix | 1 + .../treesitter/ts-textobjects/config.nix | 23 +++++++++++++++++++ .../treesitter/ts-textobjects/default.nix | 6 +++++ .../treesitter/ts-textobjects/textobjects.nix | 21 +++++++++++++++++ npins/sources.json | 13 +++++++++++ 6 files changed, 66 insertions(+) create mode 100644 modules/plugins/treesitter/ts-textobjects/config.nix create mode 100644 modules/plugins/treesitter/ts-textobjects/default.nix create mode 100644 modules/plugins/treesitter/ts-textobjects/textobjects.nix diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 0155c759..45e4eb9b 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -329,11 +329,13 @@ [flash.nvim]: https://github.com/folke/flash.nvim [gitlinker.nvim]: https://github.com/linrongbin16/gitlinker.nvim +[nvim-treesitter-textobjects]: https://github.com/nvim-treesitter/nvim-treesitter-textobjects - Fix oil config referencing snacks - Add [flash.nvim] plugin to `vim.utility.motion.flash-nvim` - Fix default telescope ignore list entry for '.git/' to properly match - Add [gitlinker.nvim] plugin to `vim.git.gitlinker-nvim` +- Add [nvim-treesitter-textobjects] plugin to `vim.treesitter.textobjects` [rrvsh](https://github.com/rrvsh): diff --git a/modules/plugins/treesitter/default.nix b/modules/plugins/treesitter/default.nix index a859f3af..ea8ac9cd 100644 --- a/modules/plugins/treesitter/default.nix +++ b/modules/plugins/treesitter/default.nix @@ -2,6 +2,7 @@ imports = [ # treesitter extras ./ts-context + ./ts-textobjects ./treesitter.nix ./config.nix diff --git a/modules/plugins/treesitter/ts-textobjects/config.nix b/modules/plugins/treesitter/ts-textobjects/config.nix new file mode 100644 index 00000000..7a9239d1 --- /dev/null +++ b/modules/plugins/treesitter/ts-textobjects/config.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + inherit (lib.nvim.lua) toLuaObject; + inherit (lib.nvim.dag) entryAfter; + + inherit (config.vim) treesitter; + cfg = treesitter.textobjects; +in { + config = mkIf (treesitter.enable && cfg.enable) { + vim = { + startPlugins = ["nvim-treesitter-textobjects"]; + + # set up treesitter-textobjects after Treesitter, whose config we're adding to. + pluginRC.treesitter-textobjects = entryAfter ["treesitter"] '' + require("nvim-treesitter.configs").setup({textobjects = ${toLuaObject cfg.setupOpts}}) + ''; + }; + }; +} diff --git a/modules/plugins/treesitter/ts-textobjects/default.nix b/modules/plugins/treesitter/ts-textobjects/default.nix new file mode 100644 index 00000000..d0ae48a3 --- /dev/null +++ b/modules/plugins/treesitter/ts-textobjects/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./textobjects.nix + ./config.nix + ]; +} diff --git a/modules/plugins/treesitter/ts-textobjects/textobjects.nix b/modules/plugins/treesitter/ts-textobjects/textobjects.nix new file mode 100644 index 00000000..07e72135 --- /dev/null +++ b/modules/plugins/treesitter/ts-textobjects/textobjects.nix @@ -0,0 +1,21 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + options.vim.treesitter.textobjects = { + enable = mkEnableOption "Treesitter textobjects"; + setupOpts = + mkPluginSetupOption "treesitter-textobjects" {} + // { + example = { + select = { + enable = true; + lookahead = true; + keymaps = { + af = "@function.outer"; + }; + }; + }; + }; + }; +} diff --git a/npins/sources.json b/npins/sources.json index e74da05b..d4c0aa14 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -1906,6 +1906,19 @@ "url": "https://github.com/nvim-treesitter/nvim-treesitter-context/archive/6daca3ad780f045550b820f262002f35175a6c04.tar.gz", "hash": "0qprwd44hw9sz0vh14p6lpvs9vxrick462pfkradmal6ak1kfwn3" }, + "nvim-treesitter-textobjects": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "nvim-treesitter", + "repo": "nvim-treesitter-textobjects" + }, + "branch": "master", + "submodules": false, + "revision": "0e3be38005e9673d044e994b1e4b123adb040179", + "url": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects/archive/0e3be38005e9673d044e994b1e4b123adb040179.tar.gz", + "hash": "0y93pj3asarw7jhk4cdphhx6awxdyiwajc0n9nr4836gn48qcs85" + }, "nvim-ts-autotag": { "type": "Git", "repository": {