From ac9881b7f83ba7b72e01a6fe8e37bf68509b986d Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Tue, 23 Jul 2024 09:47:17 +0200 Subject: [PATCH] Basic configuration for Yazi file manager --- fish/.config/fish/functions/yazi.fish | 8 + yazi/dot-config/yazi/flavors/.gitkeep | 0 yazi/dot-config/yazi/keymap.toml | 309 +++++++++++++++++++++++ yazi/dot-config/yazi/plugins/.gitkeep | 0 yazi/dot-config/yazi/theme.toml | 343 ++++++++++++++++++++++++++ yazi/dot-config/yazi/yazi.toml | 212 ++++++++++++++++ 6 files changed, 872 insertions(+) create mode 100644 fish/.config/fish/functions/yazi.fish create mode 100644 yazi/dot-config/yazi/flavors/.gitkeep create mode 100644 yazi/dot-config/yazi/keymap.toml create mode 100644 yazi/dot-config/yazi/plugins/.gitkeep create mode 100644 yazi/dot-config/yazi/theme.toml create mode 100644 yazi/dot-config/yazi/yazi.toml diff --git a/fish/.config/fish/functions/yazi.fish b/fish/.config/fish/functions/yazi.fish new file mode 100644 index 0000000..4f47c66 --- /dev/null +++ b/fish/.config/fish/functions/yazi.fish @@ -0,0 +1,8 @@ +function yy + set tmp (mktemp -t "yazi-cwd.XXXXXX") + yazi $argv --cwd-file="$tmp" + if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] + cd -- "$cwd" + end + rm -f -- "$tmp" +end diff --git a/yazi/dot-config/yazi/flavors/.gitkeep b/yazi/dot-config/yazi/flavors/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/yazi/dot-config/yazi/keymap.toml b/yazi/dot-config/yazi/keymap.toml new file mode 100644 index 0000000..0ab02b9 --- /dev/null +++ b/yazi/dot-config/yazi/keymap.toml @@ -0,0 +1,309 @@ +# 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" + +[manager] + +keymap = [ + { on = [ "" ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search" }, + { on = [ "" ], 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" }, + { on = [ "" ], run = "close", desc = "Close the current tab, or quit if it is last tab" }, + { on = [ "" ], run = "suspend", desc = "Suspend the process" }, + + # 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 = [ "" ], run = "arrow -5", desc = "Move cursor up 5 lines" }, + { on = [ "" ], run = "arrow 5", desc = "Move cursor down 5 lines" }, + + { 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 = [ "h" ], run = "leave", desc = "Go back to the parent directory" }, + { on = [ "l" ], run = "enter", 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 = [ "" ], run = "seek -5", desc = "Seek up 5 units in the preview" }, + { on = [ "" ], run = "seek 5", desc = "Seek down 5 units in the preview" }, + { on = [ "" ], run = "seek -5", desc = "Seek up 5 units in the preview" }, + { on = [ "" ], run = "seek 5", desc = "Seek down 5 units in the preview" }, + + { on = [ "" ], run = "arrow -1", desc = "Move cursor up" }, + { on = [ "" ], run = "arrow 1", desc = "Move cursor down" }, + { on = [ "" ], run = "leave", desc = "Go back to the parent directory" }, + { on = [ "" ], run = "enter", desc = "Enter the child directory" }, + + { on = [ "g", "g" ], run = "arrow -99999999", desc = "Move cursor to the top" }, + { on = [ "G" ], run = "arrow 99999999", desc = "Move cursor to the bottom" }, + + # Selection + { on = [ "" ], run = [ "select --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 = [ "" ], 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", desc = "Copy the selected files" }, + { on = [ "Y" ], run = "unyank", desc = "Cancel the yank status of files" }, + { on = [ "x" ], run = "yank --cut", desc = "Cut the selected files" }, + { on = [ "X" ], run = "unyank", desc = "Cancel the yank status of 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", desc = "Move the files to the trash" }, + { on = [ "D" ], run = "remove --permanently", 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", desc = "Run a shell command" }, + { on = [ ":" ], run = "shell --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" }, + + # 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" }, + + # 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 modified --dir-first", desc = "Sort by modified time" }, + { on = [ ",", "M" ], run = "sort modified --reverse --dir-first", desc = "Sort by modified time (reverse)" }, + { on = [ ",", "c" ], run = "sort created --dir-first", desc = "Sort by created time" }, + { on = [ ",", "C" ], run = "sort created --reverse --dir-first", desc = "Sort by created time (reverse)" }, + { on = [ ",", "e" ], run = "sort extension --dir-first", desc = "Sort by extension" }, + { on = [ ",", "E" ], run = "sort extension --reverse --dir-first", desc = "Sort by extension (reverse)" }, + { on = [ ",", "a" ], run = "sort alphabetical --dir-first", desc = "Sort alphabetically" }, + { on = [ ",", "A" ], run = "sort alphabetical --reverse --dir-first", desc = "Sort alphabetically (reverse)" }, + { on = [ ",", "n" ], run = "sort natural --dir-first", desc = "Sort naturally" }, + { on = [ ",", "N" ], run = "sort natural --reverse --dir-first", desc = "Sort naturally (reverse)" }, + { on = [ ",", "s" ], run = "sort size --dir-first", desc = "Sort by size" }, + { on = [ ",", "S" ], run = "sort size --reverse --dir-first", 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 = [ "[" ], 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" }, + + # 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" }, + + # 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 = [ "" ], 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" } +] + +[select] + +keymap = [ + { on = [ "" ], run = "close", desc = "Cancel selection" }, + { 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 = "escape", desc = "Go back the normal mode, or cancel input" }, + { on = [ "" ], run = "escape", 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" }, + + # 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" }, + + # 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" }, + + # 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" }, + + # 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" } +] + +[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 = "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 = [ "" ], 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" }, + + { 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" }, + + # Filtering + { on = [ "/" ], run = "filter", desc = "Apply a filter for the help items" }, +] diff --git a/yazi/dot-config/yazi/plugins/.gitkeep b/yazi/dot-config/yazi/plugins/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/yazi/dot-config/yazi/theme.toml b/yazi/dot-config/yazi/theme.toml new file mode 100644 index 0000000..b1eb01c --- /dev/null +++ b/yazi/dot-config/yazi/theme.toml @@ -0,0 +1,343 @@ +# 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/theme.json" + +# vim:fileencoding=utf-8:foldmethod=marker + +# : Flavor {{{ + +[flavor] +use = "" + +# : }}} + +# : Manager {{{ + +[manager] +cwd = { fg = "cyan" } + +# Hovered +hovered = { reversed = true } +preview_hovered = { underline = true } + +# Find +find_keyword = { fg = "yellow", bold = true, italic = true, underline = true } +find_position = { fg = "magenta", bg = "reset", bold = true, italic = true } + +# Marker +marker_copied = { fg = "lightgreen", bg = "lightgreen" } +marker_cut = { fg = "lightred", bg = "lightred" } +marker_marked = { fg = "lightcyan", bg = "lightcyan" } +marker_selected = { fg = "lightyellow", bg = "lightyellow" } + +# Tab +tab_active = { reversed = true } +tab_inactive = {} +tab_width = 1 + +# Count +count_copied = { fg = "white", bg = "green" } +count_cut = { fg = "white", bg = "red" } +count_selected = { fg = "white", bg = "yellow" } + +# Border +border_symbol = "│" +border_style = { fg = "gray" } + +# Highlighting +syntect_theme = "" + +# : }}} + + +# : Status {{{ + +[status] +separator_open = "" +separator_close = "" +separator_style = { fg = "gray", bg = "gray" } + +# Mode +mode_normal = { bg = "blue", bold = true } +mode_select = { bg = "red", bold = true } +mode_unset = { bg = "red", bold = true } + +# Progress +progress_label = { bold = true } +progress_normal = { fg = "blue", bg = "black" } +progress_error = { fg = "red", bg = "black" } + +# Permissions +permissions_t = { fg = "green" } +permissions_r = { fg = "yellow" } +permissions_w = { fg = "red" } +permissions_x = { fg = "cyan" } +permissions_s = { fg = "darkgray" } + +# : }}} + + +# : Select {{{ + +[select] +border = { fg = "blue" } +active = { fg = "magenta", bold = true } +inactive = {} + +# : }}} + + +# : Input {{{ + +[input] +border = { fg = "blue" } +title = {} +value = {} +selected = { reversed = true } + +# : }}} + + +# : Completion {{{ + +[completion] +border = { fg = "blue" } +active = { reversed = true } +inactive = {} + +# Icons +icon_file = "" +icon_folder = "" +icon_command = "" + +# : }}} + + +# : Tasks {{{ + +[tasks] +border = { fg = "blue" } +title = {} +hovered = { fg = "magenta", underline = true } + +# : }}} + + +# : Which {{{ + +[which] +cols = 3 +mask = { bg = "black" } +cand = { fg = "lightcyan" } +rest = { fg = "darkgray" } +desc = { fg = "lightmagenta" } +separator = "  " +separator_style = { fg = "darkgray" } + +# : }}} + + +# : Help {{{ + +[help] +on = { fg = "cyan" } +run = { fg = "magenta" } +desc = {} +hovered = { reversed = true, bold = true } +footer = { fg = "black", bg = "white" } + +# : }}} + + +# : Notify {{{ + +[notify] +title_info = { fg = "green" } +title_warn = { fg = "yellow" } +title_error = { fg = "red" } + +# Icons +icon_info = "" +icon_warn = "" +icon_error = "" + +# : }}} + + +# : File-specific styles {{{ + +[filetype] + +rules = [ + # Images + { mime = "image/*", fg = "cyan" }, + + # Media + { mime = "{audio,video}/*", fg = "yellow" }, + + # Archives + { mime = "application/*zip", fg = "magenta" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "magenta" }, + + # Documents + { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "green" }, + + # Fallback + # { name = "*", fg = "white" }, + { name = "*/", fg = "blue" } +] + +[icon] + +rules = [ + # Programming + { name = "*.c" , text = "", fg = "#599eff" }, + { name = "*.cpp" , text = "", fg = "#519aba" }, + { name = "*.class", text = "", fg = "#cc3e44" }, + { name = "*.cs" , text = "󰌛", fg = "#596706" }, + { name = "*.css" , text = "", fg = "#42a5f5" }, + { name = "*.elm" , text = "", fg = "#4391d2" }, + { name = "*.fish" , text = "", fg = "#4d5a5e" }, + { name = "*.go" , text = "", fg = "#519aba" }, + { name = "*.h" , text = "", fg = "#a074c4" }, + { name = "*.hpp" , text = "", fg = "#a074c4" }, + { name = "*.html" , text = "", fg = "#e44d26" }, + { name = "*.jar" , text = "", fg = "#cc3e44" }, + { name = "*.java" , text = "", fg = "#cc3e44" }, + { name = "*.js" , text = "", fg = "#F1F134" }, + { name = "*.jsx" , text = "", fg = "#20c2e3" }, + { name = "*.lua" , text = "", fg = "#51a0cf" }, + { name = "*.nix" , text = "", fg = "#7ebae4" }, + { name = "*.nu" , text = ">", fg = "#3aa675" }, + { name = "*.php" , text = "", fg = "#a074c4" }, + { name = "*.py" , text = "", fg = "#ffbc03" }, + { name = "*.rb" , text = "", fg = "#701516" }, + { name = "*.rs" , text = "", fg = "#dea584" }, + { name = "*.sbt" , text = "", fg = "#4d5a5e" }, + { name = "*.scala", text = "", fg = "#cc463e" }, + { name = "*.scss" , text = "", fg = "#f55385" }, + { name = "*.sh" , text = "", fg = "#4d5a5e" }, + { name = "*.swift", text = "", fg = "#e37933" }, + { name = "*.ts" , text = "", fg = "#519aba" }, + { name = "*.tsx" , text = "", fg = "#1354bf" }, + { name = "*.vim" , text = "", fg = "#019833" }, + { name = "*.vue" , text = "󰡄", fg = "#8dc149" }, + + # Text + { name = "*.conf", text = "", fg = "#6d8086" }, + { name = "*.ini" , text = "", fg = "#6d8086" }, + { name = "*.json", text = "", fg = "#cbcb41" }, + { name = "*.kdl" , text = "", fg = "#6d8086" }, + { name = "*.md" , text = "", fg = "#ffffff" }, + { name = "*.toml", text = "", fg = "#ffffff" }, + { name = "*.txt" , text = "", fg = "#89e051" }, + { name = "*.yaml", text = "", fg = "#6d8086" }, + { name = "*.yml" , text = "", fg = "#6d8086" }, + + # Archives + { name = "*.7z" , text = "" }, + { name = "*.bz2", text = "" }, + { name = "*.gz" , text = "" }, + { name = "*.rar", text = "" }, + { name = "*.tar", text = "" }, + { name = "*.xz" , text = "" }, + { name = "*.zip", text = "" }, + + # Images + { name = "*.HEIC", text = "", fg = "#a074c4" }, + { name = "*.avif", text = "", fg = "#a074c4" }, + { name = "*.bmp" , text = "", fg = "#a074c4" }, + { name = "*.gif" , text = "", fg = "#a074c4" }, + { name = "*.ico" , text = "", fg = "#cbcb41" }, + { name = "*.jpeg", text = "", fg = "#a074c4" }, + { name = "*.jpg" , text = "", fg = "#a074c4" }, + { name = "*.png" , text = "", fg = "#a074c4" }, + { name = "*.svg" , text = "", fg = "#FFB13B" }, + { name = "*.webp", text = "", fg = "#a074c4" }, + + # Movies + { name = "*.avi" , text = "", fg = "#FD971F" }, + { name = "*.mkv" , text = "", fg = "#FD971F" }, + { name = "*.mov" , text = "", fg = "#FD971F" }, + { name = "*.mp4" , text = "", fg = "#FD971F" }, + { name = "*.webm", text = "", fg = "#FD971F" }, + + # Audio + { name = "*.aac" , text = "", fg = "#66D8EF" }, + { name = "*.flac", text = "", fg = "#66D8EF" }, + { name = "*.m4a" , text = "", fg = "#66D8EF" }, + { name = "*.mp3" , text = "", fg = "#66D8EF" }, + { name = "*.ogg" , text = "", fg = "#66D8EF" }, + { name = "*.wav" , text = "", fg = "#66D8EF" }, + + # Documents + { name = "*.csv" , text = "", fg = "#89e051" }, + { name = "*.doc" , text = "", fg = "#185abd" }, + { name = "*.doct", text = "", fg = "#185abd" }, + { name = "*.docx", text = "", fg = "#185abd" }, + { name = "*.dot" , text = "", fg = "#185abd" }, + { name = "*.ods" , text = "", fg = "#207245" }, + { name = "*.ots" , text = "", fg = "#207245" }, + { name = "*.pdf" , text = "", fg = "#b30b00" }, + { name = "*.pom" , text = "", fg = "#cc3e44" }, + { name = "*.pot" , text = "", fg = "#cb4a32" }, + { name = "*.potx", text = "", fg = "#cb4a32" }, + { name = "*.ppm" , text = "", fg = "#a074c4" }, + { name = "*.ppmx", text = "", fg = "#cb4a32" }, + { name = "*.pps" , text = "", fg = "#cb4a32" }, + { name = "*.ppsx", text = "", fg = "#cb4a32" }, + { name = "*.ppt" , text = "", fg = "#cb4a32" }, + { name = "*.pptx", text = "", fg = "#cb4a32" }, + { name = "*.xlc" , text = "", fg = "#207245" }, + { name = "*.xlm" , text = "", fg = "#207245" }, + { name = "*.xls" , text = "", fg = "#207245" }, + { name = "*.xlsm", text = "", fg = "#207245" }, + { name = "*.xlsx", text = "", fg = "#207245" }, + { name = "*.xlt" , text = "", fg = "#207245" }, + + # Lockfiles + { name = "*.lock", text = "", fg = "#bbbbbb" }, + + # Misc + { name = "*.bin", text = "", fg = "#9F0500" }, + { name = "*.exe", text = "", fg = "#9F0500" }, + { name = "*.pkg", text = "", fg = "#9F0500" }, + + # Dotfiles + { name = ".DS_Store" , text = "", fg = "#41535b" }, + { name = ".bashprofile" , text = "", fg = "#89e051" }, + { name = ".bashrc" , text = "", fg = "#89e051" }, + { name = ".gitattributes", text = "", fg = "#41535b" }, + { name = ".gitignore" , text = "", fg = "#41535b" }, + { name = ".gitmodules" , text = "", fg = "#41535b" }, + { name = ".vimrc" , text = "", fg = "#019833" }, + { name = ".zprofile" , text = "", fg = "#89e051" }, + { name = ".zshenv" , text = "", fg = "#89e051" }, + { name = ".zshrc" , text = "", fg = "#89e051" }, + + # Named files + { name = "COPYING" , text = "󰿃", fg = "#cbcb41" }, + { name = "Containerfile", text = "󰡨", fg = "#458ee6" }, + { name = "Dockerfile" , text = "󰡨", fg = "#458ee6" }, + { name = "LICENSE" , text = "󰿃", fg = "#d0bf41" }, + + # Directories + { name = ".config/" , text = "" }, + { name = ".git/" , text = "" }, + { name = "Desktop/" , text = "" }, + { name = "Development/", text = "" }, + { name = "Documents/" , text = "" }, + { name = "Downloads/" , text = "" }, + { name = "Library/" , text = "" }, + { name = "Movies/" , text = "" }, + { name = "Music/" , text = "" }, + { name = "Pictures/" , text = "" }, + { name = "Public/" , text = "" }, + { name = "Videos/" , text = "" }, + + # Default + { name = "*" , text = "" }, + { name = "*/", text = "" }, +] + +# : }}} diff --git a/yazi/dot-config/yazi/yazi.toml b/yazi/dot-config/yazi/yazi.toml new file mode 100644 index 0000000..f260fb1 --- /dev/null +++ b/yazi/dot-config/yazi/yazi.toml @@ -0,0 +1,212 @@ +# 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/yazi.json" + +[manager] +ratio = [1, 4, 3] +sort_by = "natural" +sort_sensitive = false +sort_reverse = false +sort_dir_first = true +linemode = "none" +show_hidden = true +show_symlink = true +scrolloff = 5 + +[preview] +tab_size = 2 +max_width = 600 +max_height = 900 +cache_dir = "" +image_filter = "triangle" +image_quality = 75 +sixel_fraction = 15 +ueberzug_scale = 1 +ueberzug_offset = [0, 0, 0, 0] + +[opener] +edit = [ + { run = '${EDITOR:=nvim} "$@"', desc = "$EDITOR", block = true, for = "unix" }, + { run = 'code "%*"', orphan = true, desc = "code", for = "windows" }, + { run = 'code -w "%*"', block = true, desc = "code (block)", 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 = 'xdg-open "$(dirname "$0")"', desc = "Reveal", for = "linux" }, + { 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 = 'unar "$1"', desc = "Extract here", for = "unix" }, + { run = 'unar "%1"', 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 = [ + { name = "*/", use = [ + "edit", + "open", + "reveal", + ] }, + + { mime = "text/*", use = [ + "edit", + "reveal", + ] }, + { mime = "image/*", use = [ + "open", + "reveal", + ] }, + { mime = "{audio,video}/*", use = [ + "play", + "reveal", + ] }, + { mime = "inode/x-empty", use = [ + "edit", + "reveal", + ] }, + + { mime = "application/*zip", use = [ + "extract", + "reveal", + ] }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = [ + "extract", + "reveal", + ] }, + + { mime = "application/json", use = [ + "edit", + "reveal", + ] }, + { mime = "*/javascript", use = [ + "edit", + "reveal", + ] }, + + { mime = "*", use = [ + "open", + "reveal", + ] }, +] + +[tasks] +micro_workers = 10 +macro_workers = 25 +bizarre_retry = 5 +image_alloc = 536870912 # 512MB +image_bound = [0, 0] +suppress_preload = false + +[plugin] + +preloaders = [ + { name = "*", cond = "!mime", run = "mime", multi = true, prio = "high" }, + # Image + { mime = "image/*", run = "image" }, + # Video + { mime = "video/*", run = "video" }, + # PDF + { mime = "application/pdf", run = "pdf" }, +] +previewers = [ + { name = "*/", run = "folder", sync = true }, + # Code + { mime = "text/*", run = "code" }, + { mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code" }, + # JSON + { mime = "application/json", run = "json" }, + # Image + { mime = "image/vnd.djvu", run = "noop" }, + { mime = "image/*", run = "image" }, + # Video + { mime = "video/*", run = "video" }, + # PDF + { mime = "application/pdf", run = "pdf" }, + # Archive + { mime = "application/*zip", run = "archive" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", run = "archive" }, + # Fallback + { name = "*", run = "file" }, +] + +[input] +# cd +cd_title = "Change directory:" +cd_origin = "top-center" +cd_offset = [0, 2, 50, 3] + +# create +create_title = "Create:" +create_origin = "top-center" +create_offset = [0, 2, 50, 3] + +# rename +rename_title = "Rename:" +rename_origin = "hovered" +rename_offset = [0, 1, 50, 3] + +# trash +trash_title = "Move {n} selected file{s} to trash? (y/N)" +trash_origin = "top-center" +trash_offset = [0, 2, 50, 3] + +# delete +delete_title = "Delete {n} selected file{s} permanently? (y/N)" +delete_origin = "top-center" +delete_offset = [0, 2, 50, 3] + +# filter +filter_title = "Filter:" +filter_origin = "top-center" +filter_offset = [0, 2, 50, 3] + +# find +find_title = ["Find next:", "Find previous:"] +find_origin = "top-center" +find_offset = [0, 2, 50, 3] + +# search +search_title = "Search via {n}:" +search_origin = "top-center" +search_offset = [0, 2, 50, 3] + +# shell +shell_title = ["Shell:", "Shell (block):"] +shell_origin = "top-center" +shell_offset = [0, 2, 50, 3] + +# overwrite +overwrite_title = "Overwrite an existing file? (y/N)" +overwrite_origin = "top-center" +overwrite_offset = [0, 2, 50, 3] + +# quit +quit_title = "{n} task{s} running, sure to quit? (y/N)" +quit_origin = "top-center" +quit_offset = [0, 2, 50, 3] + +[select] +open_title = "Open with:" +open_origin = "hovered" +open_offset = [0, 1, 50, 7] + +[which] +sort_by = "none" +sort_sensitive = false +sort_reverse = false + +[log] +enabled = false + +[headsup]