Merge branch 'main' into update-maintainer

This commit is contained in:
Soliprem 2025-03-24 19:14:41 +01:00 committed by GitHub
commit b07d01c65f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 83 additions and 55 deletions

View file

@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v4
- name: "Delete old branches"
uses: beatlabs/delete-old-branches-action@v0.0.10
uses: beatlabs/delete-old-branches-action@v0.0.11
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
date: "1 months ago"

View file

@ -95,8 +95,6 @@
inherit (nvimModuleDocs) optionsJSON;
};
in {
inherit (inputs) nmd;
# TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream
# `nixosOptionsDoc` is more customizable.
options.json =

View file

@ -38,3 +38,22 @@ As of version **0.7**, we exposed an API for configuring lazy-loaded plugins via
};
}
```
## LazyFile event {#sec-lazyfile-event}
You can use the `LazyFile` user event to load a plugin when a file is opened:
```nix
{
config.vim.lazy.plugins = {
"aerial.nvim" = {
package = pkgs.vimPlugins.aerial-nvim;
event = [{event = "User"; pattern = "LazyFile";}];
# ...
};
};
}
```
You can consider `LazyFile` as an alias to
`["BufReadPost" "BufNewFile" "BufWritePre"]`

View file

@ -89,6 +89,7 @@
[blink.cmp]: https://github.com/saghen/blink.cmp
- Add [blink.cmp] support.
- Add `LazyFile` user event.
[diniamo](https://github.com/diniamo):
@ -244,8 +245,8 @@
syncing of nvim shell environment with direnv's.
- Add [blink.cmp] source options and some default-disabled sources.
- Add [blink.cmp] option to add
[friendly-snippets](https://github.com/rafamadriz/friendly-snippets)
so blink.cmp can source snippets from it.
[friendly-snippets](https://github.com/rafamadriz/friendly-snippets) so
blink.cmp can source snippets from it.
- Fix [blink.cmp] breaking when built-in sources were modified.
[TheColorman](https://github.com/TheColorman):
@ -271,3 +272,7 @@
[Butzist](https://github.com/butzist):
- Add Helm chart support under `vim.languages.helm`.
[rice-cracker-dev](https://github.com/rice-cracker-dev):
- `eslint_d` now checks for configuration files to load.

17
flake.lock generated
View file

@ -106,22 +106,6 @@
"type": "github"
}
},
"nmd": {
"flake": false,
"locked": {
"lastModified": 1705050560,
"narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=",
"owner": "~rycee",
"repo": "nmd",
"rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3",
"type": "sourcehut"
},
"original": {
"owner": "~rycee",
"repo": "nmd",
"type": "sourcehut"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
@ -129,7 +113,6 @@
"mnw": "mnw",
"nil": "nil",
"nixpkgs": "nixpkgs",
"nmd": "nmd",
"systems": "systems_2"
}
},

View file

@ -86,12 +86,6 @@
# Alternate neovim-wrapper
mnw.url = "github:Gerg-L/mnw";
# For generating documentation website
nmd = {
url = "sourcehut:~rycee/nmd";
flake = false;
};
# Language servers (use master instead of nixpkgs)
nil = {
url = "github:oxalica/nil";

View file

@ -1,11 +1,11 @@
{
stdenv,
rustPlatform,
hostPlatform,
vimUtils,
git,
src,
version,
fetchpatch,
}: let
blink-fuzzy-lib = rustPlatform.buildRustPackage {
pname = "blink-fuzzy-lib";
@ -19,11 +19,6 @@
nativeBuildInputs = [git];
};
libExt =
if hostPlatform.isDarwin
then "dylib"
else "so";
in
vimUtils.buildVimPlugin {
pname = "blink-cmp";
@ -31,22 +26,13 @@ in
# blink references a repro.lua which is placed outside the lua/ directory
doCheck = false;
preInstall = ''
preInstall = let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
mkdir -p target/release
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
echo -n "nix" > target/release/version
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext}
'';
# Borrowed from nixpkgs
# TODO: Remove this patch when updating to next version
patches = [
(fetchpatch {
name = "blink-add-bypass-for-nix.patch";
url = "https://github.com/Saghen/blink.cmp/commit/6c83ef1ae34abd7ef9a32bfcd9595ac77b61037c.diff?full_index=1";
hash = "sha256-304F1gDDKVI1nXRvvQ0T1xBN+kHr3jdmwMMp8CNl+GU=";
})
];
# Module for reproducing issues
nvimSkipModule = ["repro"];
}

View file

@ -37,6 +37,12 @@ in {
inherit (cfg) setupOpts;
after = mkIf cfg.cmp.enable "require('copilot_cmp').setup()";
event = [
{
event = "User";
pattern = "LazyFile";
}
];
cmd = ["Copilot" "CopilotAuth" "CopilotDetach" "CopilotPanel" "CopilotStop"];
keys = [
(mkLuaKeymap ["n"] cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion" {})

View file

@ -13,7 +13,7 @@ in {
vim = {
startPlugins = ["nvim-lint"];
pluginRC.nvim-lint = entryAnywhere ''
require("lint").linters_by_ft(${toLuaObject cfg.linters_by_ft})
require("lint").linters_by_ft = ${toLuaObject cfg.linters_by_ft}
'';
};
};

View file

@ -72,6 +72,16 @@
ls_sources,
null_ls.builtins.diagnostics.eslint_d.with({
command = "${getExe pkg}",
condition = function(utils)
return utils.root_has_file({
"eslint.config.js",
"eslint.config.mjs",
".eslintrc",
".eslintrc.json",
".eslintrc.js",
".eslintrc.yml",
})
end,
})
)
'';

View file

@ -72,6 +72,16 @@
ls_sources,
null_ls.builtins.diagnostics.eslint_d.with({
command = "${getExe pkg}",
condition = function(utils)
return utils.root_has_file({
"eslint.config.js",
"eslint.config.mjs",
".eslintrc",
".eslintrc.json",
".eslintrc.js",
".eslintrc.yml",
})
end,
})
)
'';

View file

@ -123,6 +123,16 @@
ls_sources,
null_ls.builtins.diagnostics.eslint_d.with({
command = "${getExe pkg}",
condition = function(utils)
return utils.root_has_file({
"eslint.config.js",
"eslint.config.mjs",
".eslintrc",
".eslintrc.json",
".eslintrc.js",
".eslintrc.yml",
})
end,
})
)
'';

View file

@ -124,8 +124,6 @@ in {
mkOption {
type = enum themesConcatted;
default = "auto";
# TODO: xml generation error if the closing '' is on a new line.
# issue: https://gitlab.com/rycee/nmd/-/issues/10
defaultText = ''`config.vim.theme.name` if theme supports lualine else "auto"'';
description = "Theme for lualine";
};

View file

@ -134,6 +134,15 @@ in {
startPlugins = ["lz-n" "lzn-auto-require"];
optPlugins = pluginPackages;
augroups = [{name = "nvf_lazy_file_hooks";}];
autocmds = [
{
event = ["BufReadPost" "BufNewFile" "BufWritePre"];
group = "nvf_lazy_file_hooks";
command = "doautocmd User LazyFile";
once = true;
}
];
lazy.builtLazyConfig = ''
require('lz.n').load(${toLuaObject lznSpecs})

View file

@ -126,7 +126,7 @@
};
event = mkOption {
type = nullOr (oneOf [str (listOf str) lznEvent]);
type = nullOr (oneOf [str lznEvent (listOf (either str lznEvent))]);
default = null;
description = "Lazy-load on event";
};

View file

@ -46,10 +46,10 @@
"pre_releases": false,
"version_upper_bound": null,
"release_prefix": null,
"version": "v0.13.1",
"revision": "29861baf37bbb16f5dbf524a6edac5daaad6f4fc",
"url": "https://api.github.com/repos/saghen/blink.cmp/tarball/v0.13.1",
"hash": "1y5p7i6g884r65mhfsazx28g0qs37hc57jm37i7kch9kcf8m7sbq"
"version": "v0.14.1",
"revision": "7a91dc584f41f5aa2373a917faf8100b2e54d6c9",
"url": "https://api.github.com/repos/saghen/blink.cmp/tarball/v0.14.1",
"hash": "0zm6s3v9liimx28vs1g5yi7bcfrl691q81bvzmdpavcwrzcdb0c8"
},
"blink-cmp-spell": {
"type": "Git",