snowflake/home/programs/terminal/yazi/keymap.nix

290 lines
5.7 KiB
Nix
Raw Normal View History

2024-01-17 14:40:02 -05:00
_: {
programs.yazi.keymap = {
manager.keymap = [
{
on = ["<Esc>"];
2024-04-23 12:51:15 -04:00
run = "escape";
2024-01-17 14:40:02 -05:00
desc = "Exit visual mode; clear selected; or cancel search";
}
{
on = ["q"];
2024-04-23 12:51:15 -04:00
run = "quit";
2024-01-17 14:40:02 -05:00
desc = "Exit the process";
}
{
on = ["<C-q>"];
2024-04-23 12:51:15 -04:00
run = "close";
2024-01-17 14:40:02 -05:00
desc = "Close the current tab; or quit if it is last tab";
}
# Navigation
{
on = ["<Up>"];
2024-04-23 12:51:15 -04:00
run = "arrow -1";
2024-01-17 14:40:02 -05:00
desc = "Move cursor up";
}
{
on = ["<Down>"];
2024-04-23 12:51:15 -04:00
run = "arrow 1";
2024-01-17 14:40:02 -05:00
desc = "Move cursor down";
}
{
on = ["<Left>"];
2024-04-23 12:51:15 -04:00
run = "leave";
2024-01-17 14:40:02 -05:00
desc = "Go back to the parent directory";
}
{
on = ["<Right>"];
2024-04-23 12:51:15 -04:00
run = "enter";
2024-01-17 14:40:02 -05:00
desc = "Enter the child directory";
}
{
on = ["g" "g"];
2024-04-23 12:51:15 -04:00
run = "arrow -99999999";
2024-01-17 14:40:02 -05:00
desc = "Move cursor to the top";
}
{
on = ["G"];
2024-04-23 12:51:15 -04:00
run = "arrow 99999999";
2024-01-17 14:40:02 -05:00
desc = "Move cursor to the bottom";
}
# Selection
{
on = ["<Space>"];
2024-04-23 12:51:15 -04:00
run = ["select --state=none" "arrow 1"];
2024-01-17 14:40:02 -05:00
desc = "Toggle the current selection state";
}
{
on = ["i"];
2024-04-23 12:51:15 -04:00
run = "visual_mode";
2024-01-17 14:40:02 -05:00
desc = "Enter visual mode (selection mode)";
}
{
on = ["I"];
2024-04-23 12:51:15 -04:00
run = "visual_mode --unset";
2024-01-17 14:40:02 -05:00
desc = "Enter visual mode (unset mode)";
}
{
on = ["<C-a>"];
2024-04-23 12:51:15 -04:00
run = "select_all --state=true";
2024-01-17 14:40:02 -05:00
desc = "Select all files";
}
{
on = ["<C-r>"];
2024-04-23 12:51:15 -04:00
run = "select_all --state=none";
2024-01-17 14:40:02 -05:00
desc = "Inverse selection of all files";
}
# Operations
{
on = ["<Enter>"];
2024-04-23 12:51:15 -04:00
run = "open";
2024-01-17 14:40:02 -05:00
desc = "Open selected file(s)";
}
{
on = ["y"];
2024-04-23 12:51:15 -04:00
run = "yank";
2024-01-17 14:40:02 -05:00
desc = "Copy selected file(s)";
}
{
on = ["x"];
2024-04-23 12:51:15 -04:00
run = "yank --cut";
2024-01-17 14:40:02 -05:00
desc = "Cut selected file(s)";
}
{
on = ["p"];
2024-04-23 12:51:15 -04:00
run = "paste";
2024-01-17 14:40:02 -05:00
desc = "Paste the file(s)";
}
{
on = ["P"];
2024-04-23 12:51:15 -04:00
run = "paste --force";
2024-01-17 14:40:02 -05:00
desc = "Paste the files (overwrite)";
}
{
on = ["d"];
2024-04-23 12:51:15 -04:00
run = "remove --permanently";
2024-01-17 14:40:02 -05:00
desc = "Permanently delete the file(s)";
}
{
on = ["D"];
2024-04-23 12:51:15 -04:00
run = "remove --permanently";
2024-01-17 14:40:02 -05:00
desc = "Permanently delete the files(s)";
}
{
on = ["a"];
2024-04-23 12:51:15 -04:00
run = "create";
2024-01-17 14:40:02 -05:00
desc = "create a file or directory (ends with / for directories)";
}
{
on = ["r"];
2024-04-23 12:51:15 -04:00
run = "rename";
2024-01-17 14:40:02 -05:00
desc = "rename a file or directory";
}
{
on = [":"];
2024-04-23 12:51:15 -04:00
run = "shell --block";
2024-01-17 14:40:02 -05:00
desc = "run a blocking shell command";
}
{
on = ["."];
2024-04-23 12:51:15 -04:00
run = "hidden toggle";
2024-01-17 14:40:02 -05:00
desc = "toggle hidden files";
}
{
on = ["z"];
2024-04-23 12:51:15 -04:00
run = "jump zoxide";
2024-01-17 14:40:02 -05:00
desc = "jump to a directory using zoxide";
}
{
on = ["Z"];
2024-04-23 12:51:15 -04:00
run = "jump fzf";
2024-01-17 14:40:02 -05:00
desc = "reveal files with fzf";
}
# Copy
{
on = ["c" "c"];
2024-04-23 12:51:15 -04:00
run = "copy path";
2024-01-17 14:40:02 -05:00
desc = "copy the absolute path";
}
{
on = ["c" "d"];
2024-04-23 12:51:15 -04:00
run = "copy dirname";
2024-01-17 14:40:02 -05:00
desc = "copy parent directory path";
}
{
on = ["c" "f"];
2024-04-23 12:51:15 -04:00
run = "copy filename";
2024-01-17 14:40:02 -05:00
desc = "copy file name";
}
# Find
{
on = ["/"];
2024-04-23 12:51:15 -04:00
run = "find";
2024-01-17 14:40:02 -05:00
}
{
on = ["?"];
2024-04-23 12:51:15 -04:00
run = "find --previous";
2024-01-17 14:40:02 -05:00
}
{
on = ["n"];
2024-04-23 12:51:15 -04:00
run = "find_arrow";
2024-01-17 14:40:02 -05:00
}
{
on = ["N"];
2024-04-23 12:51:15 -04:00
run = "find_arrow --previous";
2024-01-17 14:40:02 -05:00
}
{
on = ["s"];
2024-04-23 12:51:15 -04:00
run = "search fd";
2024-01-17 14:40:02 -05:00
}
{
on = ["S"];
2024-04-23 12:51:15 -04:00
run = "search rg";
2024-01-17 14:40:02 -05:00
}
{
on = ["<C-s>"];
2024-04-23 12:51:15 -04:00
run = "search none";
2024-01-17 14:40:02 -05:00
}
# Tabs
{
on = ["t"];
2024-04-23 12:51:15 -04:00
run = "tab_create --current";
2024-01-17 14:40:02 -05:00
desc = "Create a new tab using the current path";
}
{
on = ["1"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 0";
2024-01-17 14:40:02 -05:00
desc = "Switch to the first tab";
}
{
on = ["2"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 1";
2024-01-17 14:40:02 -05:00
desc = "Switch to the second tab";
}
{
on = ["3"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 2";
2024-01-17 14:40:02 -05:00
desc = "Switch to the third tab";
}
{
on = ["4"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 3";
2024-01-17 14:40:02 -05:00
desc = "Switch to the fourth tab";
}
{
on = ["5"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 4";
2024-01-17 14:40:02 -05:00
desc = "Switch to the fifth tab";
}
{
on = ["6"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 5";
2024-01-17 14:40:02 -05:00
desc = "Switch to the sixth tab";
}
{
on = ["7"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 6";
2024-01-17 14:40:02 -05:00
desc = "Switch to the seventh tab";
}
{
on = ["8"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 7";
2024-01-17 14:40:02 -05:00
desc = "Switch to the eighth tab";
}
{
on = ["9"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 8";
2024-01-17 14:40:02 -05:00
desc = "Switch to the ninth tab";
}
{
on = ["["];
2024-04-23 12:51:15 -04:00
run = "tab_switch -1 --relative";
2024-01-17 14:40:02 -05:00
desc = "Switch to the previous tab";
}
{
on = ["]"];
2024-04-23 12:51:15 -04:00
run = "tab_switch 1 --relative";
2024-01-17 14:40:02 -05:00
desc = "Switch to the next tab";
}
{
on = ["{"];
2024-04-23 12:51:15 -04:00
run = "tab_swap -1";
2024-01-17 14:40:02 -05:00
desc = "Swap the current tab with the previous tab";
}
{
on = ["}"];
2024-04-23 12:51:15 -04:00
run = "tab_swap 1";
2024-01-17 14:40:02 -05:00
desc = "Swap the current tab with the next tab";
}
# Tasks
{
on = ["w"];
2024-04-23 12:51:15 -04:00
run = "tasks_show";
2024-01-17 14:40:02 -05:00
desc = "Show the tasks manager";
}
# Help
{
on = ["~"];
2024-04-23 12:51:15 -04:00
run = "help";
2024-01-17 14:40:02 -05:00
desc = "Open help";
}
];
};
}