dots/configs/yazi/keymap.toml
2025-09-01 12:17:39 -04:00

53 lines
3.1 KiB
TOML

# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
"$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
[mgr]
prepend_keymap = [
{ on = ["<Esc>"], run = "escape --all", desc = "Exit visual mode, clear selected, or cancel search" },
# Navigation
{ on = ["h"], run = ["leave", "escape --visual --select"], desc = "Go back to the parent directory" },
# { on = ["l"], run = ["enter", "escape --visual --select"], desc = "Enter the child directory" },
{ on = ["l"], run = "plugin smart-enter", desc = "Enter the child directory, or open the file" },
{ on = ["<Left>"], run = ["leave", "escape --visual --select"], desc = "Go back to the parent directory" },
{ on = ["<Right>"], run = ["enter", "escape --visual --select"], desc = "Enter the child directory" },
# Operation
{ on = ["r"], run = "rename --empty=stem --cursor=start", desc = "Rename a file or directory" },
{ on = ["R"], run = "rename --cursor=end", desc = "Rename a file or directory (keeping the current filename)" },
# Copy
{ on = ["c", "c"], run = "copy path", desc = "Copy the absolute path" },
{ on = ["c", "d"], run = "copy dirname", desc = "Copy the path of the parent directory" },
{ on = ["c", "f"], run = "copy filename", desc = "Copy the name of the file" },
{ on = ["c", "n"], run = "copy name_without_ext", desc = "Copy the name of the file without the extension" },
{ on = ["c", "r"], run = "plugin rsync", desc = "Copy files using rsync" },
# Goto
{ on = ["g", "h"], run = "cd ~", desc = "Go home" },
{ on = ["g", "c"], run = "cd ~/.config", desc = "Goto ~/.config" },
{ on = ["g", "d"], run = "cd ~/Downloads", desc = "Goto ~/Downloads" },
{ on = ["g", "<Space>"], run = "cd --interactive", desc = "Jump interactively" },
# Goto
{ on = ["g", "h"], run = "cd ~", desc = "Go to the home directory" },
{ on = ["g", "c"], run = "cd ~/.config", desc = "Go to the config directory" },
{ on = ["g", "d"], run = "cd ~/Downloads", desc = "Go to the downloads directory" },
{ on = ["g", "t"], run = "cd /tmp", desc = "Go to the temporary directory" },
{ on = ["g", "r"], run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'", desc = "Go to git root" },
{ on = ["g", "<Space>"], run = "cd --interactive", desc = "Go to a directory interactively" },
{ on = ["<C-x>", "j"], run = "shell 'ya pub-to 0 TransferDownload --list \"$@\"'", desc = "Download with transfer.nvim" },
{ on = ["<C-x>", "k"], run = "shell 'ya pub-to 0 TransferUpload --list \"$@\"'", desc = "Upload with transfer.nvim" },
{ on = ["<C-x>", "d"], run = ["shell 'ya pub-to 0 DiffRemote --orphan --list \"$@\"'", "quit"], desc = "Diff with transfer.nvim" },
{ on = ["<C-x>", "<S-D>"], run = ["shell 'ya pub-to 0 TransferDirDiff --list \"$@\"'"], desc = "Diff directory with transfer.nvim" },
]
[input]
prepend_keymap = [{ on = ["<Esc>"], run = "close", desc = "Go back the normal mode, or cancel input" }]
[help]
prepend_keymap = [{ on = "q", run = "escape", desc = "Clear the filter, or hide the help" }]