diff --git a/configuration.nix b/configuration.nix index 98b9999..672a543 100644 --- a/configuration.nix +++ b/configuration.nix @@ -173,6 +173,7 @@ isMaximal: { obsidian.enable = false; # FIXME: neovim fails to build if obsidian is enabled neorg.enable = false; orgmode.enable = false; + quarto-nvim.enable = isMaximal; mind-nvim.enable = isMaximal; todo-comments.enable = true; }; diff --git a/flake.lock b/flake.lock index 414478d..bd22bca 100644 --- a/flake.lock +++ b/flake.lock @@ -1662,6 +1662,22 @@ "type": "github" } }, + "plugin-quarto-nvim": { + "flake": false, + "locked": { + "lastModified": 1728470501, + "narHash": "sha256-JeRiyEPpCrFaNhlrS+CH8j2Sv8c9BnL8XoSG9aTnVVU=", + "owner": "quarto-dev", + "repo": "quarto-nvim", + "rev": "23083a0152799ca7263ac9ae53d768d4dd93d24e", + "type": "github" + }, + "original": { + "owner": "quarto-dev", + "repo": "quarto-nvim", + "type": "github" + } + }, "plugin-registers": { "flake": false, "locked": { @@ -2104,6 +2120,7 @@ "plugin-plenary-nvim": "plugin-plenary-nvim", "plugin-precognition-nvim": "plugin-precognition-nvim", "plugin-project-nvim": "plugin-project-nvim", + "plugin-quarto-nvim": "plugin-quarto-nvim", "plugin-registers": "plugin-registers", "plugin-rose-pine": "plugin-rose-pine", "plugin-rtp-nvim": "plugin-rtp-nvim", diff --git a/flake.nix b/flake.nix index 144e136..3357d1f 100644 --- a/flake.nix +++ b/flake.nix @@ -186,6 +186,10 @@ flake = false; }; + plugin-quarto-nvim = { + url = "github:quarto-dev/quarto-nvim"; + flake = false; + }; plugin-otter-nvim = { url = "github:jmbuhr/otter.nvim"; flake = false; diff --git a/modules/plugins/notes/default.nix b/modules/plugins/notes/default.nix index 6c34272..ada1df0 100644 --- a/modules/plugins/notes/default.nix +++ b/modules/plugins/notes/default.nix @@ -3,6 +3,7 @@ ./obsidian ./orgmode ./neorg + ./quarto ./mind-nvim ./todo-comments ]; diff --git a/modules/plugins/notes/quarto/config.nix b/modules/plugins/notes/quarto/config.nix new file mode 100644 index 0000000..70e399f --- /dev/null +++ b/modules/plugins/notes/quarto/config.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + ... +}: let + inherit (lib.modules) mkIf mkMerge; + inherit (lib.nvim.dag) entryAnywhere; + inherit (lib.nvim.lua) toLuaObject; + + cfg = config.vim.notes.quarto-nvim; +in { + config = mkIf cfg.enable (mkMerge [ + { + vim = { + startPlugins = ["otter-nvim" "quarto-nvim"]; + + pluginRC.quarto-nvim = entryAnywhere '' + require('quarto').setup(${toLuaObject cfg.setupOpts}) + ''; + }; + } + + (mkIf cfg.treesitter.enable { + vim.treesitter.enable = true; + vim.treesitter.grammars = [cfg.treesitter.quartoPackage]; + }) + ]); +} diff --git a/modules/plugins/notes/quarto/default.nix b/modules/plugins/notes/quarto/default.nix new file mode 100644 index 0000000..906f9ec --- /dev/null +++ b/modules/plugins/notes/quarto/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./quarto.nix + ./config.nix + ]; +} diff --git a/modules/plugins/notes/quarto/quarto.nix b/modules/plugins/notes/quarto/quarto.nix new file mode 100644 index 0000000..d12bdc1 --- /dev/null +++ b/modules/plugins/notes/quarto/quarto.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib.options) mkEnableOption; + inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption; +in { + options.vim.notes.quarto-nvim = { + enable = mkEnableOption '' + Quarto-nvim, which provides tools for working on Quarto manuscripts in Neovim. + ''; + + setupOpts = mkPluginSetupOption "quarto-nvim" {}; + + treesitter = { + enable = mkEnableOption "Quarto treesitter" // {default = config.vim.languages.enableTreesitter;}; + quartoPackage = mkGrammarOption pkgs "markdown"; + quartoInlinePackage = mkGrammarOption pkgs "markdown-inline"; + }; + }; +}