diff --git a/020_yazi-filemanager.sh b/020_yazi-filemanager.sh index 9f3e87e..02abaaa 100644 --- a/020_yazi-filemanager.sh +++ b/020_yazi-filemanager.sh @@ -101,6 +101,8 @@ Yazi plugins installed: - glow ya pack -a Reledia/glow git clone https://github.com/Reledia/glow.yazi ${YAZI_PLUGINS}/glow.yazi - office ya pkg add macydnah/office git clone https://github.com/macydnah/office.yazi ${YAZI_PLUGINS}/office.yazi - lazygit ya pkg add Lil-Dank/lazygit git clone https://github.com/Lil-Dank/lazygit.yazi ${YAZI_PLUGINS}/lazygit.yazi +- nbpreview ya pkg add AnirudhG07/nbpreview git clone https://github.com/AnirudhG07/nbpreview.yazi.git ${YAZI_PLUGINS}/nbpreview.yazi +- eza ya pkg add ahkohd/eza-preview.yazi git clone https://github.com/ahkohd/eza-preview.yazi ${YAZI_PLUGINS}/eza-preview.yazi Preview and CLI tools: @@ -159,7 +161,8 @@ git clone https://github.com/ndtoan96/ouch.yazi.git "${YAZI_PLUGINS}/ouch.yazi" git clone https://github.com/Reledia/glow.yazi "${YAZI_PLUGINS}/glow.yazi" git clone https://github.com/macydnah/office.yazi "${YAZI_PLUGINS}/office.yazi" git clone https://github.com/Lil-Dank/lazygit.yazi "${YAZI_PLUGINS}/lazygit.yazi" - +git clone https://github.com/AnirudhG07/nbpreview.yazi.git "${YAZI_PLUGINS}/nbpreview.yazi" +git clone https://github.com/ahkohd/eza-preview.yazi "${YAZI_PLUGINS}/eza-preview.yazi" git clone https://github.com/Rolv-Apneseth/starship.yazi "${YAZI_PLUGINS}/starship.yazi" # https://github.com/sxyazi/yazi/tree/shipped/yazi-config/preset @@ -185,9 +188,22 @@ require("zoxide"):setup({ update_db = true, }) +-- require("eza-preview") +require("eza-preview"):setup({ + default_tree = true, + level = 2, + follow_symlinks = true, + all = true, + git_ignore = true, + git_status = false, +}) + require("full-border"):setup { type = ui.Border.ROUNDED, } + +require("httm") + -- Starship prompt require("starship"):setup({ -- Hide flags (such as filter, find and search). This can be beneficial for starship themes @@ -333,6 +349,10 @@ prepend_fetchers = [ url = "*.md" run = 'piper -- CLICOLOR_FORCE=1 /usr/bin/glow -w=$w -s=dark "$1"' +[[plugin.prepend_previewers]] +name = "*.ipynb" +run = 'piper -- nbpreview --no-paging --nerd-font --decorated --no-files --unicode --color --images --color-system=standard --theme=ansi_dark "$1"' + # KRA (Krita) preview - extracts mergedimage.png from the archive [[plugin.prepend_previewers]] url = "*.{kra,KRA}" @@ -368,6 +388,14 @@ run = "office" mime = "application/{*zip,tar,bzip2,7z*,rar,xz,zstd,java-archive}" run = "ouch" +# [[plugin.prepend_previewers]] +# url = "*.ipynb" +# run = "nbpreview" + +[[plugin.prepend_previewers]] +url = "*/" +run = "eza-preview" + # -------------------------------- [preview] @@ -490,15 +518,50 @@ run = 'shell "ripdrag \"$@\"" --confirm' desc = "Drag and Drop" [[mgr.prepend_keymap]] -on = "M" +on = [ "M", "c" ] run = "plugin chmod" desc = "Chmod" +[[mgr.prepend_keymap]] +on = [ "M", "m" ] +run = "plugin httm browse" +desc = "httm: Interactive browse snapshots" + +[[mgr.prepend_keymap]] +on = [ "M", "s" ] +run = "plugin httm select" +desc = "httm: Interactive select files" + +[[mgr.prepend_keymap]] +on = [ "M", "d" ] +run = "plugin httm snapshot" +desc = "httm: Snapshot current dataset" + +[[manager.prepend_keymap]] +on = [ "M", "l" ] +run = "plugin httm mounts" +desc = "httm: List mounts/snapshots" + +[[mgr.prepend_keymap]] +on = [ "g", "d" ] +run = "plugin lazydocker" +desc = "run lazydocker" + [[mgr.prepend_keymap]] on = [ "g", "i" ] run = "plugin lazygit" desc = "run lazygit" +[[mgr.prepend_keymap]] +on = [ "g", "n" ] +run = "plugin nicotine" +desc = "Run Nicotine Git snapshot history (lazygit)" + +[[mgr.prepend_keymap]] +on = [ "g", "z" ] +run = "plugin nicotine --args='--zip'" +desc = "Create compressed Nicotine archive of selection" + # Create new directory with Shift+A [[mgr.prepend_keymap]] on = "A" @@ -511,6 +574,13 @@ for = "unix" run = 'shell "$SHELL" --block' desc = "Open $SHELL here" +[[mgr.prepend_keymap]] +on ="E" +run = "plugin eza-preview" +desc = "Toggle tree/list dir preview" + + + # NOTE: Yazi doesn't have "undo" for file operations (copy/move/rename) # These are real filesystem changes. To cancel ongoing operations: # 1. Press 'w' to open task manager @@ -644,6 +714,8 @@ EOF } conf_print_yazi_desktop | tee "${DEST}/.local/share/applications/yazi.desktop" +update-desktop-database ~/.local/share/applications + xfce4-panel --add=launcher "${DEST}/.local/share/applications/yazi.desktop" # Add an icon @@ -651,3 +723,5 @@ xfce4-panel --add=launcher "${DEST}/.local/share/applications/yazi.desktop" mkdir -p ~/.local/share/icons/hicolor/scalable/apps/ curl -s -L -o "${DEST}/.local/share/icons/hicolor/scalable/apps/yazi.png" \ https://raw.githubusercontent.com/sxyazi/yazi/main/assets/logo.png + +gtk-update-icon-cache "${DEST}/.local/share/icons/hicolor/"