mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-08 09:09:49 +01:00
Compare commits
4 commits
d8cb2a7d3a
...
a2121bd77e
Author | SHA1 | Date | |
---|---|---|---|
|
a2121bd77e | ||
46aa168b2d | |||
|
9aad80d5e6 | ||
|
4eeadf3c96 |
3 changed files with 57 additions and 12 deletions
|
@ -1729,11 +1729,11 @@
|
||||||
"plugin-run-nvim": {
|
"plugin-run-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1732918526,
|
"lastModified": 1734816675,
|
||||||
"narHash": "sha256-kiszNmZZDXG8tAPMQKuGJDCkqCMzsWT7BkCvkVsH2lA=",
|
"narHash": "sha256-Wuk5HG+vHXAbifzp5YB5V/FxBhBRNWLeypkRczpXbvQ=",
|
||||||
"owner": "diniamo",
|
"owner": "diniamo",
|
||||||
"repo": "run.nvim",
|
"repo": "run.nvim",
|
||||||
"rev": "d867466e01b8fa4e54a589b9ef446cf43fb966de",
|
"rev": "6cd971afdce6443d7a070dcc23af51da1cc932f9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -721,6 +721,11 @@
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-R-nvim = {
|
||||||
|
url = "github:R-nvim/R.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
plugin-haskell-tools-nvim = {
|
plugin-haskell-tools-nvim = {
|
||||||
url = "github:mrcjkb/haskell-tools.nvim";
|
url = "github:mrcjkb/haskell-tools.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
|
@ -6,11 +6,13 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrNames;
|
inherit (builtins) attrNames;
|
||||||
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
inherit (lib.lists) isList;
|
inherit (lib.lists) isList;
|
||||||
inherit (lib.types) enum either listOf package str;
|
inherit (lib.types) enum either listOf package str nullOr attrsOf;
|
||||||
inherit (lib.nvim.lua) expToLua;
|
inherit (lib.nvim.lua) expToLua toLuaObject;
|
||||||
inherit (lib.nvim.types) mkGrammarOption;
|
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.languages.r;
|
cfg = config.vim.languages.r;
|
||||||
|
|
||||||
|
@ -74,7 +76,12 @@ in {
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = mkEnableOption "R treesitter" // {default = config.vim.languages.enableTreesitter;};
|
enable = mkEnableOption "R treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
package = mkGrammarOption pkgs "r";
|
rPackage = mkGrammarOption pkgs "r";
|
||||||
|
rnowebPackage = mkGrammarOption pkgs "rnoweb";
|
||||||
|
mdPackage = mkGrammarOption pkgs "markdown";
|
||||||
|
mdInlinePackage = mkGrammarOption pkgs "markdown-inline";
|
||||||
|
yamlPackage = mkGrammarOption pkgs "yaml";
|
||||||
|
csvPackage = mkGrammarOption pkgs "csv";
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
@ -109,14 +116,28 @@ in {
|
||||||
description = "R formatter package";
|
description = "R formatter package";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extensions = {
|
||||||
|
R-nvim = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption ''
|
||||||
|
[R.nvim]: https://github.com/R-Nvim/R.nvim
|
||||||
|
|
||||||
|
R.nvim adds R support to Neovim, including:
|
||||||
|
|
||||||
|
- Communication with R via Neovim's built-in terminal or tmux
|
||||||
|
- A built-in object explorer and autocompletions built from your R environment
|
||||||
|
- Keyboard shortcuts for common inserts like <- and |>
|
||||||
|
- Quarto/R Markdown support
|
||||||
|
''
|
||||||
|
// {default = true;};
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "R-nvim" {};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
(mkIf cfg.treesitter.enable {
|
|
||||||
vim.treesitter.enable = true;
|
|
||||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
|
||||||
})
|
|
||||||
|
|
||||||
(mkIf cfg.format.enable {
|
(mkIf cfg.format.enable {
|
||||||
vim.lsp.null-ls.enable = true;
|
vim.lsp.null-ls.enable = true;
|
||||||
vim.lsp.null-ls.sources.r-format = formats.${cfg.format.type}.nullConfig;
|
vim.lsp.null-ls.sources.r-format = formats.${cfg.format.type}.nullConfig;
|
||||||
|
@ -126,5 +147,24 @@ in {
|
||||||
vim.lsp.lspconfig.enable = true;
|
vim.lsp.lspconfig.enable = true;
|
||||||
vim.lsp.lspconfig.sources.r-lsp = servers.${cfg.lsp.server}.lspConfig;
|
vim.lsp.lspconfig.sources.r-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [
|
||||||
|
cfg.treesitter.rPackage
|
||||||
|
cfg.treesitter.rnowebPackage
|
||||||
|
cfg.treesitter.mdPackage
|
||||||
|
cfg.treesitter.mdInlinePackage
|
||||||
|
cfg.treesitter.yamlPackage
|
||||||
|
cfg.treesitter.csvPackage
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.extensions.R-nvim.enable {
|
||||||
|
vim.startPlugins = ["R-nvim"];
|
||||||
|
vim.pluginRC.R-nvim= entryAnywhere ''
|
||||||
|
require("r").setup(${toLuaObject cfg.extensions.R-nvim.setupOpts})
|
||||||
|
'';
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue