mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-27 06:05:43 +02:00
treewide: format with new nixfmt
This commit is contained in:
parent
d63fd77511
commit
dd73afe9c6
34 changed files with 665 additions and 679 deletions
|
@ -12,8 +12,7 @@
|
|||
};
|
||||
|
||||
# Public `lib` flake output
|
||||
flake.lib =
|
||||
{
|
||||
flake.lib = {
|
||||
nixvim = lib.makeOverridable (import ../lib) {
|
||||
inherit lib;
|
||||
flake = self;
|
||||
|
|
|
@ -50,7 +50,8 @@ in
|
|||
modulesPath = ../modules;
|
||||
# TODO: deprecate `helpers`
|
||||
helpers = self;
|
||||
} // extraSpecialArgs;
|
||||
}
|
||||
// extraSpecialArgs;
|
||||
};
|
||||
}
|
||||
// lib.mapAttrs (
|
||||
|
|
|
@ -49,8 +49,7 @@
|
|||
warnings =
|
||||
let
|
||||
# All keymap options that have historically supported the `lua` sub-option
|
||||
keymapOptions =
|
||||
[
|
||||
keymapOptions = [
|
||||
options.keymaps
|
||||
options.keymapsOnEvents
|
||||
options.plugins.wtf.keymaps.ai
|
||||
|
|
|
@ -6,8 +6,9 @@ let
|
|||
by-name = ../plugins/by-name;
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[ ../plugins ]
|
||||
imports = [
|
||||
../plugins
|
||||
]
|
||||
++ foldlAttrs (
|
||||
prev: name: type:
|
||||
prev ++ optional (type == "directory") (by-name + "/${name}")
|
||||
|
|
|
@ -7,8 +7,7 @@ let
|
|||
];
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[
|
||||
imports = [
|
||||
(mkRemovedOptionModule (basePluginPath ++ [ "server" ]) ''
|
||||
To configure the `clangd` language server options, please use
|
||||
`plugins.lsp.servers.clangd.extraSettings`.
|
||||
|
|
|
@ -6,8 +6,9 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
imports =
|
||||
[ { cmpSourcePlugins.crates = "crates"; } ]
|
||||
imports = [
|
||||
{ cmpSourcePlugins.crates = "crates"; }
|
||||
]
|
||||
++
|
||||
# TODO introduced 2024-12-12: remove after 25.05
|
||||
lib.nixvim.mkSettingsRenamedOptionModules [ "plugins" "crates-nvim" ]
|
||||
|
|
|
@ -78,8 +78,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
plugins.dap = {
|
||||
enable = true;
|
||||
|
||||
extensionConfigLua =
|
||||
''
|
||||
extensionConfigLua = ''
|
||||
require("dap-python").setup("${cfg.adapterPythonPath}", ${toLuaObject cfg.settings})
|
||||
''
|
||||
+ (optionalString (cfg.testRunners != null) ''
|
||||
|
|
|
@ -34,7 +34,8 @@ rec {
|
|||
The filetype to use for content retrieved via a source request.
|
||||
'';
|
||||
};
|
||||
} // attrs;
|
||||
}
|
||||
// attrs;
|
||||
};
|
||||
|
||||
executableAdapterOption = mkAdapterType {
|
||||
|
|
|
@ -78,7 +78,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
DapStopped = dapStopped;
|
||||
DapBreakpointRejected = dapBreakpointRejected;
|
||||
};
|
||||
} // cfg.settings;
|
||||
}
|
||||
// cfg.settings;
|
||||
in
|
||||
{
|
||||
plugins.dap.luaConfig.content = lib.mkMerge [
|
||||
|
|
|
@ -190,7 +190,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
action = "Telescope find_files cwd=";
|
||||
```
|
||||
'';
|
||||
} // extraOptions;
|
||||
}
|
||||
// extraOptions;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
|
@ -15,8 +15,7 @@ lib.nixvim.plugins.mkVimPlugin {
|
|||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
# TODO: Added 2024-12-16; remove after 25.05
|
||||
optionsRenamedToSettings =
|
||||
[
|
||||
optionsRenamedToSettings = [
|
||||
"autoclose"
|
||||
"autohide"
|
||||
"autoinsert"
|
||||
|
@ -31,7 +30,8 @@ lib.nixvim.plugins.mkVimPlugin {
|
|||
"width"
|
||||
"wintype"
|
||||
]
|
||||
++ map
|
||||
++
|
||||
map
|
||||
(name: {
|
||||
old = [
|
||||
"keymaps"
|
||||
|
|
|
@ -70,8 +70,7 @@ lib.nixvim.plugins.mkVimPlugin {
|
|||
];
|
||||
};
|
||||
|
||||
settingsOptions =
|
||||
{
|
||||
settingsOptions = {
|
||||
preview_win_location = defaultNullOpts.mkEnumFirstDefault [ "bo" "to" "bel" "abo" ] ''
|
||||
This option determines where the preview window pops up as a result of the
|
||||
`:GitGutterPreviewHunk` command.
|
||||
|
|
|
@ -65,8 +65,7 @@ lib.nixvim.plugins.mkVimPlugin {
|
|||
};
|
||||
|
||||
extraOptions = {
|
||||
keymaps =
|
||||
{
|
||||
keymaps = {
|
||||
silent = mkOption {
|
||||
type = types.bool;
|
||||
description = "Whether julia-cell keymaps should be silent";
|
||||
|
|
|
@ -214,8 +214,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
extraConfig = cfg: {
|
||||
autoCmd = lib.optionals (cfg.autoCmd != null) [ cfg.autoCmd ];
|
||||
plugins.lint.luaConfig.content =
|
||||
''
|
||||
plugins.lint.luaConfig.content = ''
|
||||
local __lint = require('lint')
|
||||
''
|
||||
+ (lib.optionalString (cfg.lintersByFt != null) ''
|
||||
|
|
|
@ -54,8 +54,7 @@ in
|
|||
config =
|
||||
let
|
||||
doCmp = cfg.cmp.enable && config.plugins.cmp.enable;
|
||||
options =
|
||||
{
|
||||
options = {
|
||||
inherit (cfg) mode preset;
|
||||
symbol_map = cfg.symbolMap;
|
||||
}
|
||||
|
|
|
@ -12,8 +12,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
# TODO introduced 2024-02-29: remove 2024-04-29
|
||||
deprecateExtraOptions = true;
|
||||
imports =
|
||||
[
|
||||
imports = [
|
||||
# TODO: added 2025-04-07, remove after 25.05
|
||||
(lib.nixvim.mkRemovedPackageOptionModule {
|
||||
plugin = "neogit";
|
||||
|
|
|
@ -14,8 +14,7 @@ let
|
|||
cfg' = config.plugins.none-ls.sources.${sourceType}.${sourceName};
|
||||
in
|
||||
{
|
||||
options.plugins.none-ls.sources.${sourceType}.${sourceName} =
|
||||
{
|
||||
options.plugins.none-ls.sources.${sourceType}.${sourceName} = {
|
||||
enable = lib.mkEnableOption "the ${sourceName} ${sourceType} source for none-ls";
|
||||
# Support strLua for compatibility with the old withArgs option
|
||||
settings = lib.nixvim.defaultNullOpts.mkStrLuaOr' {
|
||||
|
|
|
@ -4,8 +4,7 @@ let
|
|||
mkSourcePlugin = import ./_mk-source-plugin.nix;
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[
|
||||
imports = [
|
||||
./prettier.nix
|
||||
./prettierd.nix
|
||||
]
|
||||
|
|
|
@ -158,7 +158,8 @@ in
|
|||
extra_opts = extraOpts;
|
||||
};
|
||||
};
|
||||
} // cfg.extraOptions;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [ cfg.package ];
|
||||
|
|
|
@ -1186,9 +1186,7 @@ in
|
|||
nested = true;
|
||||
});
|
||||
|
||||
extraConfigLua =
|
||||
(optionalString autoOpenEnabled openNvimTreeFunction)
|
||||
+ ''
|
||||
extraConfigLua = (optionalString autoOpenEnabled openNvimTreeFunction) + ''
|
||||
|
||||
require('nvim-tree').setup(${lib.nixvim.toLuaObject setupOptions})
|
||||
'';
|
||||
|
|
|
@ -207,7 +207,8 @@ in
|
|||
reading_text = cfg.readingText;
|
||||
workspace_text = cfg.workspaceText;
|
||||
line_number_text = cfg.lineNumberText;
|
||||
} // cfg.extraOptions;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [ cfg.package ];
|
||||
|
|
|
@ -125,7 +125,8 @@ in
|
|||
standalone file support
|
||||
setting it to false may improve startup time
|
||||
'';
|
||||
} // import ../../lsp/language-servers/rust-analyzer-config.nix lib;
|
||||
}
|
||||
// import ../../lsp/language-servers/rust-analyzer-config.nix lib;
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
extraPlugins = [
|
||||
|
@ -174,7 +175,8 @@ in
|
|||
inherit (cfg.server) standalone;
|
||||
settings.rust-analyzer = lib.filterAttrs (n: v: n != "standalone") cfg.server;
|
||||
};
|
||||
} // cfg.extraOptions;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
in
|
||||
''
|
||||
require('rust-tools').setup(${lib.nixvim.toLuaObject options})
|
||||
|
|
|
@ -52,7 +52,8 @@ in
|
|||
let
|
||||
setupOptions = {
|
||||
inherit (cfg) skipInsignificantPunctuation;
|
||||
} // cfg.extraOptions;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
|
||||
mappings = mapAttrsToList (motion: key: {
|
||||
mode = [
|
||||
|
|
|
@ -331,7 +331,8 @@ in
|
|||
folded_section = foldedSection;
|
||||
};
|
||||
inherit (cfg) parts;
|
||||
} // sections;
|
||||
}
|
||||
// sections;
|
||||
in
|
||||
''
|
||||
require('startup').setup(${lib.nixvim.toLuaObject setupOptions})
|
||||
|
|
|
@ -56,7 +56,8 @@ let
|
|||
options = settingsOptions;
|
||||
example = settingsExample;
|
||||
};
|
||||
} // extraOptions;
|
||||
}
|
||||
// extraOptions;
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
|
|
|
@ -29,7 +29,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
imports = [
|
||||
# Register nvim-cmp association
|
||||
{ cmpSourcePlugins.codeium = "windsurf-nvim"; }
|
||||
] ++ (import ./deprecations.nix { inherit lib; }).imports;
|
||||
]
|
||||
++ (import ./deprecations.nix { inherit lib; }).imports;
|
||||
|
||||
settingsExample = {
|
||||
enable_chat = true;
|
||||
|
|
|
@ -70,8 +70,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
callSetup = false;
|
||||
extraConfig = cfg: {
|
||||
plugins.cmp.luaConfig.content =
|
||||
''
|
||||
plugins.cmp.luaConfig.content = ''
|
||||
local cmp = require('cmp')
|
||||
cmp.setup(${toLuaObject cfg.settings})
|
||||
|
||||
|
|
|
@ -168,7 +168,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
options = {
|
||||
inherit (cfg.keymaps) silent;
|
||||
desc = "${descPrefix} ${actionStr}";
|
||||
} // actionProps;
|
||||
}
|
||||
// actionProps;
|
||||
}
|
||||
);
|
||||
in
|
||||
|
|
|
@ -144,7 +144,8 @@ in
|
|||
type = types.attrsOf types.anything;
|
||||
description = "Extra options for the ${name} language server.";
|
||||
};
|
||||
} // extraOptions;
|
||||
}
|
||||
// extraOptions;
|
||||
};
|
||||
|
||||
config = lib.mkIf enabled {
|
||||
|
@ -170,7 +171,8 @@ in
|
|||
opts = opts.settings;
|
||||
enabled = true;
|
||||
};
|
||||
} // cfg.extraOptions;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
@ -548,47 +548,35 @@ in
|
|||
with cfg.pythonPackage.pkgs;
|
||||
{
|
||||
pylsp_mypy = pylsp-mypy.overridePythonAttrs (old: {
|
||||
postPatch =
|
||||
old.postPatch or ''''
|
||||
+ ''
|
||||
postPatch = old.postPatch or '''' + ''
|
||||
substituteInPlace setup.cfg \
|
||||
--replace-fail "python-lsp-server >=1.7.0" ""
|
||||
'';
|
||||
});
|
||||
isort = pyls-isort.overridePythonAttrs (old: {
|
||||
postPatch =
|
||||
old.postPatch or ''''
|
||||
+ ''
|
||||
postPatch = old.postPatch or '''' + ''
|
||||
substituteInPlace setup.py \
|
||||
--replace-fail 'install_requires=["python-lsp-server", "isort"],' 'install_requires=["isort"],'
|
||||
'';
|
||||
});
|
||||
black = python-lsp-black.overridePythonAttrs (old: {
|
||||
postPatch =
|
||||
old.postPatch or ''''
|
||||
+ ''
|
||||
postPatch = old.postPatch or '''' + ''
|
||||
substituteInPlace setup.cfg \
|
||||
--replace-fail "python-lsp-server>=1.4.0" ""
|
||||
'';
|
||||
});
|
||||
memestra = pyls-memestra.overridePythonAttrs (old: {
|
||||
postPatch =
|
||||
old.postPatch or ''''
|
||||
+ ''
|
||||
postPatch = old.postPatch or '''' + ''
|
||||
sed -i '/python-lsp-server/d' requirements.txt
|
||||
'';
|
||||
});
|
||||
rope = pylsp-rope.overridePythonAttrs (old: {
|
||||
postPatch =
|
||||
old.postPatch or ''''
|
||||
+ ''
|
||||
postPatch = old.postPatch or '''' + ''
|
||||
sed -i '/python-lsp-server/d' setup.cfg
|
||||
'';
|
||||
});
|
||||
ruff = python-lsp-ruff.overridePythonAttrs (old: {
|
||||
postPatch =
|
||||
old.postPatch or ''''
|
||||
+ ''
|
||||
postPatch = old.postPatch or '''' + ''
|
||||
sed -i '/python-lsp-server/d' pyproject.toml
|
||||
'';
|
||||
|
||||
|
|
|
@ -38,8 +38,7 @@ let
|
|||
let
|
||||
inherit (pkgs.stdenv) hostPlatform;
|
||||
|
||||
disabled =
|
||||
[
|
||||
disabled = [
|
||||
# DEPRECATED SERVERS
|
||||
# See https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig.lua
|
||||
"ruff_lsp"
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
"_module"
|
||||
];
|
||||
|
||||
brokenTools =
|
||||
[
|
||||
brokenTools = [
|
||||
#TODO Added 2025-04-01
|
||||
# php-cs-fixer is marked as broken
|
||||
"php_cs_fixer"
|
||||
|
@ -61,8 +60,7 @@
|
|||
];
|
||||
|
||||
# TODO: respect unpackaged from generated
|
||||
unpackaged =
|
||||
[
|
||||
unpackaged = [
|
||||
"blade_formatter"
|
||||
"cljstyle"
|
||||
"cspell"
|
||||
|
|
|
@ -105,8 +105,7 @@
|
|||
|
||||
sources =
|
||||
let
|
||||
disabled =
|
||||
[
|
||||
disabled = [
|
||||
#TODO Added 2025-04-01
|
||||
# php-cs-fixer is marked as broken
|
||||
"phpcsfixer"
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
let
|
||||
inherit (pkgs.stdenv) hostPlatform;
|
||||
|
||||
disabledSources =
|
||||
[
|
||||
disabledSources = [
|
||||
# We do not provide the required HF_API_KEY environment variable.
|
||||
"cmp_ai"
|
||||
# Triggers the warning complaining about treesitter highlighting being disabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue