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 = {
|
||||
fzf.enable = true;
|
||||
hyfetch.enable = true;
|
||||
yazi = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
};
|
||||
|
||||
# miscellaneous programs that do not need to be configured
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
browser = "firefox";
|
||||
prefix = "Alt";
|
||||
guiFileManager = "nautilus";
|
||||
cliFileManager = "${terminal} -e yazi";
|
||||
cliFileManager = "yazi";
|
||||
in {
|
||||
programs.niri.settings.binds = {
|
||||
"${prefix}+D".action.spawn = appLauncher;
|
||||
"${prefix}+Return".action.spawn = terminal;
|
||||
"${prefix}+W".action.spawn = browser;
|
||||
"${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}+Q".action = config.lib.niri.actions.close-window;
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
./gnupg.nix
|
||||
./tmux.nix
|
||||
./direnv.nix
|
||||
./zellij.nix
|
||||
./nix-index.nix
|
||||
./yazi.nix
|
||||
];
|
||||
|
||||
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