update yazi config

This commit is contained in:
Alexander Navarro 2025-01-28 14:43:51 -03:00
parent e67f758e35
commit 42735952be
5 changed files with 304 additions and 364 deletions

3
.taplo.toml Normal file
View file

@ -0,0 +1,3 @@
[formatting]
inline_table_expand = false
array_auto_expand = false

View file

@ -66,6 +66,7 @@ keymap = [
{ 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)" },
@ -137,6 +138,7 @@ keymap = [
{ 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" },
# Help
@ -145,44 +147,11 @@ keymap = [
[tasks]
keymap = [
{ on = [ "<Esc>" ], run = "close", desc = "Hide the task manager" },
{ on = [ "<C-q>" ], 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 = [ "<Up>" ], run = "arrow -1", desc = "Move cursor up" },
{ on = [ "<Down>" ], run = "arrow 1", desc = "Move cursor down" },
{ on = [ "<Enter>" ], run = "inspect", desc = "Inspect the task" },
{ on = [ "x" ], run = "cancel", desc = "Cancel the task" },
{ on = [ "~" ], run = "help", desc = "Open help" }
]
keymap = [{ on = ["<Esc>"], run = "close", desc = "Hide the task manager" }, { on = ["<C-q>"], 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 = ["<Up>"], run = "arrow -1", desc = "Move cursor up" }, { on = ["<Down>"], run = "arrow 1", desc = "Move cursor down" }, { on = ["<Enter>"], run = "inspect", desc = "Inspect the task" }, { on = ["x"], run = "cancel", desc = "Cancel the task" }, { on = ["~"], run = "help", desc = "Open help" }]
[pick]
keymap = [
{ on = [ "<C-q>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<Esc>" ], run = "close", desc = "Cancel selection" },
{ on = [ "<Enter>" ], 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 = [ "<Up>" ], run = "arrow -1", desc = "Move cursor up" },
{ on = [ "<Down>" ], run = "arrow 1", desc = "Move cursor down" },
{ on = [ "<S-Up>" ], run = "arrow -5", desc = "Move cursor up 5 lines" },
{ on = [ "<S-Down>" ], run = "arrow 5", desc = "Move cursor down 5 lines" },
{ on = [ "~" ], run = "help", desc = "Open help" }
]
keymap = [{ on = ["<C-q>"], run = "close", desc = "Cancel selection" }, { on = ["<Esc>"], run = "close", desc = "Cancel selection" }, { on = ["<Enter>"], 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 = ["<Up>"], run = "arrow -1", desc = "Move cursor up" }, { on = ["<Down>"], run = "arrow 1", desc = "Move cursor down" }, { on = ["<S-Up>"], run = "arrow -5", desc = "Move cursor up 5 lines" }, { on = ["<S-Down>"], run = "arrow 5", desc = "Move cursor down 5 lines" }, { on = ["~"], run = "help", desc = "Open help" }]
[input]
@ -249,24 +218,12 @@ keymap = [
{ on = ["<C-r>"], run = "redo", desc = "Redo the last operation" },
# Help
{ on = [ "~" ], run = "help", desc = "Open help" }
{ on = ["~"], run = "help", desc = "Open help" },
]
[completion]
keymap = [
{ on = [ "<C-q>" ], run = "close", desc = "Cancel completion" },
{ on = [ "<Tab>" ], run = "close --submit", desc = "Submit the completion" },
{ on = [ "<Enter>" ], run = [ "close --submit", "close_input --submit" ], desc = "Submit the completion and input" },
{ on = [ "<A-k>" ], run = "arrow -1", desc = "Move cursor up" },
{ on = [ "<A-j>" ], run = "arrow 1", desc = "Move cursor down" },
{ on = [ "<Up>" ], run = "arrow -1", desc = "Move cursor up" },
{ on = [ "<Down>" ], run = "arrow 1", desc = "Move cursor down" },
{ on = [ "~" ], run = "help", desc = "Open help" }
]
keymap = [{ on = ["<C-q>"], run = "close", desc = "Cancel completion" }, { on = ["<Tab>"], run = "close --submit", desc = "Submit the completion" }, { on = ["<Enter>"], run = ["close --submit", "close_input --submit"], desc = "Submit the completion and input" }, { on = ["<A-k>"], run = "arrow -1", desc = "Move cursor up" }, { on = ["<A-j>"], run = "arrow 1", desc = "Move cursor down" }, { on = ["<Up>"], run = "arrow -1", desc = "Move cursor up" }, { on = ["<Down>"], run = "arrow 1", desc = "Move cursor down" }, { on = ["~"], run = "help", desc = "Open help" }]
[help]

View file

@ -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" }]

View file

@ -16,39 +16,22 @@ mouse_events = [ "click", "scroll" ]
title_format = "Yazi: {cwd}"
[preview]
tab_size = 2
max_width = 1920
max_height = 1080
cache_dir = ""
image_delay = 0
image_filter = "triangle"
image_quality = 75
max_height = 900
max_width = 600
sixel_fraction = 15
ueberzug_scale = 1
ueberzug_offset = [ 0, 0, 0, 0 ]
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 = [
@ -139,7 +122,7 @@ cd_origin = "top-center"
cd_offset = [0, 2, 50, 3]
# create
create_title = "Create:"
create_title = ["Create:", "Create (dir):"]
create_origin = "hovered"
create_offset = [0, 1, 50, 3]
@ -198,6 +181,3 @@ sort_by = "none"
sort_sensitive = false
sort_reverse = false
sort_translit = false
[log]
enabled = false

View file

@ -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"
}