From 9f5ce6b55cdce4ad473430429aed3abd3f32344e Mon Sep 17 00:00:00 2001 From: mugaizzo Date: Thu, 13 Nov 2025 23:47:12 -0700 Subject: [PATCH 1/7] plugin/vimtex with options --- modules/plugins/latex/default.nix | 5 +++ modules/plugins/latex/vimtex/config.nix | 21 +++++++++++++ modules/plugins/latex/vimtex/default.nix | 6 ++++ modules/plugins/latex/vimtex/vimtex.nix | 40 ++++++++++++++++++++++++ npins/sources.json | 13 ++++++++ 5 files changed, 85 insertions(+) create mode 100644 modules/plugins/latex/default.nix create mode 100644 modules/plugins/latex/vimtex/config.nix create mode 100644 modules/plugins/latex/vimtex/default.nix create mode 100644 modules/plugins/latex/vimtex/vimtex.nix diff --git a/modules/plugins/latex/default.nix b/modules/plugins/latex/default.nix new file mode 100644 index 00000000..6da815ea --- /dev/null +++ b/modules/plugins/latex/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./vimtex + ]; +} diff --git a/modules/plugins/latex/vimtex/config.nix b/modules/plugins/latex/vimtex/config.nix new file mode 100644 index 00000000..62f52708 --- /dev/null +++ b/modules/plugins/latex/vimtex/config.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.latex.vimtex; +in { + config = mkIf cfg.enable { + vim.startPlugins = ["vimtex"]; + + vim.pluginRC.vimtex = entryAnywhere '' + -- Description of each option can be found in https://github.com/lervag/vimtex + -- Current nvf options are minimal, contribute your needed options + require("vimtex").setup(${toLuaObject cfg.setupOpts}) + ''; + }; +} diff --git a/modules/plugins/latex/vimtex/default.nix b/modules/plugins/latex/vimtex/default.nix new file mode 100644 index 00000000..1d1ecc22 --- /dev/null +++ b/modules/plugins/latex/vimtex/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./config.nix + ./vimtex.nix + ]; +} diff --git a/modules/plugins/latex/vimtex/vimtex.nix b/modules/plugins/latex/vimtex/vimtex.nix new file mode 100644 index 00000000..9f81d3c3 --- /dev/null +++ b/modules/plugins/latex/vimtex/vimtex.nix @@ -0,0 +1,40 @@ +{lib, ...}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.types) bool str listOf; + inherit (lib.nvim.types) mkPluginSetupOption; +in { + + options.vim.latex.vimtex = { + enable = mkEnableOption "VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files."; + + setupOpts = mkPluginSetupOption "vimtex" { + vimtex_view_method = mkOption { + type = str; + default = "zathura"; + description = '' + The pdf viewer to be used + + The default value is "zathura" + ''; + }; + + vimtex_syntax_enabled = mkOption { + type = bool; + default = false; + description = '' + vimtex syntax enabled + + The default value is false''; + }; + + vimtex_quickfix_ignore_filters = mkOption { + type = listOf str; + default = []; + description = '' + vimtex quickfix ignore filters + + The default value is []''; + }; + }; + }; +} diff --git a/npins/sources.json b/npins/sources.json index 5bcb9567..36eb87f2 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -2656,6 +2656,19 @@ "url": "https://github.com/mhinz/vim-startify/archive/4e089dffdad46f3f5593f34362d530e8fe823dcf.tar.gz", "hash": "1ycqfqnmalqzrx1yy9a1fc2p0w922x4sqv2222bi9xjzmh77z4sv" }, + "vimtex": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "lervag", + "repo": "vimtex" + }, + "branch": "master", + "submodules": false, + "revision": "32bcb3922c20588e00de68f73c86312eda2141ad", + "url": "https://github.com/lervag/vimtex/archive/32bcb3922c20588e00de68f73c86312eda2141ad.tar.gz", + "hash": "0lgr20w23646ada3aiqmrfxgh5dmkav4724ng2imr0v2nnfpmfh4" + }, "which-key-nvim": { "type": "Git", "repository": { From 17e88f42257ce05b789329d87de61500637fb726 Mon Sep 17 00:00:00 2001 From: mugaizzo Date: Thu, 13 Nov 2025 23:49:08 -0700 Subject: [PATCH 2/7] formating plugins/latex/vimtex/vimtex/nix --- modules/plugins/latex/vimtex/vimtex.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/plugins/latex/vimtex/vimtex.nix b/modules/plugins/latex/vimtex/vimtex.nix index 9f81d3c3..1fd96b13 100644 --- a/modules/plugins/latex/vimtex/vimtex.nix +++ b/modules/plugins/latex/vimtex/vimtex.nix @@ -3,7 +3,6 @@ inherit (lib.types) bool str listOf; inherit (lib.nvim.types) mkPluginSetupOption; in { - options.vim.latex.vimtex = { enable = mkEnableOption "VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files."; @@ -22,18 +21,18 @@ in { type = bool; default = false; description = '' - vimtex syntax enabled + vimtex syntax enabled - The default value is false''; + The default value is false''; }; vimtex_quickfix_ignore_filters = mkOption { type = listOf str; default = []; description = '' - vimtex quickfix ignore filters + vimtex quickfix ignore filters - The default value is []''; + The default value is []''; }; }; }; From df505cdf63c37551e6dcb885a8b155d387c02dbb Mon Sep 17 00:00:00 2001 From: mugaizzo Date: Fri, 14 Nov 2025 00:18:50 -0700 Subject: [PATCH 3/7] added latex to modules.nix list --- modules/modules.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/modules.nix b/modules/modules.nix index 1eca042a..64d5b90f 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -47,6 +47,7 @@ "ui" "utility" "visuals" + "latex" ]; # The neovim wrapper, used to build a wrapped neovim package From 1ffd6f70459b1b50ba87ee2779f8548275b8e682 Mon Sep 17 00:00:00 2001 From: mugaizzo Date: Fri, 14 Nov 2025 00:30:41 -0700 Subject: [PATCH 4/7] fix/vimtex option --- modules/plugins/latex/vimtex/vimtex.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/plugins/latex/vimtex/vimtex.nix b/modules/plugins/latex/vimtex/vimtex.nix index 1fd96b13..d7556b3c 100644 --- a/modules/plugins/latex/vimtex/vimtex.nix +++ b/modules/plugins/latex/vimtex/vimtex.nix @@ -3,7 +3,7 @@ inherit (lib.types) bool str listOf; inherit (lib.nvim.types) mkPluginSetupOption; in { - options.vim.latex.vimtex = { + options.vim.latex = { enable = mkEnableOption "VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files."; setupOpts = mkPluginSetupOption "vimtex" { From 872f024d5bae772d49489d587e06c55903ce5245 Mon Sep 17 00:00:00 2001 From: mugaizzo Date: Fri, 14 Nov 2025 00:41:35 -0700 Subject: [PATCH 5/7] fix/vimtex options are globals --- modules/plugins/latex/vimtex/config.nix | 14 +++++++------- modules/plugins/latex/vimtex/vimtex.nix | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/plugins/latex/vimtex/config.nix b/modules/plugins/latex/vimtex/config.nix index 62f52708..8e26e9df 100644 --- a/modules/plugins/latex/vimtex/config.nix +++ b/modules/plugins/latex/vimtex/config.nix @@ -4,18 +4,18 @@ ... }: let inherit (lib.modules) mkIf; - inherit (lib.nvim.dag) entryAnywhere; - inherit (lib.nvim.lua) toLuaObject; + # inherit (lib.nvim.dag) entryAnywhere; + # inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.latex.vimtex; in { config = mkIf cfg.enable { vim.startPlugins = ["vimtex"]; - vim.pluginRC.vimtex = entryAnywhere '' - -- Description of each option can be found in https://github.com/lervag/vimtex - -- Current nvf options are minimal, contribute your needed options - require("vimtex").setup(${toLuaObject cfg.setupOpts}) - ''; + # vim.pluginRC.vimtex = entryAnywhere '' + # -- Description of each option can be found in https://github.com/lervag/vimtex + # -- Current nvf options are minimal, contribute your needed options + # -- require("vimtex").setup(${toLuaObject cfg.setupOpts}) + # ''; }; } diff --git a/modules/plugins/latex/vimtex/vimtex.nix b/modules/plugins/latex/vimtex/vimtex.nix index d7556b3c..1fd96b13 100644 --- a/modules/plugins/latex/vimtex/vimtex.nix +++ b/modules/plugins/latex/vimtex/vimtex.nix @@ -3,7 +3,7 @@ inherit (lib.types) bool str listOf; inherit (lib.nvim.types) mkPluginSetupOption; in { - options.vim.latex = { + options.vim.latex.vimtex = { enable = mkEnableOption "VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files."; setupOpts = mkPluginSetupOption "vimtex" { From 294d658e7899922640f68772975dcbf3df97c994 Mon Sep 17 00:00:00 2001 From: mugaizzo Date: Fri, 14 Nov 2025 12:53:07 -0700 Subject: [PATCH 6/7] plugin/vimtex cleanup for pull request --- docs/release-notes/rl-0.8.md | 5 +++++ modules/plugins/latex/vimtex/config.nix | 8 -------- modules/plugins/latex/vimtex/vimtex.nix | 6 +++++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 5914df92..c0d4952e 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -510,3 +510,8 @@ - Add inline typst concealing support under `vim.languages.typst` using [typst-concealer]. + +[mugaizzo](https://github.com/mugaizzo): + +- Add [VimTeX](https://github.com/lervag/vimtex) plugin in `vim.latex.vimtex` with + `enable`. VimTeX options are set using global options `vim.globals.vimtex_OPTION`. diff --git a/modules/plugins/latex/vimtex/config.nix b/modules/plugins/latex/vimtex/config.nix index 8e26e9df..bc6e7cee 100644 --- a/modules/plugins/latex/vimtex/config.nix +++ b/modules/plugins/latex/vimtex/config.nix @@ -4,18 +4,10 @@ ... }: let inherit (lib.modules) mkIf; - # inherit (lib.nvim.dag) entryAnywhere; - # inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.latex.vimtex; in { config = mkIf cfg.enable { vim.startPlugins = ["vimtex"]; - - # vim.pluginRC.vimtex = entryAnywhere '' - # -- Description of each option can be found in https://github.com/lervag/vimtex - # -- Current nvf options are minimal, contribute your needed options - # -- require("vimtex").setup(${toLuaObject cfg.setupOpts}) - # ''; }; } diff --git a/modules/plugins/latex/vimtex/vimtex.nix b/modules/plugins/latex/vimtex/vimtex.nix index 1fd96b13..1bfa5cde 100644 --- a/modules/plugins/latex/vimtex/vimtex.nix +++ b/modules/plugins/latex/vimtex/vimtex.nix @@ -4,7 +4,11 @@ inherit (lib.nvim.types) mkPluginSetupOption; in { options.vim.latex.vimtex = { - enable = mkEnableOption "VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files."; + enable = mkEnableOption '' + VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files. + + VimTeX options are under vim.global.vimtex_OPTION + ''; setupOpts = mkPluginSetupOption "vimtex" { vimtex_view_method = mkOption { From 29066e2839fa76f18f5d9157400bdc81d92b5f60 Mon Sep 17 00:00:00 2001 From: mugaizzo Date: Fri, 14 Nov 2025 12:54:19 -0700 Subject: [PATCH 7/7] plugin/vimtex nix fmt --- modules/plugins/latex/vimtex/vimtex.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/plugins/latex/vimtex/vimtex.nix b/modules/plugins/latex/vimtex/vimtex.nix index 1bfa5cde..5b7f11f5 100644 --- a/modules/plugins/latex/vimtex/vimtex.nix +++ b/modules/plugins/latex/vimtex/vimtex.nix @@ -5,9 +5,9 @@ in { options.vim.latex.vimtex = { enable = mkEnableOption '' - VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files. + VimTeX is a modern Vim and Neovim filetype and syntax plugin for LaTeX files. - VimTeX options are under vim.global.vimtex_OPTION + VimTeX options are under vim.global.vimtex_OPTION ''; setupOpts = mkPluginSetupOption "vimtex" {