treewide: add some yazi config and bind it to niri
This commit is contained in:
parent
bc2ebd6c82
commit
64db2313b0
5 changed files with 29 additions and 15 deletions
|
@ -15,10 +15,6 @@
|
||||||
programs = {
|
programs = {
|
||||||
fzf.enable = true;
|
fzf.enable = true;
|
||||||
hyfetch.enable = true;
|
hyfetch.enable = true;
|
||||||
yazi = {
|
|
||||||
enable = true;
|
|
||||||
enableFishIntegration = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# miscellaneous programs that do not need to be configured
|
# miscellaneous programs that do not need to be configured
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
browser = "firefox";
|
browser = "firefox";
|
||||||
prefix = "Alt";
|
prefix = "Alt";
|
||||||
guiFileManager = "nautilus";
|
guiFileManager = "nautilus";
|
||||||
cliFileManager = "${terminal} -e yazi";
|
cliFileManager = "yazi";
|
||||||
in {
|
in {
|
||||||
programs.niri.settings.binds = {
|
programs.niri.settings.binds = {
|
||||||
"${prefix}+D".action.spawn = appLauncher;
|
"${prefix}+D".action.spawn = appLauncher;
|
||||||
"${prefix}+Return".action.spawn = terminal;
|
"${prefix}+Return".action.spawn = terminal;
|
||||||
"${prefix}+W".action.spawn = browser;
|
"${prefix}+W".action.spawn = browser;
|
||||||
"${prefix}+E".action.spawn = guiFileManager;
|
"${prefix}+E".action.spawn = guiFileManager;
|
||||||
"${prefix}+Shift+E".action.spawn = cliFileManager;
|
"${prefix}+Shift+E".action.spawn = [terminal "-e" cliFileManager];
|
||||||
|
|
||||||
"${prefix}+Shift+Slash".action = config.lib.niri.actions.show-hotkey-overlay;
|
"${prefix}+Shift+Slash".action = config.lib.niri.actions.show-hotkey-overlay;
|
||||||
"${prefix}+Q".action = config.lib.niri.actions.close-window;
|
"${prefix}+Q".action = config.lib.niri.actions.close-window;
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
./gnupg.nix
|
./gnupg.nix
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./zellij.nix
|
|
||||||
./nix-index.nix
|
./nix-index.nix
|
||||||
|
./yazi.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
|
26
home/terminal/programs/yazi.nix
Normal file
26
home/terminal/programs/yazi.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
programs.yazi = let
|
||||||
|
# https://github.com/iynaix/dotfiles/blob/8bb1568019ea26f034ac1af9c499b3ff102391a5/home-manager/shell/yazi.nix#L9-L11
|
||||||
|
mkYaziPlugin = name: text: {
|
||||||
|
"${name}" = toString (pkgs.writeTextDir "${name}.yazi/init.lua" text) + "/${name}.yazi";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
enable = true;
|
||||||
|
enableFishIntegration = true;
|
||||||
|
plugins = mkYaziPlugin "smart-enter" ''
|
||||||
|
return {
|
||||||
|
entry = function()
|
||||||
|
local h = cx.active.current.hovered
|
||||||
|
ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true })
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
keymap.manager.prepend_keymap = [
|
||||||
|
{
|
||||||
|
on = "l";
|
||||||
|
run = "plugin --sync smart-enter";
|
||||||
|
desc = "Enter the child directory, or open the file";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
programs.zellij = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
pane_frames = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue