From 42735952be61a2b08be5ad134bd3d4c470cb13e2 Mon Sep 17 00:00:00 2001 From: aleidk Date: Tue, 28 Jan 2025 14:43:51 -0300 Subject: [PATCH] update yazi config --- .taplo.toml | 3 + config/yazi/keymap.toml | 419 +++++++++++++---------------- config/yazi/package.toml | 2 +- config/yazi/yazi.toml | 238 ++++++++-------- config/zsh/functions/functions.zsh | 6 +- 5 files changed, 304 insertions(+), 364 deletions(-) create mode 100644 .taplo.toml diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 0000000..19cac95 --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,3 @@ +[formatting] +inline_table_expand = false +array_auto_expand = false diff --git a/config/yazi/keymap.toml b/config/yazi/keymap.toml index 8b24d00..b537398 100644 --- a/config/yazi/keymap.toml +++ b/config/yazi/keymap.toml @@ -5,289 +5,246 @@ [manager] keymap = [ - { on = [ "" ], run = "escape --all", 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" }, - { on = [ "" ], run = "close", desc = "Close the current tab, or quit if it is last tab" }, - { on = [ "" ], run = "suspend", desc = "Suspend the process" }, + { on = [""], run = "escape --all", 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" }, + { on = [""], run = "close", desc = "Close the current tab, or quit if it is last tab" }, + { on = [""], run = "suspend", desc = "Suspend the process" }, - # Hopping - { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "j" ], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], run = "arrow 1", desc = "Move cursor down" }, + # Hopping + { on = ["k"], run = "arrow -1", desc = "Move cursor up" }, + { on = ["j"], run = "arrow 1", desc = "Move cursor down" }, + { on = [""], run = "arrow -1", desc = "Move cursor up" }, + { on = [""], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "" ], run = "arrow -50%", desc = "Move cursor up half page" }, - { on = [ "" ], run = "arrow 50%", desc = "Move cursor down half page" }, - { on = [ "" ], run = "arrow -100%", desc = "Move cursor up one page" }, - { on = [ "" ], run = "arrow 100%", desc = "Move cursor down one page" }, + { on = [""], run = "arrow -50%", desc = "Move cursor up half page" }, + { on = [""], run = "arrow 50%", desc = "Move cursor down half page" }, + { on = [""], run = "arrow -100%", desc = "Move cursor up one page" }, + { on = [""], run = "arrow 100%", desc = "Move cursor down one page" }, - { on = [ "" ], run = "arrow -50%", desc = "Move cursor up half page" }, - { on = [ "" ], run = "arrow 50%", desc = "Move cursor down half page" }, - { on = [ "" ], run = "arrow -100%", desc = "Move cursor up one page" }, - { on = [ "" ], run = "arrow 100%", desc = "Move cursor down one page" }, + { on = [""], run = "arrow -50%", desc = "Move cursor up half page" }, + { on = [""], run = "arrow 50%", desc = "Move cursor down half page" }, + { on = [""], run = "arrow -100%", desc = "Move cursor up one page" }, + { on = [""], run = "arrow 100%", desc = "Move cursor down one page" }, - { on = [ "g", "g" ], run = "arrow -99999999", desc = "Move cursor to the top" }, - { on = [ "G" ], run = "arrow 99999999", desc = "Move cursor to the bottom" }, + { on = ["g", "g"], run = "arrow -99999999", desc = "Move cursor to the top" }, + { on = ["G"], run = "arrow 99999999", desc = "Move cursor to the bottom" }, - # 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" }, + # 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 = [ "" ], run = [ "leave", "escape --visual --select" ], desc = "Go back to the parent directory" }, - { on = [ "" ], run = [ "enter", "escape --visual --select" ], desc = "Enter the child directory" }, + { on = [""], run = ["leave", "escape --visual --select"], desc = "Go back to the parent directory" }, + { on = [""], run = ["enter", "escape --visual --select"], desc = "Enter the child directory" }, - { on = [ "H" ], run = "back", desc = "Go back to the previous directory" }, - { on = [ "L" ], run = "forward", desc = "Go forward to the next directory" }, + { on = ["H"], run = "back", desc = "Go back to the previous directory" }, + { on = ["L"], run = "forward", desc = "Go forward to the next directory" }, - # Seeking - { 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" }, + # Seeking + { 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 = [ "" ], run = [ "select", "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 = [ "" ], run = "select_all --state=true", desc = "Select all files" }, - { on = [ "" ], run = "select_all --state=none", desc = "Inverse selection of all files" }, + # Selection + { on = [""], run = ["select", "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 = [""], run = "select_all --state=true", desc = "Select all files" }, + { on = [""], run = "select_all --state=none", desc = "Inverse selection of all files" }, - # Operation - { on = [ "o" ], run = "open", desc = "Open the selected files" }, - { on = [ "O" ], run = "open --interactive", desc = "Open the selected files interactively" }, - { on = [ "" ], run = "open", desc = "Open the selected files" }, - { on = [ "" ], run = "open --interactive", desc = "Open the selected files interactively" }, - { on = [ "y" ], run = [ "yank", "escape --visual --select" ], desc = "Copy the selected files" }, - { on = [ "Y" ], run = [ "unyank", "escape --visual --select" ], desc = "Cancel the yank status of files" }, - { on = [ "x" ], run = [ "yank --cut", "escape --visual --select" ], desc = "Cut the selected files" }, - { on = [ "p" ], run = "paste", desc = "Paste the files" }, - { on = [ "P" ], run = "paste --force", desc = "Paste the files (overwrite if the destination exists)" }, - { on = [ "-" ], run = "link", desc = "Symlink the absolute path of files" }, - { on = [ "_" ], run = "link --relative", desc = "Symlink the relative path of files" }, - { on = [ "d" ], run = [ "remove", "escape --visual --select" ], desc = "Move the files to the trash" }, - { on = [ "D" ], run = [ "remove --permanently", "escape --visual --select" ], desc = "Permanently delete the files" }, - { on = [ "a" ], run = "create", desc = "Create a file or directory (ends with / for directories)" }, - { on = [ "r" ], run = "rename --cursor=before_ext", desc = "Rename a file or directory" }, - { on = [ ";" ], run = "shell --interactive", desc = "Run a shell command" }, - { on = [ ":" ], run = "shell --interactive --block", desc = "Run a shell command (block the UI until the command finishes)" }, - { on = [ "." ], run = "hidden toggle", desc = "Toggle the visibility of hidden files" }, - { on = [ "s" ], run = "search fd", desc = "Search files by name using fd" }, - { on = [ "S" ], run = "search rg", desc = "Search files by content using ripgrep" }, - { on = [ "" ], run = "search none", desc = "Cancel the ongoing search" }, - { on = [ "z" ], run = "plugin zoxide", desc = "Jump to a directory using zoxide" }, - { on = [ "Z" ], run = "plugin fzf", desc = "Jump to a directory, or reveal a file using fzf" }, + # Operation + { on = ["o"], run = "open", desc = "Open the selected files" }, + { on = ["O"], run = "open --interactive", desc = "Open the selected files interactively" }, + { on = [""], run = "open", desc = "Open the selected files" }, + { on = [""], run = "open --interactive", desc = "Open the selected files interactively" }, + { on = ["y"], run = ["yank", "escape --visual --select"], desc = "Copy the selected files" }, + { on = ["Y"], run = ["unyank", "escape --visual --select"], desc = "Cancel the yank status of files" }, + { on = ["x"], run = ["yank --cut", "escape --visual --select"], desc = "Cut the selected files" }, + { on = ["p"], run = "paste", desc = "Paste the files" }, + { on = ["P"], run = "paste --force", desc = "Paste the files (overwrite if the destination exists)" }, + { on = ["-"], run = "link", desc = "Symlink the absolute path of files" }, + { on = ["_"], run = "link --relative", desc = "Symlink the relative path of files" }, + { on = ["d"], run = ["remove", "escape --visual --select"], desc = "Move the files to the trash" }, + { on = ["D"], run = ["remove --permanently", "escape --visual --select"], desc = "Permanently delete the files" }, + { on = ["a"], run = "create", desc = "Create a file or directory (ends with / for directories)" }, + { on = ["R"], run = "plugin rsync", desc = "Copy files using rsync" }, + { on = ["r"], run = "rename --cursor=before_ext", desc = "Rename a file or directory" }, + { on = [";"], run = "shell --interactive", desc = "Run a shell command" }, + { on = [":"], run = "shell --interactive --block", desc = "Run a shell command (block the UI until the command finishes)" }, + { on = ["."], run = "hidden toggle", desc = "Toggle the visibility of hidden files" }, + { on = ["s"], run = "search fd", desc = "Search files by name using fd" }, + { on = ["S"], run = "search rg", desc = "Search files by content using ripgrep" }, + { on = [""], run = "search none", desc = "Cancel the ongoing search" }, + { on = ["z"], run = "plugin zoxide", desc = "Jump to a directory using zoxide" }, + { on = ["Z"], run = "plugin fzf", desc = "Jump to a directory, or reveal a file using fzf" }, - # Linemode - { on = [ "m", "s" ], run = "linemode size", desc = "Set linemode to size" }, - { on = [ "m", "p" ], run = "linemode permissions", desc = "Set linemode to permissions" }, - { on = [ "m", "m" ], run = "linemode mtime", desc = "Set linemode to mtime" }, - { on = [ "m", "n" ], run = "linemode none", desc = "Set linemode to none" }, + # Linemode + { on = ["m", "s"], run = "linemode size", desc = "Set linemode to size" }, + { on = ["m", "p"], run = "linemode permissions", desc = "Set linemode to permissions" }, + { on = ["m", "m"], run = "linemode mtime", desc = "Set linemode to mtime" }, + { on = ["m", "n"], run = "linemode none", desc = "Set linemode to none" }, - # 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" }, + # 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" }, - # Filter - { on = [ "f" ], run = "filter --smart", desc = "Filter the files" }, + # Filter + { on = ["f"], run = "filter --smart", desc = "Filter the files" }, - # Find - { on = [ "/" ], run = "find --smart", desc = "Find next file" }, - { on = [ "?" ], run = "find --previous --smart", desc = "Find previous file" }, - { on = [ "n" ], run = "find_arrow", desc = "Go to next found file" }, - { on = [ "N" ], run = "find_arrow --previous", desc = "Go to previous found file" }, + # Find + { on = ["/"], run = "find --smart", desc = "Find next file" }, + { on = ["?"], run = "find --previous --smart", desc = "Find previous file" }, + { on = ["n"], run = "find_arrow", desc = "Go to next found file" }, + { on = ["N"], run = "find_arrow --previous", desc = "Go to previous found file" }, - # Sorting - { on = [ ",", "m" ], run = "sort mtime --reverse=no", desc = "Sort by modified time" }, - { on = [ ",", "M" ], run = "sort mtime --reverse", desc = "Sort by modified time (reverse)" }, - { on = [ ",", "c" ], run = "sort btime --reverse=no", desc = "Sort by created time" }, - { on = [ ",", "C" ], run = "sort btime --reverse", desc = "Sort by created time (reverse)" }, - { on = [ ",", "e" ], run = "sort extension --reverse=no", desc = "Sort by extension" }, - { on = [ ",", "E" ], run = "sort extension --reverse", desc = "Sort by extension (reverse)" }, - { on = [ ",", "a" ], run = "sort alphabetical --reverse=no", desc = "Sort alphabetically" }, - { on = [ ",", "A" ], run = "sort alphabetical --reverse", desc = "Sort alphabetically (reverse)" }, - { on = [ ",", "n" ], run = "sort natural --reverse=no", desc = "Sort naturally" }, - { on = [ ",", "N" ], run = "sort natural --reverse", desc = "Sort naturally (reverse)" }, - { on = [ ",", "s" ], run = "sort size --reverse=no", desc = "Sort by size" }, - { on = [ ",", "S" ], run = "sort size --reverse", desc = "Sort by size (reverse)" }, - # Tabs - { on = [ "t" ], run = "tab_create --current", desc = "Create a new tab using the current path" }, + # Sorting + { on = [",", "m"], run = "sort mtime --reverse=no", desc = "Sort by modified time" }, + { on = [",", "M"], run = "sort mtime --reverse", desc = "Sort by modified time (reverse)" }, + { on = [",", "c"], run = "sort btime --reverse=no", desc = "Sort by created time" }, + { on = [",", "C"], run = "sort btime --reverse", desc = "Sort by created time (reverse)" }, + { on = [",", "e"], run = "sort extension --reverse=no", desc = "Sort by extension" }, + { on = [",", "E"], run = "sort extension --reverse", desc = "Sort by extension (reverse)" }, + { on = [",", "a"], run = "sort alphabetical --reverse=no", desc = "Sort alphabetically" }, + { on = [",", "A"], run = "sort alphabetical --reverse", desc = "Sort alphabetically (reverse)" }, + { on = [",", "n"], run = "sort natural --reverse=no", desc = "Sort naturally" }, + { on = [",", "N"], run = "sort natural --reverse", desc = "Sort naturally (reverse)" }, + { on = [",", "s"], run = "sort size --reverse=no", desc = "Sort by size" }, + { on = [",", "S"], run = "sort size --reverse", desc = "Sort by size (reverse)" }, + # Tabs + { on = ["t"], run = "tab_create --current", desc = "Create a new tab using the current path" }, - { 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" }, - { on = [ "4" ], run = "tab_switch 3", desc = "Switch to the fourth tab" }, - { on = [ "5" ], run = "tab_switch 4", desc = "Switch to the fifth tab" }, - { on = [ "6" ], run = "tab_switch 5", desc = "Switch to the sixth tab" }, - { 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 = ["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" }, + { on = ["4"], run = "tab_switch 3", desc = "Switch to the fourth tab" }, + { on = ["5"], run = "tab_switch 4", desc = "Switch to the fifth tab" }, + { on = ["6"], run = "tab_switch 5", desc = "Switch to the sixth tab" }, + { 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 = [ "[" ], run = "tab_switch -1 --relative", desc = "Switch to the previous tab" }, - { on = [ "]" ], run = "tab_switch 1 --relative", desc = "Switch to the next tab" }, + { on = ["["], run = "tab_switch -1 --relative", desc = "Switch to the previous tab" }, + { on = ["]"], run = "tab_switch 1 --relative", desc = "Switch to the next tab" }, - { on = [ "{" ], run = "tab_swap -1", desc = "Swap the current tab with the previous tab" }, - { on = [ "}" ], run = "tab_swap 1", desc = "Swap the current tab with the next tab" }, + { on = ["{"], run = "tab_swap -1", desc = "Swap the current tab with the previous tab" }, + { on = ["}"], run = "tab_swap 1", desc = "Swap the current tab with the next tab" }, - # Tasks - { on = [ "w" ], run = "tasks_show", desc = "Show the tasks manager" }, + # Tasks + { on = ["w"], run = "tasks_show", desc = "Show the tasks manager" }, - # 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", "" ], run = "cd --interactive", desc = "Go to a directory 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", ""], run = "cd --interactive", desc = "Go to a directory interactively" }, - # Help - { on = [ "~" ], run = "help", desc = "Open help" }, + # Help + { on = ["~"], run = "help", desc = "Open help" }, ] [tasks] -keymap = [ - { on = [ "" ], run = "close", desc = "Hide the task manager" }, - { on = [ "" ], run = "close", desc = "Hide the task manager" }, - { on = [ "w" ], run = "close", desc = "Hide the task manager" }, - - { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "j" ], run = "arrow 1", desc = "Move cursor down" }, - - { on = [ "" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], run = "arrow 1", desc = "Move cursor down" }, - - { on = [ "" ], run = "inspect", desc = "Inspect the task" }, - { on = [ "x" ], run = "cancel", desc = "Cancel the task" }, - - { on = [ "~" ], run = "help", desc = "Open help" } -] +keymap = [{ on = [""], run = "close", desc = "Hide the task manager" }, { on = [""], run = "close", desc = "Hide the task manager" }, { on = ["w"], run = "close", desc = "Hide the task manager" }, { on = ["k"], run = "arrow -1", desc = "Move cursor up" }, { on = ["j"], run = "arrow 1", desc = "Move cursor down" }, { on = [""], run = "arrow -1", desc = "Move cursor up" }, { on = [""], run = "arrow 1", desc = "Move cursor down" }, { on = [""], run = "inspect", desc = "Inspect the task" }, { on = ["x"], run = "cancel", desc = "Cancel the task" }, { on = ["~"], run = "help", desc = "Open help" }] [pick] -keymap = [ - { on = [ "" ], run = "close", desc = "Cancel selection" }, - { on = [ "" ], run = "close", desc = "Cancel selection" }, - { on = [ "" ], run = "close --submit", desc = "Submit the selection" }, - - { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "j" ], run = "arrow 1", desc = "Move cursor down" }, - - { on = [ "K" ], run = "arrow -5", desc = "Move cursor up 5 lines" }, - { on = [ "J" ], run = "arrow 5", desc = "Move cursor down 5 lines" }, - - { on = [ "" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], run = "arrow 1", desc = "Move cursor down" }, - - { on = [ "" ], run = "arrow -5", desc = "Move cursor up 5 lines" }, - { on = [ "" ], run = "arrow 5", desc = "Move cursor down 5 lines" }, - - { on = [ "~" ], run = "help", desc = "Open help" } -] +keymap = [{ on = [""], run = "close", desc = "Cancel selection" }, { on = [""], run = "close", desc = "Cancel selection" }, { on = [""], run = "close --submit", desc = "Submit the selection" }, { on = ["k"], run = "arrow -1", desc = "Move cursor up" }, { on = ["j"], run = "arrow 1", desc = "Move cursor down" }, { on = ["K"], run = "arrow -5", desc = "Move cursor up 5 lines" }, { on = ["J"], run = "arrow 5", desc = "Move cursor down 5 lines" }, { on = [""], run = "arrow -1", desc = "Move cursor up" }, { on = [""], run = "arrow 1", desc = "Move cursor down" }, { on = [""], run = "arrow -5", desc = "Move cursor up 5 lines" }, { on = [""], run = "arrow 5", desc = "Move cursor down 5 lines" }, { on = ["~"], run = "help", desc = "Open help" }] [input] keymap = [ - { on = [ "" ], run = "close", desc = "Cancel input" }, - { on = [ "" ], run = "close --submit", desc = "Submit the input" }, - { on = [ "" ], run = "close", desc = "Go back the normal mode, or cancel input" }, + { on = [""], run = "close", desc = "Cancel input" }, + { on = [""], run = "close --submit", desc = "Submit the input" }, + { on = [""], run = "close", desc = "Go back the normal mode, or cancel input" }, - # Mode - { on = [ "i" ], run = "insert", desc = "Enter insert mode" }, - { on = [ "a" ], run = "insert --append", desc = "Enter append mode" }, - { on = [ "I" ], run = [ "move -999", "insert" ], desc = "Move to the BOL, and enter insert mode" }, - { on = [ "A" ], run = [ "move 999", "insert --append" ], desc = "Move to the EOL, and enter append mode" }, - { on = [ "v" ], run = "visual", desc = "Enter visual mode" }, - { on = [ "V" ], run = [ "move -999", "visual", "move 999" ], desc = "Enter visual mode and select all" }, + # Mode + { on = ["i"], run = "insert", desc = "Enter insert mode" }, + { on = ["a"], run = "insert --append", desc = "Enter append mode" }, + { on = ["I"], run = ["move -999", "insert"], desc = "Move to the BOL, and enter insert mode" }, + { on = ["A"], run = ["move 999", "insert --append"], desc = "Move to the EOL, and enter append mode" }, + { on = ["v"], run = "visual", desc = "Enter visual mode" }, + { on = ["V"], run = ["move -999", "visual", "move 999"], desc = "Enter visual mode and select all" }, - # Character-wise movement - { on = [ "h" ], run = "move -1", desc = "Move back a character" }, - { on = [ "l" ], run = "move 1", desc = "Move forward a character" }, - { on = [ "" ], run = "move -1", desc = "Move back a character" }, - { on = [ "" ], run = "move 1", desc = "Move forward a character" }, - { on = [ "" ], run = "move -1", desc = "Move back a character" }, - { on = [ "" ], run = "move 1", desc = "Move forward a character" }, + # Character-wise movement + { on = ["h"], run = "move -1", desc = "Move back a character" }, + { on = ["l"], run = "move 1", desc = "Move forward a character" }, + { on = [""], run = "move -1", desc = "Move back a character" }, + { on = [""], run = "move 1", desc = "Move forward a character" }, + { on = [""], run = "move -1", desc = "Move back a character" }, + { on = [""], run = "move 1", desc = "Move forward a character" }, - # Word-wise movement - { on = [ "b" ], run = "backward", desc = "Move back to the start of the current or previous word" }, - { on = [ "w" ], run = "forward", desc = "Move forward to the start of the next word" }, - { on = [ "e" ], run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" }, - { on = [ "" ], run = "backward", desc = "Move back to the start of the current or previous word" }, - { on = [ "" ], run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" }, + # Word-wise movement + { on = ["b"], run = "backward", desc = "Move back to the start of the current or previous word" }, + { on = ["w"], run = "forward", desc = "Move forward to the start of the next word" }, + { on = ["e"], run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" }, + { on = [""], run = "backward", desc = "Move back to the start of the current or previous word" }, + { on = [""], run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" }, - # Line-wise movement - { on = [ "0" ], run = "move -999", desc = "Move to the BOL" }, - { on = [ "$" ], run = "move 999", desc = "Move to the EOL" }, - { on = [ "" ], run = "move -999", desc = "Move to the BOL" }, - { on = [ "" ], run = "move 999", desc = "Move to the EOL" }, - { on = [ "" ], run = "move -999", desc = "Move to the BOL" }, - { on = [ "" ], run = "move 999", desc = "Move to the EOL" }, + # Line-wise movement + { on = ["0"], run = "move -999", desc = "Move to the BOL" }, + { on = ["$"], run = "move 999", desc = "Move to the EOL" }, + { on = [""], run = "move -999", desc = "Move to the BOL" }, + { on = [""], run = "move 999", desc = "Move to the EOL" }, + { on = [""], run = "move -999", desc = "Move to the BOL" }, + { on = [""], run = "move 999", desc = "Move to the EOL" }, - # Delete - { on = [ "" ], run = "backspace", desc = "Delete the character before the cursor" }, - { on = [ "" ], run = "backspace --under", desc = "Delete the character under the cursor" }, - { on = [ "" ], run = "backspace", desc = "Delete the character before the cursor" }, - { on = [ "" ], run = "backspace --under", desc = "Delete the character under the cursor" }, + # Delete + { on = [""], run = "backspace", desc = "Delete the character before the cursor" }, + { on = [""], run = "backspace --under", desc = "Delete the character under the cursor" }, + { on = [""], run = "backspace", desc = "Delete the character before the cursor" }, + { on = [""], run = "backspace --under", desc = "Delete the character under the cursor" }, - # Kill - { on = [ "" ], run = "kill bol", desc = "Kill backwards to the BOL" }, - { on = [ "" ], run = "kill eol", desc = "Kill forwards to the EOL" }, - { on = [ "" ], run = "kill backward", desc = "Kill backwards to the start of the current word" }, - { on = [ "" ], run = "kill forward", desc = "Kill forwards to the end of the current word" }, + # Kill + { on = [""], run = "kill bol", desc = "Kill backwards to the BOL" }, + { on = [""], run = "kill eol", desc = "Kill forwards to the EOL" }, + { on = [""], run = "kill backward", desc = "Kill backwards to the start of the current word" }, + { on = [""], run = "kill forward", desc = "Kill forwards to the end of the current word" }, - # Cut/Yank/Paste - { on = [ "d" ], run = "delete --cut", desc = "Cut the selected characters" }, - { on = [ "D" ], run = [ "delete --cut", "move 999" ], desc = "Cut until the EOL" }, - { on = [ "c" ], run = "delete --cut --insert", desc = "Cut the selected characters, and enter insert mode" }, - { on = [ "C" ], run = [ "delete --cut --insert", "move 999" ], desc = "Cut until the EOL, and enter insert mode" }, - { on = [ "x" ], run = [ "delete --cut", "move 1 --in-operating" ], desc = "Cut the current character" }, - { on = [ "y" ], run = "yank", desc = "Copy the selected characters" }, - { on = [ "p" ], run = "paste", desc = "Paste the copied characters after the cursor" }, - { on = [ "P" ], run = "paste --before", desc = "Paste the copied characters before the cursor" }, + # Cut/Yank/Paste + { on = ["d"], run = "delete --cut", desc = "Cut the selected characters" }, + { on = ["D"], run = ["delete --cut", "move 999"], desc = "Cut until the EOL" }, + { on = ["c"], run = "delete --cut --insert", desc = "Cut the selected characters, and enter insert mode" }, + { on = ["C"], run = ["delete --cut --insert", "move 999"], desc = "Cut until the EOL, and enter insert mode" }, + { on = ["x"], run = ["delete --cut", "move 1 --in-operating"], desc = "Cut the current character" }, + { on = ["y"], run = "yank", desc = "Copy the selected characters" }, + { on = ["p"], run = "paste", desc = "Paste the copied characters after the cursor" }, + { on = ["P"], run = "paste --before", desc = "Paste the copied characters before the cursor" }, - # Undo/Redo - { on = [ "u" ], run = "undo", desc = "Undo the last operation" }, - { on = [ "" ], run = "redo", desc = "Redo the last operation" }, + # Undo/Redo + { on = ["u"], run = "undo", desc = "Undo the last operation" }, + { on = [""], run = "redo", desc = "Redo the last operation" }, - # Help - { on = [ "~" ], run = "help", desc = "Open help" } + # Help + { on = ["~"], run = "help", desc = "Open help" }, ] [completion] -keymap = [ - { on = [ "" ], run = "close", desc = "Cancel completion" }, - { on = [ "" ], run = "close --submit", desc = "Submit the completion" }, - { on = [ "" ], run = [ "close --submit", "close_input --submit" ], desc = "Submit the completion and input" }, - - { on = [ "" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], run = "arrow 1", desc = "Move cursor down" }, - - { on = [ "" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], run = "arrow 1", desc = "Move cursor down" }, - - { on = [ "~" ], run = "help", desc = "Open help" } -] +keymap = [{ on = [""], run = "close", desc = "Cancel completion" }, { on = [""], run = "close --submit", desc = "Submit the completion" }, { on = [""], run = ["close --submit", "close_input --submit"], desc = "Submit the completion and input" }, { on = [""], run = "arrow -1", desc = "Move cursor up" }, { on = [""], run = "arrow 1", desc = "Move cursor down" }, { on = [""], run = "arrow -1", desc = "Move cursor up" }, { on = [""], run = "arrow 1", desc = "Move cursor down" }, { on = ["~"], run = "help", desc = "Open help" }] [help] keymap = [ - { on = [ "" ], run = "escape", desc = "Clear the filter, or hide the help" }, - { on = [ "q" ], run = "close", desc = "Exit the process" }, - { on = [ "" ], run = "close", desc = "Hide the help" }, + { on = [""], run = "escape", desc = "Clear the filter, or hide the help" }, + { on = ["q"], run = "close", desc = "Exit the process" }, + { on = [""], run = "close", desc = "Hide the help" }, - # Navigation - { on = [ "k" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "j" ], run = "arrow 1", desc = "Move cursor down" }, + # Navigation + { on = ["k"], run = "arrow -1", desc = "Move cursor up" }, + { on = ["j"], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "K" ], run = "arrow -5", desc = "Move cursor up 5 lines" }, - { on = [ "J" ], run = "arrow 5", desc = "Move cursor down 5 lines" }, + { on = ["K"], run = "arrow -5", desc = "Move cursor up 5 lines" }, + { on = ["J"], run = "arrow 5", desc = "Move cursor down 5 lines" }, - { on = [ "" ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ "" ], run = "arrow 1", desc = "Move cursor down" }, + { on = [""], run = "arrow -1", desc = "Move cursor up" }, + { on = [""], run = "arrow 1", desc = "Move cursor down" }, - { on = [ "" ], run = "arrow -5", desc = "Move cursor up 5 lines" }, - { on = [ "" ], run = "arrow 5", desc = "Move cursor down 5 lines" }, + { on = [""], run = "arrow -5", desc = "Move cursor up 5 lines" }, + { on = [""], run = "arrow 5", desc = "Move cursor down 5 lines" }, - # Filtering - { on = [ "/" ], run = "filter", desc = "Apply a filter for the help items" }, + # Filtering + { on = ["/"], run = "filter", desc = "Apply a filter for the help items" }, ] diff --git a/config/yazi/package.toml b/config/yazi/package.toml index eae27af..ad75a40 100644 --- a/config/yazi/package.toml +++ b/config/yazi/package.toml @@ -1,5 +1,5 @@ [plugin] -deps = [{ use = "yazi-rs/plugins:full-border", rev = "4a6edc3" }] +deps = [{ use = "yazi-rs/plugins:full-border", rev = "4a6edc3" }, { use = "GianniBYoung/rsync", rev = "3f431aa" }, { use = "Ape/simple-status", rev = "3ef1447" }] [flavor] deps = [{ use = "yazi-rs/flavors:catppuccin-macchiato", rev = "4a3082f" }] diff --git a/config/yazi/yazi.toml b/config/yazi/yazi.toml index e80d3fe..c5152a1 100644 --- a/config/yazi/yazi.toml +++ b/config/yazi/yazi.toml @@ -3,201 +3,181 @@ "$schema" = "https://yazi-rs.github.io/schemas/yazi.json" [manager] -ratio = [ 1, 3, 4 ] -sort_by = "alphabetical" +ratio = [1, 3, 4] +sort_by = "alphabetical" sort_sensitive = false -sort_reverse = false +sort_reverse = false sort_dir_first = true -linemode = "mtime" -show_hidden = true -show_symlink = true -scrolloff = 5 -mouse_events = [ "click", "scroll" ] -title_format = "Yazi: {cwd}" +linemode = "mtime" +show_hidden = true +show_symlink = true +scrolloff = 5 +mouse_events = ["click", "scroll"] +title_format = "Yazi: {cwd}" [preview] -tab_size = 2 -max_width = 1920 -max_height = 1080 -cache_dir = "" -image_filter = "triangle" -image_quality = 75 -sixel_fraction = 15 -ueberzug_scale = 1 -ueberzug_offset = [ 0, 0, 0, 0 ] +cache_dir = "" +image_delay = 0 +image_filter = "triangle" +image_quality = 75 +max_height = 900 +max_width = 600 +sixel_fraction = 15 +tab_size = 2 +wrap = "no" [opener] -edit = [ - { run = '[ -n "$EDITOR" ] && $EDITOR "$@"', desc = "$EDITOR", block = true, for = "unix" }, - { run = 'code "%*"', orphan = true, for = "windows" }, -] -open = [ - { run = 'xdg-open "$@"', desc = "Open", for = "linux" }, - { run = 'open "$@"', desc = "Open", for = "macos" }, - { run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" } -] -reveal = [ - { run = 'open -R "$1"', desc = "Reveal", for = "macos" }, - { run = 'explorer /select, "%1"', orphan = true, desc = "Reveal", for = "windows" }, - { run = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show EXIF", for = "unix" }, -] -extract = [ - { run = 'ya pub extract --list "$@"', desc = "Extract here", for = "unix" }, - { run = 'ya pub extract --list %*', desc = "Extract here", for = "windows" },] -play = [ - { run = 'mpv "$@"', orphan = true, for = "unix" }, - { run = 'mpv "%1"', orphan = true, for = "windows" }, - { run = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show media info", for = "unix" }, -] +edit = [{ run = '[ -n "$EDITOR" ] && $EDITOR "$@"', desc = "$EDITOR", block = true, for = "unix" }, { run = 'code "%*"', orphan = true, for = "windows" }] +open = [{ run = 'xdg-open "$@"', desc = "Open", for = "linux" }, { run = 'open "$@"', desc = "Open", for = "macos" }, { run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" }] +reveal = [{ run = 'open -R "$1"', desc = "Reveal", for = "macos" }, { run = 'explorer /select, "%1"', orphan = true, desc = "Reveal", for = "windows" }, { run = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show EXIF", for = "unix" }] +extract = [{ run = 'ya pub extract --list "$@"', desc = "Extract here", for = "unix" }, { run = 'ya pub extract --list %*', desc = "Extract here", for = "windows" }] +play = [{ run = 'mpv "$@"', orphan = true, for = "unix" }, { run = 'mpv "%1"', orphan = true, for = "windows" }, { run = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show media info", for = "unix" }] [open] rules = [ - # Folder - { name = "*/", use = [ "edit", "open", "reveal" ] }, + # Folder + { name = "*/", use = ["edit", "open", "reveal"] }, - # Text - { mime = "text/*", use = [ "edit", "reveal" ] }, + # Text + { mime = "text/*", use = ["edit", "reveal"] }, - # Archive - { mime = "application/{,g}zip", use = [ "extract", "reveal" ] }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = [ "extract", "reveal" ] }, + # Archive + { mime = "application/{,g}zip", use = ["extract", "reveal"] }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = ["extract", "reveal"] }, - # Image - { mime = "image/*", use = [ "open", "reveal" ] }, + # Image + { mime = "image/*", use = ["open", "reveal"] }, - # Media - { mime = "{audio,video}/*", use = [ "play", "reveal" ] }, - { mime = "inode/x-empty", use = [ "edit", "reveal" ] }, + # Media + { mime = "{audio,video}/*", use = ["play", "reveal"] }, + { mime = "inode/x-empty", use = ["edit", "reveal"] }, - # JSON - { mime = "application/json", use = [ "edit", "reveal" ] }, - { mime = "*/javascript", use = [ "edit", "reveal" ] }, + # JSON + { mime = "application/json", use = ["edit", "reveal"] }, + { mime = "*/javascript", use = ["edit", "reveal"] }, - # Empty file - { mime = "inode/x-empty", use = [ "edit", "reveal" ] }, + # Empty file + { mime = "inode/x-empty", use = ["edit", "reveal"] }, - # Fallback - { mime = "*", use = [ "open", "reveal" ] }, + # Fallback + { mime = "*", use = ["open", "reveal"] }, ] [tasks] -micro_workers = 10 -macro_workers = 25 -bizarre_retry = 5 -image_alloc = 536870912 # 512MB -image_bound = [ 0, 0 ] +micro_workers = 10 +macro_workers = 25 +bizarre_retry = 5 +image_alloc = 536870912 # 512MB +image_bound = [0, 0] suppress_preload = false [plugin] fetchers = [ - # Mimetype - { id = "mime", name = "*", run = "mime", if = "!mime", prio = "high" }, + # Mimetype + { id = "mime", name = "*", run = "mime", if = "!mime", prio = "high" }, ] preloaders = [ - # example - { mime = "image/{avif,heic,jxl,svg+xml}", run = "magick" }, - { mime = "image/*", run = "image" }, - # Video - { mime = "video/*", run = "video" }, - # PDF - { mime = "application/pdf", run = "pdf" }, - # Font - { mime = "font/*", run = "font" }, - { mime = "application/vnd.ms-opentype", run = "font" }, + # example + { mime = "image/{avif,heic,jxl,svg+xml}", run = "magick" }, + { mime = "image/*", run = "image" }, + # Video + { mime = "video/*", run = "video" }, + # PDF + { mime = "application/pdf", run = "pdf" }, + # Font + { mime = "font/*", run = "font" }, + { mime = "application/vnd.ms-opentype", run = "font" }, ] previewers = [ - { name = "*/", run = "folder", sync = true }, - # Code - { mime = "text/*", run = "code" }, - { mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code" }, - # JSON - { mime = "application/{json,x-ndjson}", run = "json" }, - # Image - { mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" }, - { mime = "image/*", run = "image" }, - # Video - { mime = "video/*", run = "video" }, - # PDF - { mime = "application/pdf", run = "pdf" }, - # Archive - { mime = "application/{,g}zip", run = "archive" }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar,iso9660-image}", run = "archive" }, - # Font - { mime = "font/*", run = "font" }, - { mime = "application/vnd.ms-opentype", run = "font" }, - # Fallback - { name = "*", run = "file" }, + { name = "*/", run = "folder", sync = true }, + # Code + { mime = "text/*", run = "code" }, + { mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code" }, + # JSON + { mime = "application/{json,x-ndjson}", run = "json" }, + # Image + { mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" }, + { mime = "image/*", run = "image" }, + # Video + { mime = "video/*", run = "video" }, + # PDF + { mime = "application/pdf", run = "pdf" }, + # Archive + { mime = "application/{,g}zip", run = "archive" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar,iso9660-image}", run = "archive" }, + # Font + { mime = "font/*", run = "font" }, + { mime = "application/vnd.ms-opentype", run = "font" }, + # Fallback + { name = "*", run = "file" }, ] [input] cursor_blink = false # cd -cd_title = "Change directory:" +cd_title = "Change directory:" cd_origin = "top-center" -cd_offset = [ 0, 2, 50, 3 ] +cd_offset = [0, 2, 50, 3] # create -create_title = "Create:" +create_title = ["Create:", "Create (dir):"] create_origin = "hovered" -create_offset = [ 0, 1, 50, 3 ] +create_offset = [0, 1, 50, 3] # rename -rename_title = "Rename:" +rename_title = "Rename:" rename_origin = "hovered" -rename_offset = [ 0, 1, 50, 3 ] +rename_offset = [0, 1, 50, 3] # trash -trash_title = "Move {n} selected file{s} to trash? (y/N)" -trash_origin = "hovered" -trash_offset = [ 0, 2, 50, 3 ] +trash_title = "Move {n} selected file{s} to trash? (y/N)" +trash_origin = "hovered" +trash_offset = [0, 2, 50, 3] # delete -delete_title = "Delete {n} selected file{s} permanently? (y/N)" -delete_origin = "hovered" -delete_offset = [ 0, 2, 50, 3 ] +delete_title = "Delete {n} selected file{s} permanently? (y/N)" +delete_origin = "hovered" +delete_offset = [0, 2, 50, 3] # filter -filter_title = "Filter:" +filter_title = "Filter:" filter_origin = "hovered" -filter_offset = [ 0, 2, 50, 3 ] +filter_offset = [0, 2, 50, 3] # find -find_title = [ "Find next:", "Find previous:" ] +find_title = ["Find next:", "Find previous:"] find_origin = "hovered" -find_offset = [ 0, 2, 50, 3 ] +find_offset = [0, 2, 50, 3] # search -search_title = "Search via {n}:" +search_title = "Search via {n}:" search_origin = "hovered" -search_offset = [ 0, 2, 50, 3 ] +search_offset = [0, 2, 50, 3] # shell -shell_title = [ "Shell:", "Shell (block):" ] +shell_title = ["Shell:", "Shell (block):"] shell_origin = "center" -shell_offset = [ 0, 2, 50, 3 ] +shell_offset = [0, 2, 50, 3] # overwrite -overwrite_title = "Overwrite an existing file? (y/N)" +overwrite_title = "Overwrite an existing file? (y/N)" overwrite_origin = "center" -overwrite_offset = [ 0, 2, 50, 3 ] +overwrite_offset = [0, 2, 50, 3] # quit -quit_title = "{n} task{s} running, sure to quit? (y/N)" +quit_title = "{n} task{s} running, sure to quit? (y/N)" quit_origin = "center" -quit_offset = [ 0, 2, 50, 3 ] +quit_offset = [0, 2, 50, 3] [pick] -open_title = "Open with:" +open_title = "Open with:" open_origin = "hovered" -open_offset = [ 0, 1, 50, 7 ] +open_offset = [0, 1, 50, 7] [which] -sort_by = "none" +sort_by = "none" sort_sensitive = false -sort_reverse = false -sort_translit = false - -[log] -enabled = false +sort_reverse = false +sort_translit = false diff --git a/config/zsh/functions/functions.zsh b/config/zsh/functions/functions.zsh index 425aa0c..9e03b70 100644 --- a/config/zsh/functions/functions.zsh +++ b/config/zsh/functions/functions.zsh @@ -42,10 +42,10 @@ fzf-jq() { } function yy() { - local tmp="$(mktemp -t "yazi-cwd.XXXXX")" + local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd yazi "$@" --cwd-file="$tmp" - if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then - \cd -- "$cwd" + if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then + builtin cd -- "$cwd" fi rm -f -- "$tmp" }