From 2ea7e04042eec448a4dc520f207a8d331054c14d Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Wed, 11 Jun 2025 20:12:48 +0200 Subject: [PATCH] yazi upgrade --- manjaro.sh | 8 +++++++- yazi/init.lua | 1 + yazi/keymap.toml | 27 +++++++++++++++++++++++---- yazi/yazi.toml | 29 +++++++++++++++++++++++++++-- 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 yazi/init.lua diff --git a/manjaro.sh b/manjaro.sh index 56705f6..470b7cd 100755 --- a/manjaro.sh +++ b/manjaro.sh @@ -116,4 +116,10 @@ sudo wget -O rainbowsmoke.jpg -P /usr/share/backgrounds/ultrawide https://superu # https://vdirsyncer.pimutils.org/en/stable/config.html#google # yazi plugins -ya pack -a 'pirafrank/what-size' +ya pkg add yazi-rs/plugins:chmod +ya pkg add yazi-rs/plugins:git +ya pkg add yazi-rs/plugins:mount +ya pkg add yazi-rs/plugins:piper +ya pkg add yazi-rs/plugins:smart-enter +ya pkg add yazi-rs/plugins:smart-filter +ya pkg add yazi-rs/plugins:toggle-pane diff --git a/yazi/init.lua b/yazi/init.lua new file mode 100644 index 0000000..acfabea --- /dev/null +++ b/yazi/init.lua @@ -0,0 +1 @@ +require("git"):setup() diff --git a/yazi/keymap.toml b/yazi/keymap.toml index 17b8d11..fbbcf7f 100644 --- a/yazi/keymap.toml +++ b/yazi/keymap.toml @@ -1,4 +1,23 @@ -[[manager.prepend_keymap]] -on = "" -run = "plugin what-size" -desc = "Calc size of selection or cwd" +[[mgr.prepend_keymap]] +on = "l" +run = "plugin smart-enter" +desc = "Enter the child directory, or open the file" + +[[mgr.prepend_keymap]] +on = [ "c", "m" ] +run = "plugin chmod" +desc = "Chmod on selected files" + +[[mgr.prepend_keymap]] +on = "F" +run = "plugin smart-filter" +desc = "Smart filter" + +[[mgr.prepend_keymap]] +on = "M" +run = "plugin mount" + +[[mgr.prepend_keymap]] +on = "T" +run = "plugin toggle-pane max-preview" +desc = "Maximize or restore the preview pane" diff --git a/yazi/yazi.toml b/yazi/yazi.toml index 3479a7a..4b0f3f9 100644 --- a/yazi/yazi.toml +++ b/yazi/yazi.toml @@ -1,5 +1,4 @@ -# https://ricoberger.de/cheat-sheets/yazi/ -[manager] +[mgr] linemode = "mtime" show_hidden = true sort_by = "natural" @@ -13,3 +12,29 @@ max_height = 1500 [input] cursor_blink = true + +[[plugin.prepend_fetchers]] +id = "git" +name = "*" +run = "git" + +[[plugin.prepend_fetchers]] +id = "git" +name = "*/" +run = "git" + +[[plugin.prepend_previewers]] +name = "*.tar*" +run = 'piper --format=url -- tar tf "$1"' + +[[plugin.prepend_previewers]] +name = "*.csv" +run = 'piper -- bat -p --color=always "$1"' + +[[plugin.prepend_previewers]] +name = "*.md" +run = 'piper -- CLICOLOR_FORCE=1 glow -w=$w -s=dark "$1"' + +[[plugin.prepend_previewers]] +name = "*/" +run = 'piper -- eza -TL=3 --color=always --icons=always --group-directories-first --no-quotes "$1"'