Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarto: init #425

Draft
wants to merge 6 commits into
base: v0.7
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,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;
};
Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/rl-0.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ everyone.
- Add LSP and Treesitter support for R under `vim.languages.R`.
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
ccc
- Fixed typo in Otter's setupOpts
- Add Neorg support under `vim.notes.neorg`
- Add LSP, diagnostics, formatter and Treesitter support for Kotlin under
`vim.languages.kotlin`
Expand Down
17 changes: 17 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@
flake = false;
};

plugin-quarto-nvim = {
url = "github:quarto-dev/quarto-nvim";
flake = false;
};
plugin-otter-nvim = {
url = "github:jmbuhr/otter.nvim";
flake = false;
Expand Down
2 changes: 1 addition & 1 deletion modules/plugins/lsp/otter/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ in {

pluginRC.otter-nvim = entryAnywhere ''
-- Enable otter diagnostics viewer
require("otter").setup({${toLuaObject cfg.otter-nvim.setupOpts}})
require("otter").setup(${toLuaObject cfg.otter-nvim.setupOpts})
'';
};
};
Expand Down
1 change: 1 addition & 0 deletions modules/plugins/notes/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
./obsidian
./orgmode
./neorg
./quarto
./mind-nvim
./todo-comments
];
Expand Down
28 changes: 28 additions & 0 deletions modules/plugins/notes/quarto/config.nix
Original file line number Diff line number Diff line change
@@ -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];
})
]);
}
6 changes: 6 additions & 0 deletions modules/plugins/notes/quarto/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
imports = [
./quarto.nix
./config.nix
];
}
23 changes: 23 additions & 0 deletions modules/plugins/notes/quarto/quarto.nix
Original file line number Diff line number Diff line change
@@ -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";
};
};
}