utility/yazi-nvim: init (#661)
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

* utility/yazi-nvim: init

* utility/yanky-nvim: fix plugin setupOpts; assert when shada is disabled

* docs: update release notes
This commit is contained in:
raf 2025-02-24 22:05:54 +03:00 committed by GitHub
commit ae3fd99447
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 95 additions and 10 deletions

View file

@ -10,6 +10,7 @@
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim [typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim [render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
[yanky.nvim]: https://github.com/gbprod/yanky.nvim [yanky.nvim]: https://github.com/gbprod/yanky.nvim
[yazi.nvim]: https://github.com/mikavilpas/yazi.nvim
- Add [typst-preview.nvim] under - Add [typst-preview.nvim] under
`languages.typst.extensions.typst-preview-nvim`. `languages.typst.extensions.typst-preview-nvim`.
@ -46,6 +47,11 @@
- Add [yanky.nvim] to available plugins, under `vim.utility.yanky-nvim`. - Add [yanky.nvim] to available plugins, under `vim.utility.yanky-nvim`.
- Fix plugin `setupOpts` for yanky.nvim and assert if shada is configured as a
backend while shada is disabled in Neovim options.
- Add [yazi.nvim] as a companion plugin for Yazi, the terminal file manager.
[amadaluzia](https://github.com/amadaluzia): [amadaluzia](https://github.com/amadaluzia):
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim [haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
@ -154,7 +160,6 @@
Inspiration from `vim.languages.clang.dap` implementation. Inspiration from `vim.languages.clang.dap` implementation.
- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`. - Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`.
[nezia1](https://github.com/nezia1) [nezia1](https://github.com/nezia1)
- Add support for [nixd](https://github.com/nix-community/nixd) language server. - Add support for [nixd](https://github.com/nix-community/nixd) language server.
@ -165,7 +170,7 @@
available plugins, under `vim.utility.multicursors`. available plugins, under `vim.utility.multicursors`.
- Add [hydra.nvim](https://github.com/nvimtools/hydra.nvim) as dependency for - Add [hydra.nvim](https://github.com/nvimtools/hydra.nvim) as dependency for
`multicursors.nvim` and lazy loads by default. `multicursors.nvim` and lazy loads by default.
[folospior](https://github.com/folospior) [folospior](https://github.com/folospior)
- Fix plugin name for lsp/lspkind. - Fix plugin name for lsp/lspkind.
@ -180,5 +185,8 @@
[Libadoxon](https://github.com/Libadoxon) [Libadoxon](https://github.com/Libadoxon)
- Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for resolving git conflicts - Add [git-conflict](https://github.com/akinsho/git-conflict.nvim) plugin for
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt), [golines](https://github.com/segmentio/golines) and [gofumpt](https://github.com/mvdan/gofumpt) resolving git conflicts
- Add formatters for go: [gofmt](https://go.dev/blog/gofmt),
[golines](https://github.com/segmentio/golines) and
[gofumpt](https://github.com/mvdan/gofumpt)

View file

@ -7,6 +7,7 @@
./gestures ./gestures
./icon-picker ./icon-picker
./images ./images
./leetcode-nvim
./motion ./motion
./multicursors ./multicursors
./new-file-template ./new-file-template
@ -16,6 +17,6 @@
./telescope ./telescope
./wakatime ./wakatime
./yanky-nvim ./yanky-nvim
./leetcode-nvim ./yazi-nvim
]; ];
} }

View file

@ -11,6 +11,7 @@
cfg = config.vim.utility.yanky-nvim; cfg = config.vim.utility.yanky-nvim;
usingSqlite = cfg.setupOpts.ring.storage == "sqlite"; usingSqlite = cfg.setupOpts.ring.storage == "sqlite";
usingShada = cfg.setupOpts.ring.storage == "shada";
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {
@ -28,5 +29,15 @@ in {
require("yanky").setup(${toLuaObject cfg.setupOpts}); require("yanky").setup(${toLuaObject cfg.setupOpts});
''; '';
}; };
assertions = [
{
assertion = usingShada && ((config.vim.options.shada or "") == "");
message = ''
Yanky.nvim is configured to use 'shada' for the storage backend, but shada is disabled
in 'vim.options'. Please re-enable shada, or switch to a different backend.
'';
}
];
}; };
} }

View file

@ -1,13 +1,14 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) enum; inherit (lib.types) enum;
inherit (lib.nvim.types) mkPluginSetupOption;
in { in {
options.vim.utility.yanky-nvim = { options.vim.utility.yanky-nvim = {
enable = mkEnableOption '' enable = mkEnableOption ''
improved Yank and Put functionalities for Neovim [yanky-nvim] improved Yank and Put functionalities for Neovim [yanky-nvim]
''; '';
setupOpts = { setupOpts = mkPluginSetupOption "yanky-nvim" {
ring.storage = mkOption { ring.storage = mkOption {
type = enum ["shada" "sqlite" "memory"]; type = enum ["shada" "sqlite" "memory"];
default = "shada"; default = "shada";
@ -15,11 +16,11 @@ in {
description = '' description = ''
storage mode for ring values. storage mode for ring values.
- shada: this will save pesistantly using Neovim ShaDa feature. - **shada**: this will save pesistantly using Neovim ShaDa feature.
This means that history will be persisted between each session of Neovim. This means that history will be persisted between each session of Neovim.
- memory: each Neovim instance will have his own history and it will be - **memory**: each Neovim instance will have his own history and it will be
lost between sessions. lost between sessions.
- sqlite: more reliable than `shada`, requires `sqlite.lua` as a dependency. - **sqlite**: more reliable than `shada`, requires `sqlite.lua` as a dependency.
nvf will add this dependency to `PATH` automatically. nvf will add this dependency to `PATH` automatically.
''; '';
}; };

View file

@ -0,0 +1,32 @@
{
options,
config,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.binds) mkKeymap;
cfg = config.vim.utility.yazi-nvim;
keys = cfg.mappings;
inherit (options.vim.utility.yazi-nvim) mappings;
in {
config = mkIf cfg.enable {
vim = {
lazy.plugins."yazi.nvim" = {
package = pkgs.vimPlugins.yazi-nvim;
setupModule = "yazi";
inherit (cfg) setupOpts;
event = ["BufAdd" "VimEnter"];
keys = [
(mkKeymap "n" keys.openYazi "<cmd>Yazi<CR>" {desc = mappings.openYazi.description;})
(mkKeymap "n" keys.openYaziDir "<cmd>Yazi cwd<CR>" {desc = mappings.openYaziDir.description;})
(mkKeymap "n" keys.yaziToggle "<cmd>Yazi toggle<CR>" {desc = mappings.yaziToggle.description;})
];
};
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./yazi-nvim.nix
];
}

View file

@ -0,0 +1,26 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) bool;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.nvim.binds) mkMappingOption;
in {
options.vim.utility.yazi-nvim = {
enable = mkEnableOption ''
companion plugin for the yazi terminal file manager [yazi-nvim]
'';
mappings = {
openYazi = mkMappingOption "Open yazi at the current file [yazi.nvim]" "<leader>-";
openYaziDir = mkMappingOption "Open the file manager in nvim's working directory [yazi.nvim]" "<leader>cw";
yaziToggle = mkMappingOption "Resume the last yazi session [yazi.nvim]" "<c-up>";
};
setupOpts = mkPluginSetupOption "yazi-nvim" {
open_for_directories = mkOption {
type = bool;
default = false;
description = "Whether to open Yazi instead of netrw";
};
};
};
}