mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins: cleanup most extraConfig
args
- Remove `cfg` where it is unused. - Use `opts` where necessary.
This commit is contained in:
parent
63cfc84abe
commit
7b94afceaf
22 changed files with 98 additions and 99 deletions
|
@ -78,7 +78,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
};
|
||||
};
|
||||
|
||||
extraConfig = _: {
|
||||
extraConfig = {
|
||||
plugins.avante.luaConfig.pre = ''
|
||||
require('avante_lib').load()
|
||||
'';
|
||||
|
|
|
@ -654,7 +654,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
plugins.web-devicons = lib.mkIf (
|
||||
!(
|
||||
|
|
|
@ -11,7 +11,7 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
|
||||
maintainers = [ maintainers.GaetanLepage ];
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
# Those options are strongly recommended by the plugin author:
|
||||
# https://github.com/folke/edgy.nvim?tab=readme-ov-file#-installation
|
||||
opts = {
|
||||
|
|
|
@ -72,21 +72,17 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
'';
|
||||
|
||||
callSetup = false;
|
||||
extraConfig =
|
||||
let
|
||||
opt = options.plugins.firenvim;
|
||||
in
|
||||
cfg: {
|
||||
warnings =
|
||||
lib.optional
|
||||
(
|
||||
config.performance.combinePlugins.enable
|
||||
&& !(lib.elem "firenvim" config.performance.combinePlugins.standalonePlugins)
|
||||
)
|
||||
''
|
||||
Nixvim (plugins.firenvim): Using `performance.combinePlugins` breaks `firenvim`.
|
||||
Add this plugin to `performance.combinePlugins.standalonePlugins` to prevent any issue.
|
||||
'';
|
||||
globals.firenvim_config = lib.modules.mkAliasAndWrapDefsWithPriority lib.id opt.settings;
|
||||
};
|
||||
extraConfig = cfg: opts: {
|
||||
warnings =
|
||||
lib.optional
|
||||
(
|
||||
config.performance.combinePlugins.enable
|
||||
&& !(lib.elem "firenvim" config.performance.combinePlugins.standalonePlugins)
|
||||
)
|
||||
''
|
||||
Nixvim (plugins.firenvim): Using `performance.combinePlugins` breaks `firenvim`.
|
||||
Add this plugin to `performance.combinePlugins.standalonePlugins` to prevent any issue.
|
||||
'';
|
||||
globals.firenvim_config = lib.modules.mkAliasAndWrapDefsWithPriority lib.id opts.settings;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -101,53 +101,48 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
};
|
||||
};
|
||||
|
||||
extraConfig =
|
||||
cfg:
|
||||
let
|
||||
opt = options.plugins.fzf-lua;
|
||||
in
|
||||
{
|
||||
# TODO: deprecated 2024-08-29 remove after 24.11
|
||||
warnings = lib.optionals opt.iconsEnabled.isDefined [
|
||||
''
|
||||
The option definition `plugins.fzf-lua.iconsEnabled' in ${lib.showFiles opt.iconsEnabled.files} has been deprecated; please remove it.
|
||||
''
|
||||
];
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
plugins.web-devicons =
|
||||
lib.mkIf
|
||||
(
|
||||
opt.iconsEnabled.isDefined
|
||||
&& cfg.iconsEnabled
|
||||
&& !(
|
||||
config.plugins.mini.enable
|
||||
&& config.plugins.mini.modules ? icons
|
||||
&& config.plugins.mini.mockDevIcons
|
||||
)
|
||||
extraConfig = cfg: opts: {
|
||||
# TODO: deprecated 2024-08-29 remove after 24.11
|
||||
warnings = lib.optionals opts.iconsEnabled.isDefined [
|
||||
''
|
||||
The option definition `plugins.fzf-lua.iconsEnabled' in ${lib.showFiles opts.iconsEnabled.files} has been deprecated; please remove it.
|
||||
''
|
||||
];
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
plugins.web-devicons =
|
||||
lib.mkIf
|
||||
(
|
||||
opts.iconsEnabled.isDefined
|
||||
&& cfg.iconsEnabled
|
||||
&& !(
|
||||
config.plugins.mini.enable
|
||||
&& config.plugins.mini.modules ? icons
|
||||
&& config.plugins.mini.mockDevIcons
|
||||
)
|
||||
{
|
||||
enable = lib.mkOverride 1490 true;
|
||||
};
|
||||
|
||||
extraPackages = [ cfg.fzfPackage ];
|
||||
|
||||
plugins.fzf-lua.settings.__unkeyed_profile = cfg.profile;
|
||||
|
||||
keymaps = mapAttrsToList (
|
||||
key: mapping:
|
||||
let
|
||||
actionStr =
|
||||
if isString mapping then
|
||||
"${mapping}()"
|
||||
else
|
||||
"${mapping.action}(${helpers.toLuaObject mapping.settings})";
|
||||
in
|
||||
)
|
||||
{
|
||||
inherit key;
|
||||
mode = mapping.mode or "n";
|
||||
action.__raw = "function() require('fzf-lua').${actionStr} end";
|
||||
options = mapping.options or { };
|
||||
}
|
||||
) cfg.keymaps;
|
||||
};
|
||||
enable = lib.mkOverride 1490 true;
|
||||
};
|
||||
|
||||
extraPackages = [ cfg.fzfPackage ];
|
||||
|
||||
plugins.fzf-lua.settings.__unkeyed_profile = cfg.profile;
|
||||
|
||||
keymaps = mapAttrsToList (
|
||||
key: mapping:
|
||||
let
|
||||
actionStr =
|
||||
if isString mapping then
|
||||
"${mapping}()"
|
||||
else
|
||||
"${mapping.action}(${helpers.toLuaObject mapping.settings})";
|
||||
in
|
||||
{
|
||||
inherit key;
|
||||
mode = mapping.mode or "n";
|
||||
action.__raw = "function() require('fzf-lua').${actionStr} end";
|
||||
options = mapping.options or { };
|
||||
}
|
||||
) cfg.keymaps;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ helpers.vim-plugin.mkVimPlugin {
|
|||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
extraConfig = _: {
|
||||
extraConfig = {
|
||||
warnings = optional (!config.plugins.treesitter.enable) ''
|
||||
Nixvim (plugins.haskell-scope-highlighting): haskell-scope-highlighting needs treesitter to function as intended.
|
||||
Please, enable it by setting `plugins.treesitter.enable` to `true`.
|
||||
|
|
|
@ -21,7 +21,7 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
markdown.headline_highlights = [ "Headline1" ];
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
warnings = optional (!config.plugins.treesitter.enable) ''
|
||||
Nixvim (plugins.headlines): headlines requires `plugins.treesitter` to be enabled with the relevant grammars installed.
|
||||
'';
|
||||
|
|
|
@ -210,7 +210,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
};
|
||||
|
||||
callSetup = false;
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
globals.lightline = lib.modules.mkAliasAndWrapDefsWithPriority lib.id options.plugins.lightline.settings;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
)
|
||||
];
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
# Strongly recommended by the plugin, to avoid duplication.
|
||||
diagnostics.virtual_text = mkDefault false;
|
||||
};
|
||||
|
|
|
@ -43,7 +43,7 @@ mkExtension {
|
|||
case_mode = "ignore_case";
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
# Native library is in build/libfzf.so
|
||||
performance.combinePlugins.pathsToLink = [ "/build" ];
|
||||
};
|
||||
|
|
|
@ -96,7 +96,7 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
zindex = 20;
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
warnings = mkIf (!config.plugins.treesitter.enable) [
|
||||
"Nixvim: treesitter-context needs treesitter to function as intended"
|
||||
];
|
||||
|
|
|
@ -36,7 +36,7 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
"skipTags"
|
||||
];
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
warnings = mkIf (!config.plugins.treesitter.enable) [
|
||||
"Nixvim: ts-autotag needs treesitter to function as intended"
|
||||
];
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
{
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
{ lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
inherit (lib) types;
|
||||
inherit (lib.nixvim) defaultNullOpts mkRaw toLuaObject;
|
||||
|
||||
opt = options.plugins.which-key;
|
||||
|
||||
specExamples = [
|
||||
# Basic group with custom icon
|
||||
{
|
||||
|
@ -583,12 +577,12 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
# TODO: introduced 2024-07-29: remove after 24.11
|
||||
# NOTE: this may be upgraded to a mkRemoveOptionModule when which-key removes support
|
||||
extraConfig =
|
||||
cfg:
|
||||
lib.mkIf opt.registrations.isDefined {
|
||||
cfg: opts:
|
||||
lib.mkIf opts.registrations.isDefined {
|
||||
warnings = [
|
||||
''
|
||||
nixvim (plugins.which-key):
|
||||
The option definition `plugins.which-key.registrations' in ${showFiles opt.registrations.files} has been deprecated in which-key v3; please remove it.
|
||||
The option definition `plugins.which-key.registrations' in ${showFiles opts.registrations.files} has been deprecated in which-key v3; please remove it.
|
||||
You should use `plugins.which-key.settings.spec' instead.
|
||||
|
||||
Note: the spec format has changed in which-key v3
|
||||
|
@ -596,7 +590,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
''
|
||||
];
|
||||
|
||||
plugins.which-key.luaConfig.content = lib.optionalString opt.registrations.isDefined ''
|
||||
plugins.which-key.luaConfig.content = lib.optionalString opts.registrations.isDefined ''
|
||||
require("which-key").register(${toLuaObject cfg.registrations})
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -316,5 +316,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
|
||||
extraConfig = {
|
||||
opts.termguicolors = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -251,5 +251,7 @@ lib.nixvim.vim-plugin.mkVimPlugin {
|
|||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
|
||||
extraConfig = {
|
||||
opts.termguicolors = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,5 +10,7 @@ lib.nixvim.vim-plugin.mkVimPlugin {
|
|||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
|
||||
extraConfig = {
|
||||
opts.termguicolors = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -108,5 +108,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
on_highlights = "function(highlights, colors) end";
|
||||
};
|
||||
|
||||
extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
|
||||
extraConfig = {
|
||||
opts.termguicolors = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -21,5 +21,7 @@ lib.nixvim.vim-plugin.mkVimPlugin {
|
|||
allow_italics = true;
|
||||
};
|
||||
|
||||
extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
|
||||
extraConfig = {
|
||||
opts.termguicolors = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -10,5 +10,7 @@ lib.nixvim.vim-plugin.mkVimPlugin {
|
|||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
|
||||
extraConfig = {
|
||||
opts.termguicolors = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -154,5 +154,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
before_highlight = "function(group, highlight, palette) end";
|
||||
};
|
||||
|
||||
extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
|
||||
extraConfig = {
|
||||
opts.termguicolors = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -177,5 +177,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
on_highlights = "function(highlights, colors) end";
|
||||
};
|
||||
|
||||
extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
|
||||
extraConfig = {
|
||||
opts.termguicolors = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -24,11 +24,9 @@ let
|
|||
};
|
||||
};
|
||||
idris2_lsp = {
|
||||
extraConfig =
|
||||
cfg:
|
||||
mkIf cfg.enable {
|
||||
plugins.idris2.enable = lib.mkDefault true;
|
||||
};
|
||||
extraConfig = {
|
||||
plugins.idris2.enable = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
jsonls = {
|
||||
settings = cfg: { json = cfg; };
|
||||
|
@ -115,7 +113,7 @@ let
|
|||
ts_ls = {
|
||||
# NOTE: Provide the plugin default filetypes so that
|
||||
# `plugins.lsp.servers.volar.tslsIntegration` doesn't wipe out the default filetypes
|
||||
extraConfig = cfg: {
|
||||
extraConfig = {
|
||||
plugins.lsp.servers.ts_ls = {
|
||||
filetypes = [
|
||||
"javascript"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue