Compare commits

...

11 commits

Author SHA1 Message Date
QuiNz-
7868198945
Merge branch 'NotAShelf:main' into feat-ruff 2025-03-23 22:05:39 +01:00
raf
14fb42562e
Merge pull request #734 from horriblename/lazy-file
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Validate flake & check documentation / Validate Flake Documentation (push) Waiting to run
Validate flake & check documentation / Validate hyperlinks in documentation sources (push) Waiting to run
Validate flake & check formatting / Validate Flake (push) Waiting to run
Validate flake & check formatting / Formatting via Alejandra (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Check for typos in the source tree / check-typos (push) Waiting to run
lazy: create LazyFile user event, load copilot-lua on LazyFile
2025-03-23 16:04:56 +00:00
raf
e0715c4e78
Merge branch 'main' into lazy-file 2025-03-23 15:58:09 +00:00
Phan Đăng Khoa
7696f470a7
eslint_d: added conditions for launching eslint_d (#737)
* eslint_d: added conditions for launching eslint_d

* eslint_d: documented changes to docs/release-notes/rl-0.8.md

---------

Co-authored-by: raf <raf@notashelf.dev>
2025-03-23 15:57:38 +00:00
Ching Pei Yang
d105f69921 docs: mention LazyFile 2025-03-23 11:09:51 +01:00
Ching Pei Yang
5f99c7f4e5 docs: update release notes 2025-03-23 11:09:51 +01:00
Ching Pei Yang
c639cf5064 copilot: load on LazyFile 2025-03-23 11:09:51 +01:00
Ching Pei Yang
e2d10e8fb2 lazy: create LazyFile user event 2025-03-23 11:09:51 +01:00
Ching Pei Yang
58021beb1c lazy: fix incomplete event type 2025-03-23 11:09:51 +01:00
Ching Pei Yang
60c3a2ff1e
nvim-lint: fix config syntax (#735)
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Check for typos in the source tree / check-typos (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
2025-03-22 16:57:21 +00:00
dependabot[bot]
3a28d05684
build(deps): bump beatlabs/delete-old-branches-action (#729)
Some checks failed
Check for typos in the source tree / check-typos (push) Has been cancelled
Bumps [beatlabs/delete-old-branches-action](https://github.com/beatlabs/delete-old-branches-action) from 0.0.10 to 0.0.11.
- [Release notes](https://github.com/beatlabs/delete-old-branches-action/releases)
- [Commits](https://github.com/beatlabs/delete-old-branches-action/compare/v0.0.10...v0.0.11)

---
updated-dependencies:
- dependency-name: beatlabs/delete-old-branches-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-20 11:44:49 +00:00
10 changed files with 74 additions and 5 deletions

View file

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

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 [blink.cmp]: https://github.com/saghen/blink.cmp
- Add [blink.cmp] support. - Add [blink.cmp] support.
- Add `LazyFile` user event.
[diniamo](https://github.com/diniamo): [diniamo](https://github.com/diniamo):
@ -249,8 +250,8 @@
syncing of nvim shell environment with direnv's. syncing of nvim shell environment with direnv's.
- Add [blink.cmp] source options and some default-disabled sources. - Add [blink.cmp] source options and some default-disabled sources.
- Add [blink.cmp] option to add - Add [blink.cmp] option to add
[friendly-snippets](https://github.com/rafamadriz/friendly-snippets) [friendly-snippets](https://github.com/rafamadriz/friendly-snippets) so
so blink.cmp can source snippets from it. blink.cmp can source snippets from it.
- Fix [blink.cmp] breaking when built-in sources were modified. - Fix [blink.cmp] breaking when built-in sources were modified.
[TheColorman](https://github.com/TheColorman): [TheColorman](https://github.com/TheColorman):
@ -276,3 +277,7 @@
[Butzist](https://github.com/butzist): [Butzist](https://github.com/butzist):
- Add Helm chart support under `vim.languages.helm`. - 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.

View file

@ -37,6 +37,12 @@ in {
inherit (cfg) setupOpts; inherit (cfg) setupOpts;
after = mkIf cfg.cmp.enable "require('copilot_cmp').setup()"; after = mkIf cfg.cmp.enable "require('copilot_cmp').setup()";
event = [
{
event = "User";
pattern = "LazyFile";
}
];
cmd = ["Copilot" "CopilotAuth" "CopilotDetach" "CopilotPanel" "CopilotStop"]; cmd = ["Copilot" "CopilotAuth" "CopilotDetach" "CopilotPanel" "CopilotStop"];
keys = [ keys = [
(mkLuaKeymap ["n"] cfg.mappings.panel.accept (wrapPanelBinding ''require("copilot.panel").accept'' cfg.mappings.panel.accept) "[copilot] Accept suggestion" {}) (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 = { vim = {
startPlugins = ["nvim-lint"]; startPlugins = ["nvim-lint"];
pluginRC.nvim-lint = entryAnywhere '' 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, ls_sources,
null_ls.builtins.diagnostics.eslint_d.with({ null_ls.builtins.diagnostics.eslint_d.with({
command = "${getExe pkg}", 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, ls_sources,
null_ls.builtins.diagnostics.eslint_d.with({ null_ls.builtins.diagnostics.eslint_d.with({
command = "${getExe pkg}", 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, ls_sources,
null_ls.builtins.diagnostics.eslint_d.with({ null_ls.builtins.diagnostics.eslint_d.with({
command = "${getExe pkg}", 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

@ -134,6 +134,15 @@ in {
startPlugins = ["lz-n" "lzn-auto-require"]; startPlugins = ["lz-n" "lzn-auto-require"];
optPlugins = pluginPackages; 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 = '' lazy.builtLazyConfig = ''
require('lz.n').load(${toLuaObject lznSpecs}) require('lz.n').load(${toLuaObject lznSpecs})

View file

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