mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-29 22:30:13 +02:00
Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90?narHash=sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS%2Bb4tfNFCwE%3D' (2024-11-01) → 'github:hercules-ci/flake-parts/205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9?narHash=sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c%3D' (2024-12-04) • Updated input 'git-hooks': 'github:cachix/git-hooks.nix/3308484d1a443fc5bc92012435d79e80458fe43c?narHash=sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE%3D' (2024-11-19) → 'github:cachix/git-hooks.nix/6f4e2a2112050951a314d2733a994fbab94864c6?narHash=sha256-SVQVsbafSM1dJ4fpgyBqLZ%2BLft%2BjcQuMtEL3lQWx2Sk%3D' (2024-12-04) • Updated input 'home-manager': 'github:nix-community/home-manager/62d536255879be574ebfe9b87c4ac194febf47c5?narHash=sha256-lYnT%2BEYE47f5yY3KS/Kd4pJ6CO9fhCqumkYYkQ3TK20%3D' (2024-12-01) → 'github:nix-community/home-manager/c7ffc9727d115e433fd884a62dc164b587ff651d?narHash=sha256-zjO6m5BqxXIyjrnUziAzk4%2BT4VleqjstNudSqWcpsHI%3D' (2024-12-07) • Updated input 'nix-darwin': 'github:lnl7/nix-darwin/c6b65d946097baf3915dd51373251de98199280d?narHash=sha256-Qs3YmoLYUJ8g4RkFj2rMrzrP91e4ShAioC9s%2BvG6ENM%3D' (2024-12-02) → 'github:lnl7/nix-darwin/a35b08d09efda83625bef267eb24347b446c80b8?narHash=sha256-sQJAxY1TYWD1UyibN/FnN97paTFuwBw3Vp3DNCyKsMk%3D' (2024-12-07) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/f9f0d5c5380be0a599b1fb54641fa99af8281539?narHash=sha256-En%2BgSoVJ3iQKPDU1FHrR6zIxSLXKjzKY%2Bpnh9tt%2BYts%3D' (2024-12-02) → 'github:NixOS/nixpkgs/4dc2fc4e62dbf62b84132fe526356fbac7b03541?narHash=sha256-FillH0qdWDt/nlO6ED7h4cmN%2BG9uXwGjwmCnHs0QVYM%3D' (2024-12-05) • Updated input 'nuschtosSearch': 'github:NuschtOS/search/16307548b7a1247291c84ae6a12c0aacb07dfba2?narHash=sha256-BC1CecAQISV5Q4LZK72Gx0%2BfaemOwaChiD9rMVfDPoA%3D' (2024-11-30) → 'github:NuschtOS/search/68e9fad70d95d08156cf10a030bd39487bed8ffe?narHash=sha256-315rJ7O9cOllPDaFscnJhcMleORHbxon0Kq9LAKJ5p4%3D' (2024-12-05) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/6209c381904cab55796c5d7350e89681d3b2a8ef?narHash=sha256-2qbdorpq0TXHBWbVXaTqKoikN4bqAtAplTwGuII%2BoAc%3D' (2024-11-29) → 'github:numtide/treefmt-nix/50862ba6a8a0255b87377b9d2d4565e96f29b410?narHash=sha256-qKL3vjO%2BIXFQ0nTinFDqNq/sbbnnS5bMI1y0xX215fU%3D' (2024-12-05)
164 lines
5.2 KiB
Nix
164 lines
5.2 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib) types;
|
|
inherit (lib.nixvim) defaultNullOpts;
|
|
in
|
|
lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|
name = "yazi";
|
|
originalName = "yazi.nvim";
|
|
package = "yazi-nvim";
|
|
|
|
maintainers = [ lib.maintainers.khaneliman ];
|
|
|
|
description = ''
|
|
Yazi is a blazing fast file manager for the terminal.
|
|
This plugin allows you to open yazi in a floating window in Neovim.
|
|
|
|
Some default keybindings have additional dependencies you may need to install or enable.
|
|
See the [upstream docs](https://github.com/mikavilpas/yazi.nvim?tab=readme-ov-file#%EF%B8%8F-keybindings) for details.
|
|
'';
|
|
|
|
extraOptions = {
|
|
yaziPackage = lib.mkPackageOption pkgs "yazi" {
|
|
nullable = true;
|
|
};
|
|
};
|
|
|
|
extraConfig = cfg: {
|
|
extraPackages = [ cfg.yaziPackage ];
|
|
};
|
|
|
|
settingsOptions = {
|
|
log_level = defaultNullOpts.mkLogLevel' {
|
|
pluginDefault = "off";
|
|
description = ''
|
|
The log level to use. Off by default, but can be used to diagnose
|
|
issues. You can find the location of the log file by running
|
|
`:checkhealth yazi` in Neovim.
|
|
'';
|
|
};
|
|
|
|
open_for_directories = defaultNullOpts.mkBool false "";
|
|
|
|
use_ya_for_events_reading = defaultNullOpts.mkBool false ''
|
|
Use the `ya` command to read events.
|
|
|
|
Allows more complex behaviors using the `ya` messaging system.
|
|
'';
|
|
|
|
use_yazi_client_id_flag = defaultNullOpts.mkBool false "Allows passing which instance of yazi is being controlled.";
|
|
|
|
enable_mouse_support = defaultNullOpts.mkBool false "Enables mouse support.";
|
|
|
|
open_file_function = defaultNullOpts.mkLuaFn' {
|
|
pluginDefault.__raw = ''
|
|
function(chosen_file)
|
|
vim.cmd(string.format("edit %s", vim.fn.fnameescape(chosen_file)))
|
|
end
|
|
'';
|
|
description = ''
|
|
What Neovim should do a when a file was opened (selected) in yazi.
|
|
|
|
Defaults to simply opening the file.
|
|
'';
|
|
};
|
|
|
|
clipboard_register = defaultNullOpts.mkStr "*" ''
|
|
Some yazi.nvim commands copy text to the clipboard. This is the register
|
|
yazi.nvim should use for copying. Defaults to "*", the system clipboard.
|
|
'';
|
|
|
|
keymaps =
|
|
defaultNullOpts.mkNullable (types.either types.attrs (types.enum [ false ]))
|
|
{
|
|
show_help = "<f1>";
|
|
open_file_in_vertical_split = "<c-v>";
|
|
open_file_in_horizontal_split = "<c-x>";
|
|
open_file_in_tab = "<c-t>";
|
|
grep_in_directory = "<c-s>";
|
|
replace_in_directory = "<c-g>";
|
|
cycle_open_buffers = "<tab>";
|
|
copy_relative_path_to_selected_files = "<c-y>";
|
|
send_to_quickfix_list = "<c-q>";
|
|
}
|
|
''
|
|
Customize the keymaps that are active when yazi is open and focused.
|
|
|
|
Also:
|
|
- use e.g. `open_file_in_tab = false` to disable a keymap
|
|
- you can customize only some of the keymaps if you want
|
|
- Set to `false` to disable all default keymaps.
|
|
'';
|
|
|
|
set_keymappings_function = defaultNullOpts.mkLuaFn null ''
|
|
Completely override the keymappings for yazi. This function will be
|
|
called in the context of the yazi terminal buffer.
|
|
'';
|
|
|
|
hooks = {
|
|
yazi_opened = defaultNullOpts.mkLuaFn' {
|
|
pluginDefault.__raw = ''
|
|
function(preselected_path, yazi_buffer_id, config)
|
|
end
|
|
'';
|
|
description = ''
|
|
If you want to execute a custom action when yazi has been opened,
|
|
you can define it here.
|
|
'';
|
|
};
|
|
|
|
yazi_closed_successfully = defaultNullOpts.mkLuaFn' {
|
|
pluginDefault.__raw = ''
|
|
function(chosen_file, config, state)
|
|
end
|
|
'';
|
|
description = "When yazi was successfully closed";
|
|
};
|
|
|
|
yazi_opened_multiple_files = defaultNullOpts.mkLuaFn' {
|
|
pluginDefault.__raw = ''
|
|
function(chosen_files)
|
|
vim.cmd("args" .. table.concat(chosen_files, " "))
|
|
end
|
|
'';
|
|
description = ''
|
|
When yazi opened multiple files. The default is to send them to the
|
|
quickfix list, but if you want to change that, you can define it here
|
|
'';
|
|
};
|
|
};
|
|
|
|
highlight_groups = defaultNullOpts.mkAttributeSet { hovered_buffer = null; } ''
|
|
Add highlight groups to different yazi events.
|
|
|
|
NOTE: this only works if `use_ya_for_events_reading` is enabled, etc.
|
|
'';
|
|
|
|
floating_window_scaling_factor = defaultNullOpts.mkNum 0.9 "The floating window scaling factor. 1 means 100%, 0.9 means 90%, etc.";
|
|
|
|
yazi_floating_window_winblend = defaultNullOpts.mkNullableWithRaw' {
|
|
type = types.ints.between 0 100;
|
|
pluginDefault = 0;
|
|
description = "`0` for fully opaque and `100` for fully transparent. See :h winblend";
|
|
};
|
|
|
|
yazi_floating_window_border = defaultNullOpts.mkBorder "rounded" "yazi" ''
|
|
The type of border to use for the floating window.
|
|
|
|
Supports all available border types from `vim.api.keyset.win_config.border`.
|
|
'';
|
|
};
|
|
|
|
settingsExample = {
|
|
log_level = "debug";
|
|
open_for_directories = true;
|
|
enable_mouse_support = true;
|
|
floating_window_scaling_factor = 0.5;
|
|
yazi_floating_window_border = "single";
|
|
yazi_floating_window_winblend = 50;
|
|
};
|
|
}
|