mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-07 16:05:58 +01:00
Compare commits
4 commits
141a272747
...
a6c879e8a3
Author | SHA1 | Date | |
---|---|---|---|
a6c879e8a3 | |||
|
b4c06c71dc | ||
a56a83bd46 | |||
|
8e96f0aaa3 |
7 changed files with 96 additions and 11 deletions
|
@ -59,6 +59,7 @@ isMaximal: {
|
||||||
python.enable = isMaximal;
|
python.enable = isMaximal;
|
||||||
dart.enable = isMaximal;
|
dart.enable = isMaximal;
|
||||||
bash.enable = isMaximal;
|
bash.enable = isMaximal;
|
||||||
|
r.enable = isMaximal;
|
||||||
tailwind.enable = isMaximal;
|
tailwind.enable = isMaximal;
|
||||||
typst.enable = isMaximal;
|
typst.enable = isMaximal;
|
||||||
clang = {
|
clang = {
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
(lib.removePrefix (toString ../.))
|
(lib.removePrefix (toString ../.))
|
||||||
(lib.removePrefix "/")
|
(lib.removePrefix "/")
|
||||||
(x: {
|
(x: {
|
||||||
url = "https://github.com/NotAShelf/nvf/blob/main/${decl}";
|
url = "https://github.com/NotAShelf/nvf/blob/main/${x}";
|
||||||
name = "<nvf/${x}>";
|
name = "<nvf/${x}>";
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
|
|
@ -131,6 +131,7 @@ everyone.
|
||||||
plugin's options can now be found under `indentBlankline.setupOpts`, the
|
plugin's options can now be found under `indentBlankline.setupOpts`, the
|
||||||
previous iteration of the module also included out of place/broken options,
|
previous iteration of the module also included out of place/broken options,
|
||||||
which have been removed for the time being. These are:
|
which have been removed for the time being. These are:
|
||||||
|
|
||||||
- `listChar` - this was already unused
|
- `listChar` - this was already unused
|
||||||
- `fillChar` - this had nothing to do with the plugin, please configure it
|
- `fillChar` - this had nothing to do with the plugin, please configure it
|
||||||
yourself by adding `vim.opt.listchars:append({ space = '<char>' })` to your
|
yourself by adding `vim.opt.listchars:append({ space = '<char>' })` to your
|
||||||
|
@ -216,3 +217,7 @@ everyone.
|
||||||
- Telescope:
|
- Telescope:
|
||||||
- Fixed `project-nvim` command and keybinding
|
- Fixed `project-nvim` command and keybinding
|
||||||
- Added default ikeybind/command for `Telescope resume` (`<leader>fr`)
|
- Added default ikeybind/command for `Telescope resume` (`<leader>fr`)
|
||||||
|
|
||||||
|
[Soliprem](https://github.com/Soliprem)
|
||||||
|
|
||||||
|
- Add LSP and Treesitter support for R under `vim.languages.R`.
|
||||||
|
|
12
flake.lock
12
flake.lock
|
@ -863,11 +863,11 @@
|
||||||
"plugin-neo-tree-nvim": {
|
"plugin-neo-tree-nvim": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713050882,
|
"lastModified": 1726542367,
|
||||||
"narHash": "sha256-cZwOVpdMT0NCtp6Ha592QA2RzKVS6LhXXcjfDBCQ+0k=",
|
"narHash": "sha256-Lqt0KJNT9HmpJwZoWChYeVBrDWhscRe8COqVCwgcTwk=",
|
||||||
"owner": "nvim-neo-tree",
|
"owner": "nvim-neo-tree",
|
||||||
"repo": "neo-tree.nvim",
|
"repo": "neo-tree.nvim",
|
||||||
"rev": "22e566aeb075c94f670f34077e05ba95190dfb4a",
|
"rev": "a77af2e764c5ed4038d27d1c463fa49cd4794e07",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1280,11 +1280,11 @@
|
||||||
"plugin-nvim-treesitter-context": {
|
"plugin-nvim-treesitter-context": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716388265,
|
"lastModified": 1726947805,
|
||||||
"narHash": "sha256-EY5Si6t7LXcxOP3ubGAAMd3lgbeaCOCIybSKi1Ucx98=",
|
"narHash": "sha256-5oN/vyhSqDqjLEzECj01A7A+Yq7U1H1HXLbzkC1Ljqw=",
|
||||||
"owner": "nvim-treesitter",
|
"owner": "nvim-treesitter",
|
||||||
"repo": "nvim-treesitter-context",
|
"repo": "nvim-treesitter-context",
|
||||||
"rev": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683",
|
"rev": "3d5390c49e3f8fe457b376df2a49aa39d75b7911",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
# The core neovim modules.
|
# The core neovim modules.
|
||||||
# Contains configuration for core neovim features
|
# Contains configuration for core neovim features
|
||||||
# such as spellchecking, mappings, and the init script (init.vim).
|
# such as spellchecking, mappings, and the init script (init.vim).
|
||||||
neovim = map (p: "${./neovim}/${p}") [
|
neovim = map (p: ./neovim + "/${p}") [
|
||||||
"init"
|
"init"
|
||||||
"mappings"
|
"mappings"
|
||||||
];
|
];
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
# Individual plugin modules, separated by the type of plugin.
|
# Individual plugin modules, separated by the type of plugin.
|
||||||
# While adding a new type, you must make sure your type is
|
# While adding a new type, you must make sure your type is
|
||||||
# included in the list below.
|
# included in the list below.
|
||||||
plugins = map (p: "${./plugins}/${p}") [
|
plugins = map (p: ./plugins + "/${p}") [
|
||||||
"assistant"
|
"assistant"
|
||||||
"autopairs"
|
"autopairs"
|
||||||
"comments"
|
"comments"
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
# The neovim wrapper, used to build a wrapped neovim package
|
# The neovim wrapper, used to build a wrapped neovim package
|
||||||
# using the configuration passed in `neovim` and `plugins` modules.
|
# using the configuration passed in `neovim` and `plugins` modules.
|
||||||
wrapper = map (p: "${./wrapper}/${p}") [
|
wrapper = map (p: ./wrapper + "/${p}") [
|
||||||
"build"
|
"build"
|
||||||
"rc"
|
"rc"
|
||||||
"warnings"
|
"warnings"
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
|
|
||||||
# Extra modules, such as deprecation warnings
|
# Extra modules, such as deprecation warnings
|
||||||
# or renames in one place.
|
# or renames in one place.
|
||||||
extra = map (p: "${./extra}/${p}") [
|
extra = map (p: ./extra + "/${p}") [
|
||||||
"deprecations.nix"
|
"deprecations.nix"
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
|
|
|
@ -17,6 +17,7 @@ in {
|
||||||
./ocaml.nix
|
./ocaml.nix
|
||||||
./php.nix
|
./php.nix
|
||||||
./python.nix
|
./python.nix
|
||||||
|
./r.nix
|
||||||
./rust.nix
|
./rust.nix
|
||||||
./sql.nix
|
./sql.nix
|
||||||
./svelte.nix
|
./svelte.nix
|
||||||
|
|
78
modules/plugins/languages/r.nix
Normal file
78
modules/plugins/languages/r.nix
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.lists) isList;
|
||||||
|
inherit (lib.types) enum either listOf package str;
|
||||||
|
inherit (lib.nvim.lua) expToLua;
|
||||||
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.r;
|
||||||
|
|
||||||
|
r-with-languageserver = pkgs.rWrapper.override {
|
||||||
|
packages = with pkgs.rPackages; [languageserver];
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultServer = "r_language_server";
|
||||||
|
servers = {
|
||||||
|
r_language_server = {
|
||||||
|
package = pkgs.writeShellScriptBin "r_lsp" ''
|
||||||
|
${r-with-languageserver}/bin/R --slave -e "languageserver::run()"
|
||||||
|
'';
|
||||||
|
lspConfig = ''
|
||||||
|
lspconfig.r_language_server.setup{
|
||||||
|
capabilities = capabilities;
|
||||||
|
on_attach = default_on_attach;
|
||||||
|
cmd = ${
|
||||||
|
if isList cfg.lsp.package
|
||||||
|
then expToLua cfg.lsp.package
|
||||||
|
else ''{"${lib.getExe cfg.lsp.package}"}''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.languages.r = {
|
||||||
|
enable = mkEnableOption "R language support";
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = mkEnableOption "R treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
|
package = mkGrammarOption pkgs "r";
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable = mkEnableOption "R LSP support" // {default = config.vim.languages.enableLSP;};
|
||||||
|
|
||||||
|
server = mkOption {
|
||||||
|
description = "R LSP server to use";
|
||||||
|
type = enum (attrNames servers);
|
||||||
|
default = defaultServer;
|
||||||
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
description = "R LSP server package, or the command to run as a list of strings";
|
||||||
|
example = literalExpression "[ (lib.getExe pkgs.jdt-language-server) \"-data\" \"~/.cache/jdtls/workspace\" ]";
|
||||||
|
type = either package (listOf str);
|
||||||
|
default = servers.${cfg.lsp.server}.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter.enable = true;
|
||||||
|
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.lspconfig.enable = true;
|
||||||
|
vim.lsp.lspconfig.sources.r-lsp = servers.${cfg.lsp.server}.lspConfig;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
Loading…
Reference in a new issue