Compare commits

...

10 commits

Author SHA1 Message Date
Soliprem
58469d2dd5
Merge b321c01047 into dfdad4c2ce 2024-11-09 01:42:20 +01:00
Ching Pei Yang
dfdad4c2ce
lazy: update lazy.plugins default 2024-11-08 19:03:01 +01:00
raf
43e3663b2b
Merge pull request #445 from horriblename/fix/devicon-color
nvim-web-devicons: re-enable icon color
2024-11-08 20:54:08 +03:00
Ching Pei Yang
b302e151e1
devicon: re-enable icon color
was mistakenly disabled in a6bb6e1b3e
2024-11-08 18:46:15 +01:00
0ba3ccdab8
modules: add config.vim to built package's passthru
Accessible under `<package>.passthru.neovimConfiguration`
2024-11-08 19:47:01 +03:00
Soliprem
1bd0ae5f7e
typst: added tinymist and activated formatters (#444)
* typst: added tinymist and activated formatters

* docs: added tinymist release notes

* typst: formatting

* docs: complying with standards

* typst: formatting
2024-11-08 18:10:40 +03:00
Soliprem
b321c01047 languages/r: removing toggle for wrappers 2024-11-05 17:21:37 +01:00
Soliprem
fbd15f5f3a languages/r: attempting to create a toggle for wrappers 2024-11-05 17:20:31 +01:00
Soliprem
152acfce5a changelog: added entry for r formatter 2024-11-04 08:52:26 +01:00
Soliprem
1d90aaec55 r: added formatters 2024-11-04 08:50:56 +01:00
6 changed files with 110 additions and 15 deletions

View file

@ -285,6 +285,9 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
- Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary - Add [](#opt-vim.spellcheck.extraSpellWords) to allow adding arbitrary
spellfiles to Neovim's runtime with ease. spellfiles to Neovim's runtime with ease.
- Add combined nvf configuration (`config.vim`) into the final package's
passthru as `passthru.neovimConfiguration` for easier debugging.
[ppenguin](https://github.com/ppenguin): [ppenguin](https://github.com/ppenguin):
- Telescope: - Telescope:
@ -294,6 +297,7 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
[Soliprem](https://github.com/Soliprem): [Soliprem](https://github.com/Soliprem):
- Add LSP and Treesitter support for R under `vim.languages.R`. - Add LSP and Treesitter support for R under `vim.languages.R`.
- Add formatter suppoort for R
- Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with - Add Otter support under `vim.lsp.otter` and an assert to prevent conflict with
ccc ccc
- Fixed typo in Otter's setupOpts - Fixed typo in Otter's setupOpts
@ -302,6 +306,8 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
`vim.languages.kotlin` `vim.languages.kotlin`
- changed default keybinds for leap.nvim to avoid altering expected behavior - changed default keybinds for leap.nvim to avoid altering expected behavior
- Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala` - Add LSP, formatter and Treesitter support for Vala under `vim.languages.vala`
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
the Typst language module.
[Bloxx12](https://github.com/Bloxx12) [Bloxx12](https://github.com/Bloxx12)
@ -326,4 +332,3 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
[Nowaaru](https://github.com/Nowaaru): [Nowaaru](https://github.com/Nowaaru):
- Add `precognition-nvim`. - Add `precognition-nvim`.

View file

@ -123,6 +123,11 @@ in {
paths = [neovim-wrapped printConfig printConfigPath]; paths = [neovim-wrapped printConfig printConfigPath];
postBuild = "echo Helpers added"; postBuild = "echo Helpers added";
# Allow evaluating vimOptions, i.e., config.vim from the packages' passthru
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
# will return the configuration in full.
passthru.neovimConfig = vimOptions;
meta = { meta = {
description = "Wrapped version of Neovim with additional helper scripts"; description = "Wrapped version of Neovim with additional helper scripts";
mainProgram = "nvim"; mainProgram = "nvim";

View file

@ -18,6 +18,37 @@
packages = with pkgs.rPackages; [languageserver]; packages = with pkgs.rPackages; [languageserver];
}; };
defaultFormat = "format_r";
formats = {
styler = {
package = pkgs.rWrapper.override {
packages = with pkgs.rPackages; [styler];
};
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.styler.with({
command = "${cfg.format.package}/bin/R",
})
)
'';
};
format_r = {
package = pkgs.rWrapper.override {
packages = with pkgs.rPackages; [formatR];
};
nullConfig = ''
table.insert(
ls_sources,
null_ls.builtins.formatting.format_r.with({
command = "${cfg.format.package}/bin/R",
})
)
'';
};
};
defaultServer = "r_language_server"; defaultServer = "r_language_server";
servers = { servers = {
r_language_server = { r_language_server = {
@ -62,6 +93,22 @@ in {
default = servers.${cfg.lsp.server}.package; default = servers.${cfg.lsp.server}.package;
}; };
}; };
format = {
enable = mkEnableOption "R formatting" // {default = config.vim.languages.enableFormat;};
type = mkOption {
description = "R formatter to use";
type = enum (attrNames formats);
default = defaultFormat;
};
package = mkOption {
description = "R formatter package";
type = package;
default = formats.${cfg.format.type}.package;
};
};
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
@ -70,6 +117,11 @@ in {
vim.treesitter.grammars = [cfg.treesitter.package]; vim.treesitter.grammars = [cfg.treesitter.package];
}) })
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.r-format = formats.${cfg.format.type}.nullConfig;
})
(mkIf cfg.lsp.enable { (mkIf cfg.lsp.enable {
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;

View file

@ -14,6 +14,38 @@
cfg = config.vim.languages.typst; cfg = config.vim.languages.typst;
defaultServer = "tinymist";
servers = {
typst-lsp = {
package = pkgs.typst-lsp;
lspConfig = ''
lspconfig.typst_lsp.setup {
capabilities = capabilities,
on_attach = default_on_attach,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
},
}
'';
};
tinymist = {
package = pkgs.tinymist;
lspConfig = ''
lspconfig.tinymist.setup {
capabilities = capabilities,
on_attach = default_on_attach,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/tinymist"}''
},
}
'';
};
};
defaultFormat = "typstfmt"; defaultFormat = "typstfmt";
formats = { formats = {
typstfmt = { typstfmt = {
@ -52,11 +84,17 @@ in {
lsp = { lsp = {
enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;}; enable = mkEnableOption "Typst LSP support (typst-lsp)" // {default = config.vim.languages.enableLSP;};
server = mkOption {
description = "Typst LSP server to use";
type = enum (attrNames servers);
default = defaultServer;
};
package = mkOption { package = mkOption {
description = "typst-lsp package, or the command to run as a list of strings"; description = "typst-lsp package, or the command to run as a list of strings";
example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]''; example = ''[lib.getExe pkgs.jdt-language-server "-data" "~/.cache/jdtls/workspace"]'';
type = either package (listOf str); type = either package (listOf str);
default = pkgs.typst-lsp; default = servers.${cfg.lsp.server}.package;
}; };
}; };
@ -82,19 +120,14 @@ in {
vim.treesitter.grammars = [cfg.treesitter.package]; vim.treesitter.grammars = [cfg.treesitter.package];
}) })
(mkIf cfg.format.enable {
vim.lsp.null-ls.enable = true;
vim.lsp.null-ls.sources.typst-format = formats.${cfg.format.type}.nullConfig;
})
(mkIf cfg.lsp.enable { (mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true; vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.typst-lsp = '' vim.lsp.lspconfig.sources.typst-lsp = servers.${cfg.lsp.server}.lspConfig;
lspconfig.typst_lsp.setup {
capabilities = capabilities,
on_attach=default_on_attach,
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/typst-lsp"}''
},
}
'';
}) })
]); ]);
} }

View file

@ -16,7 +16,7 @@ in {
enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]"; enable = mkEnableOption "Neovim dev icons [nvim-web-devicons]";
setupOpts = mkPluginSetupOption "nvim-web-devicons" { setupOpts = mkPluginSetupOption "nvim-web-devicons" {
color_icons = mkEnableOption "different highlight colors per icon"; color_icons = mkEnableOption "different highlight colors per icon" // {default = true;};
variant = mkOption { variant = mkOption {
type = nullOr (enum ["light" "dark"]); type = nullOr (enum ["light" "dark"]);
default = null; default = null;

View file

@ -189,7 +189,7 @@ in {
}; };
plugins = mkOption { plugins = mkOption {
default = []; default = {};
type = attrsOf lznPluginType; type = attrsOf lznPluginType;
description = '' description = ''
Plugins to lazy load. Plugins to lazy load.