better yazi bindings

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2025-01-19 22:06:58 +01:00
parent 73339cfc50
commit 207961e397

View File

@@ -1,5 +1,4 @@
{ pkgs, system, rice, inputs, ... }:
{ pkgs, lib, system, rice, inputs, ... }:
{
home.packages = with pkgs; [
# yazi
@@ -18,7 +17,7 @@
};
# initLua = /* lua */ '' '';
keymap = {
keymap = [
manager.keymap = [
{ on = "<Esc>"; run = "escape"; desc = "Exit visual mode, clear selected, or cancel search"; }
{ on = "q"; run = "quit"; desc = "Exit the process"; }
{ on = "Q"; run = "quit --no-cwd-file"; desc = "Exit the process without writing cwd-file"; }
@@ -61,11 +60,12 @@
{ on = "K"; run = "seek -5"; desc = "Seek up 5 units in the preview"; }
{ on = "J"; run = "seek 5"; desc = "Seek down 5 units in the preview"; }
# Selection
{ on = "<Space>"; run = [ "select --state=none" "arrow 1" ]; desc = "Toggle the current selection state"; }
{ on = "<Space>"; run = [ "toggle --state=none" "arrow 1" ]; desc = "Toggle the current selection state"; }
{ on = "v"; run = "visual_mode"; desc = "Enter visual mode (selection mode)"; }
{ on = "V"; run = "visual_mode --unset"; desc = "Enter visual mode (unset mode)"; }
{ on = "<C-a>"; run = "select_all --state=true"; desc = "Select all files"; }
{ on = "<C-r>"; run = "select_all --state=none"; desc = "Inverse selection of all files"; }
{ on = "<C-a>"; run = "toggle_all --state=on"; desc = "Select all files"; }
{ on = "<C-n>"; run = "toggle_all --state=off"; desc = "Deselect all files"; }
{ on = "<C-r>"; run = "toggle_all --state=none"; desc = "Inverse selection of all files"; }
# Operation
{ on = "o"; run = "open"; desc = "Open selected files"; }
{ on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; }
@@ -126,6 +126,7 @@
{ on = [ "," "S" ]; run = [ "sort size --reverse" "linemode size" ]; desc = "Sort by size (reverse)"; }
# Tab
{ on = "t"; run = "tab_create --current"; desc = "Create a new tab with CWD"; }
{ on = "<C-w>"; run = "close"; desc = "Close the current tab"; }
{ on = "1"; run = "tab_switch 0"; desc = "Switch to the first tab"; }
{ on = "2"; run = "tab_switch 1"; desc = "Switch to the second tab"; }
{ on = "3"; run = "tab_switch 2"; desc = "Switch to the third tab"; }
@@ -135,14 +136,46 @@
{ on = "7"; run = "tab_switch 6"; desc = "Switch to the seventh tab"; }
{ on = "8"; run = "tab_switch 7"; desc = "Switch to the eighth tab"; }
{ on = "9"; run = "tab_switch 8"; desc = "Switch to the ninth tab"; }
{ on = "<C-1>"; run = "tab_swap 0"; desc = "Swap current tab with the first tab"; }
{ on = "<C-2>"; run = "tab_swap 1"; desc = "Swap current tab with the second tab"; }
{ on = "<C-3>"; run = "tab_swap 2"; desc = "Swap current tab with the third tab"; }
{ on = "<C-4>"; run = "tab_swap 3"; desc = "Swap current tab with the fourth tab"; }
{ on = "<C-5>"; run = "tab_swap 4"; desc = "Swap current tab with the fifth tab"; }
{ on = "<C-5>"; run = "tab_swap 4"; desc = "Swap current tab with "; }
{ on = "<C-6>"; run = "tab_swap 5"; desc = "Swap current tab with the sixth tab"; }
{ on = "<C-6>"; run = "tab_swap 5"; desc = "Swap current tab with "; }
{ on = "<C-7>"; run = "tab_swap 6"; desc = "Swap current tab with the seventh tab"; }
{ on = "<C-7>"; run = "tab_swap 6"; desc = "Swap current tab with tab"; }
{ on = "<C-8>"; run = "tab_swap 7"; desc = "Swap current tab with the eighth tab"; }
{ on = "<C-8>"; run = "tab_swap 7"; desc = "Swap current tab with b"; }
{ on = "<C-9>"; run = "tab_swap 8"; desc = "Swap current tab with the ninth tab"; }
{ on = "<C-9>"; run = "tab_swap 8"; desc = "Swap current tab with "; }
{ on = "["; run = "tab_switch -1 --relative"; desc = "Switch to the previous tab"; }
{ on = "["; run = "tab_switch -1 --relative"; desc = "Switch to thtab"; }
{ on = "]"; run = "tab_switch 1 --relative"; desc = "Switch to the next tab"; }
{ on = "]"; run = "tab_switch 1 --relative"; desc = "Switch ttab"; }
{ on = "{"; run = "tab_swap -1"; desc = "Swap current tab with previous tab"; }
{ on = "{"; run = "tab_swap -1"; desc = "Swap current tab wittab"; }
{ on = "}"; run = "tab_swap 1"; desc = "Swap current tab with next tab"; }
# Task
# Tasks
{ on = "w"; run = "tasks_show"; desc = "Show task manager"; }
# Hel
];
tasks.keymap = [
# Task
{ on = "w"; run = "close"; desc = "Close Task View"; }
{ on = "q"; run = "close"; desc = "Close Task View"; }
{ on = "<Esc>"; run = "close"; desc = "Close Task View"; }
{ on = "c"; run = "cancel"; desc = "Cancel Task"; }
{ on = "i"; run = "inspect"; desc = "Inspect Task"; }
{ on = "j"; run = "arrow -1"; desc = "Up in list"; }
{ on = "k"; run = "arrow 1"; desc = "Down in list"; }
{ on = "u"; run = "arrow -5"; desc = "Up in list (fast)"; }
{ on = "d"; run = "arrow 5"; desc = "Down in list (fast)"; }
];
help = [
# Help
{ on = "~"; run = "help"; desc = "Open help"; }
{ on = "?"; run = "help"; desc = "Open help"; }
{ on = "<F1>"; run = "help"; desc = "Open help"; }
];
};
@@ -175,10 +208,12 @@
{ run = ''imv "$@"''; desc = "imv"; }
{ run = ''gimp "$@"''; desc = "gimp"; }
{ run = ''swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 "$@"''; desc = "swww wallpaper"; }
{ run = ''exiftool "$@"; echo "Press enter to exit"; read''; desc = "View Exif Data"; }
{ run = ''for f in "$@"; do magick "$f" -auto-orient "''${f%.*}.pdf"; done''; desc = "Convert to PDF"; }
];
"svg" = [
{ run = ''inkscape "$@"''; desc = "inkscape";}
{ run = ''firefoc "$@"''; desc = "firefox";}
{ run = ''firefox "$@"''; desc = "firefox";}
];
"font" = [
{ run = ''fontpreview "$@"''; desc = "fontpreview"; }