diff --git a/yazi/.config/yazi/keymap.toml b/yazi/.config/yazi/keymap.toml index 0e4be0d..a0b4595 100755 --- a/yazi/.config/yazi/keymap.toml +++ b/yazi/.config/yazi/keymap.toml @@ -6,172 +6,178 @@ [mgr] # ~/.config/yazi/keymap.toml -### omni-trash ### -[[mgr.prepend_keymap]] -on = "R" -run = "plugin omni-trash" -desc = "Open Omni Trash" - -### lazy git ### -[[mgr.prepend_keymap]] -on = ["g", "i"] -run = "plugin lazygit" -desc = "run lazygit" - -### restore-tab ### -[[mgr.prepend_keymap]] -on = "" -run = "plugin close-and-restore-tab restore" -desc = "Restore the previously closed tab" -[[mgr.prepend_keymap]] -on = "" -run = "close" -desc = "Close the current tab, or quit if it's last" - -### projects ### -[[mgr.prepend_keymap]] -on = ["P", "s"] -run = "plugin projects save" -desc = "Save current project" -[[mgr.prepend_keymap]] -on = ["P", "l"] -run = "plugin projects load" -desc = "Load project" -[[mgr.prepend_keymap]] -on = ["P", "P"] -run = "plugin projects load_last" -desc = "Load last project" -[[mgr.prepend_keymap]] -on = ["P", "d"] -run = "plugin projects delete" -desc = "Delete project" -[[mgr.prepend_keymap]] -on = ["P", "D"] -run = "plugin projects delete_all" -desc = "Delete all projects" -[[mgr.prepend_keymap]] -on = ["P", "m"] -run = "plugin projects 'merge current'" -desc = "Merge current tab to other projects" -[[mgr.prepend_keymap]] -on = ["P", "M"] -run = "plugin projects 'merge all'" -desc = "Merge current project to other projects" - -### yapfg ###l -[[mgr.prepend_keymap]] -on = ["A", "G"] -run = "plugin yafg" - -### lsblk ### -[[mgr.prepend_keymap]] -on = "M" -run = "plugin lsblk-mount" -desc = "Open the drive mount manager" - -### chmod ### -[[mgr.prepend_keymap]] -on = ["C", "m"] -run = "plugin chmod" -desc = "Chmod on selected files" - -### whoosh ### -[[mgr.prepend_keymap]] -on = "[" -run = "plugin whoosh jump_by_key" -desc = "Jump bookmark by key" -# Direct fuzzy search access -[[mgr.prepend_keymap]] -on = "}" -run = "plugin whoosh jump_by_fzf" -desc = "Direct fuzzy search for bookmarks" -# Basic bookmark operations -[[mgr.prepend_keymap]] -on = ["]", "a"] -run = "plugin whoosh save" -desc = "Add bookmark (hovered file/directory)" -[[mgr.prepend_keymap]] -on = ["]", "A"] -run = "plugin whoosh save_cwd" -desc = "Add bookmark (current directory)" -# Temporary bookmarks -[[mgr.prepend_keymap]] -on = ["]", "t"] -run = "plugin whoosh save_temp" -desc = "Add temporary bookmark (hovered file/directory)" -[[mgr.prepend_keymap]] -on = ["]", "T"] -run = "plugin whoosh save_cwd_temp" -desc = "Add temporary bookmark (current directory)" -# Jump to bookmarks -[[mgr.prepend_keymap]] -on = "" -run = "plugin whoosh jump_key_k" -desc = "Jump directly to bookmark with key k" -[[mgr.prepend_keymap]] -on = ["]", "f"] -run = "plugin whoosh jump_by_fzf" -desc = "Jump bookmark by fzf" -# Delete bookmarks -[[mgr.prepend_keymap]] -on = ["]", "d"] -run = "plugin whoosh delete_by_key" -desc = "Delete bookmark by key" -[[mgr.prepend_keymap]] -on = ["]", "D"] -run = "plugin whoosh delete_by_fzf" -desc = "Delete bookmarks by fzf (use TAB to select multiple)" -[[mgr.prepend_keymap]] -on = ["]", "C"] -run = "plugin whoosh delete_all" -desc = "Delete all user bookmarks" -# Rename bookmarks -[[mgr.prepend_keymap]] -on = ["]", "r"] -run = "plugin whoosh rename_by_key" -desc = "Rename bookmark by key" - -[[mgr.prepend_keymap]] -on = ["]", "R"] -run = "plugin whoosh rename_by_fzf" -desc = "Rename bookmark by fzf" - -### eza-preview ### -[[mgr.prepend_keymap]] -on = ["E", "t"] -run = "plugin eza-preview" -desc = "Toggle tree/list dir preview" -[[mgr.prepend_keymap]] -on = ["E", "-"] -run = "plugin eza-preview inc-level" -desc = "Increment tree level" -[[mgr.prepend_keymap]] -on = ["E", "_"] -run = "plugin eza-preview dec-level" -desc = "Decrement tree level" -[[mgr.prepend_keymap]] -on = ["E", "$"] -run = "plugin eza-preview toggle-follow-symlinks" -desc = "Toggle tree follow symlinks" -[[mgr.prepend_keymap]] -on = ["E", "*"] -run = "plugin eza-preview toggle-hidden" -desc = "Toggle hidden files" -[[mgr.prepend_keymap]] -on = ["E", "g", "i"] -run = "plugin eza-preview toggle-git-ignore" -desc = "Toggle .gitignore files" -[[mgr.prepend_keymap]] -on = ["E", "g", "s"] -run = "plugin eza-preview toggle-git-status" -desc = "Toggle showing git status" - -### smart-enter ### -[[mgr.prepend_keymap]] -on = "l" -run = "plugin smart-enter" -desc = "Enter the child directory, or open the file" - +prepend_keymap = [ + ############################################################################### + ### omni-trash ### + ############################################################################### + { on = [ + "R", + ], run = "plugin omni-trash", desc = "Open Omni Trash" }, + ############################################################################### + ### lazy git ### + ############################################################################### + { on = [ + "g", + "i", + ], run = "plugin lazygit", desc = "run lazygit" }, + ############################################################################### + ### restore-tab ### + ############################################################################### + { on = [ + "", + ], run = "plugin close-and-restore-tab restore", desc = "Restore the previously closed tab" }, + { on = [ + "", + ], run = "close", desc = "Close the current tab, or quit if it's last" }, + ############################################################################### + ### projects ### + ############################################################################### + { on = [ + "P", + "s", + ], run = "plugin projects save", desc = "Save current project" }, + { on = [ + "P", + "l", + ], run = "plugin projects load", desc = "Load project" }, + { on = [ + "P", + "P", + ], run = "plugin projects load_last", desc = "Load last project" }, + { on = [ + "P", + "d", + ], run = "plugin projects delete", desc = "Delete project" }, + { on = [ + "P", + "D", + ], run = "plugin projects delete_all", desc = "Delete all projects" }, + { on = [ + "P", + "m", + ], run = "plugin projects 'merge current'", desc = "Merge current tab to other projects" }, + { on = [ + "P", + "M", + ], run = "plugin projects 'merge all'", desc = "Merge current project to other projects" }, + ############################################################################### + ### yapfg ### + ############################################################################### + { on = [ + "A", + "G", + ], run = "plugin yafg" }, + ############################################################################### + ### lsblk ### + ############################################################################### + { on = [ + "M", + ], run = "plugin lsblk-mount", desc = "Open the drive mount manager" }, + ############################################################################### + ### chmod ### + ############################################################################### + { on = [ + "C", + "m", + ], run = "plugin chmod", desc = "Chmod on selected files" }, + ############################################################################### + ### whoosh ### + ############################################################################### + { on = [ + "[", + ], run = "plugin whoosh jump_by_key", desc = "Jump bookmark by key" }, + # Direct fuzzy search access + { on = [ + "}", + ], run = "plugin whoosh jump_by_fzf", desc = "Direct fuzzy search for bookmarks" }, + # Basic bookmark operations + { on = [ + "]", + "a", + ], run = "plugin whoosh save", desc = "Add bookmark (hovered file/directory)" }, + { on = [ + "]", + "A", + ], run = "plugin whoosh save_cwd", desc = "Add bookmark (current directory)" }, + # Temporary bookmarks + { on = [ + "]", + "t", + ], run = "plugin whoosh save_temp", desc = "Add temporary bookmark (hovered file/directory)" }, + { on = [ + "]", + "T", + ], run = "plugin whoosh save_cwd_temp", desc = "Add temporary bookmark (current directory)" }, + # Jump to bookmarks + { on = [ + "", + ], run = "plugin whoosh jump_key_k", desc = "Jump directly to bookmark with key k" }, + { on = [ + "]", + "f", + ], run = "plugin whoosh jump_by_fzf", desc = "Jump bookmark by fzf" }, + # Delete bookmarks + { on = [ + "]", + "d", + ], run = "plugin whoosh delete_by_key", desc = "Delete bookmark by key" }, + { on = [ + "]", + "D", + ], run = "plugin whoosh delete_by_fzf", desc = "Delete bookmarks by fzf (use TAB to select multiple)" }, + { on = [ + "]", + "C", + ], run = "plugin whoosh delete_all", desc = "Delete all user bookmarks" }, + # Rename bookmarks + { on = [ + "]", + "r", + ], run = "plugin whoosh rename_by_key", desc = "Rename bookmark by key" }, + { on = [ + "]", + "R", + ], run = "plugin whoosh rename_by_fzf", desc = "Rename bookmark by fzf" }, + ############################################################################### + ### eza-preview ### + ############################################################################### + { on = [ + "E", + "t", + ], run = "plugin eza-preview", desc = "Toggle tree/list dir preview" }, + { on = [ + "E", + "-", + ], run = "plugin eza-preview inc-level", desc = "Increment tree level" }, + { on = [ + "E", + "_", + ], run = "plugin eza-preview dec-level", desc = "Decrement tree level" }, + { on = [ + "E", + "$", + ], run = "plugin eza-preview toggle-follow-symlinks", desc = "Toggle tree follow symlinks" }, + { on = [ + "E", + "*", + ], run = "plugin eza-preview toggle-hidden", desc = "Toggle hidden files" }, + { on = [ + "E", + "g", + "i", + ], run = "plugin eza-preview toggle-git-ignore", desc = "Toggle .gitignore files" }, + { on = [ + "E", + "g", + "s", + ], run = "plugin eza-preview toggle-git-status", desc = "Toggle showing git status" }, + ############################################################################### + ### smart-enter ### + ############################################################################### + { on = [ + "l", + ], run = "plugin smart-enter", desc = "Enter the child directory, or open the file" }, +] keymap = [ { on = "", run = "escape", desc = "Exit visual mode, clear selection, or cancel search" }, diff --git a/yazi/.config/yazi/yazi.toml b/yazi/.config/yazi/yazi.toml index 19f17a6..c01aba1 100644 --- a/yazi/.config/yazi/yazi.toml +++ b/yazi/.config/yazi/yazi.toml @@ -125,9 +125,10 @@ fetch_workers = 5 preload_workers = 2 process_workers = 5 bizarre_retry = 3 -image_alloc = 536870912 # 512MB +# image_alloc = 536870912 # 512MB image_bound = [10000, 10000] suppress_preload = false +image_alloc = 1073741824 # = 1024*1024*1024 = 1024MB [plugin] fetchers = [ @@ -141,52 +142,16 @@ fetchers = [ # { id = "current-size", name = "*", run = "current-size", prio = "normal" }, ] - -### git ### -[[plugin.prepend_fetchers]] -url = "*" -run = "git" -group = "git" -[[plugin.prepend_fetchers]] -url = "*/" -run = "git" -group = "git" - -### mime-ext ### -[[plugin.prepend_fetchers]] -url = "local://*" -run = "mime-ext.local" -prio = "high" -group = "mime" -[[plugin.prepend_fetchers]] -url = "remote://*" -run = "mime-ext.remote" -prio = "high" -group = "mime" - -### mediainfo ### -prepend_preloaders = [ - # Replace magick, image, video with mediainfo - { mime = "{audio,video,image}/*", run = "mediainfo" }, - # .srt subtitle, adobe illustrator, adobe photoshop file - { mime = "application/{subrip,postscript,illustrator,dvb.ait,vnd.adobe.illustrator,eps}", run = "mediainfo" }, - - # Sometimes AI file is recognized as "application/pdf". Lmao. - # In this case use file extension instead: - { url = "*.{ai,eps,ait}", run = "mediainfo" }, - - # Hide metadata by default. - # Example for image mimetype: - { mime = "{image}/*", run = "mediainfo --no-metadata" }, - - # Hide image preview by default. - # Example for video mimetype: - { mime = "{video}/*", run = "mediainfo --no-preview" }, - - # NOTE: Use both --no-metadata and --no-preview will display nothing. :) - # Make sure both of your previewers and preloaders has the same arguments (--no-metadata and --no-preview) +prepend_fetchers = [ + ### git ### + { url = "*", run = "git", group = "git" }, + { url = "*/", run = "git", group = "git" }, + ### mime-ext ### + { url = "local://*", run = "mime-ext.local", prio = "high", group = "mime" }, + { url = "remote://*", run = "mime-ext.remote", prio = "high", group = "mime" }, ] + spotters = [ # Multi-file { mime = "multi/*", run = "multi" }, @@ -236,49 +201,25 @@ preloaders = [ { mime = "trash/**", run = "trash" }, ] -### exifaudio ### -[[plugin.prepend_previewers]] -mime = "audio/*" -run = "exifaudio" - -### eza-preview ### -[[plugin.prepend_previewers]] -url = "*/" -run = "eza-preview" - -prepend_previewers = [ - ### rich-preview ### - { url = "*.csv", run = "rich-preview" }, # for csv files - { url = "*.md", run = "rich-preview" }, # for markdown (.md) files - { url = "*.rst", run = "rich-preview" }, # for restructured text (.rst) files - { url = "*.ipynb", run = "rich-preview" }, # for jupyter notebooks (.ipynb) - { url = "*.json", run = "rich-preview" }, # for json (.json) files - # { url = "*.lang_type", run = "rich-preview"} # for particular language files eg. .py, .go., .lua, etc. - - # ### eza-preview ### - # { url = "*/", run = "eza-preview" }, - +prepend_preloaders = [ ### mediainfo ### # Replace magick, image, video with mediainfo { mime = "{audio,video,image}/*", run = "mediainfo" }, # .srt subtitle, adobe illustrator, adobe photoshop file { mime = "application/{subrip,postscript,illustrator,dvb.ait,vnd.adobe.illustrator,eps}", run = "mediainfo" }, - # Sometimes AI file is recognized as "application/pdf". Lmao. # In this case use file extension instead: { url = "*.{ai,eps,ait}", run = "mediainfo" }, - # Hide metadata by default. # Example for image mimetype: { mime = "{image}/*", run = "mediainfo --no-metadata" }, - # Hide image preview by default. # Example for video mimetype: { mime = "{video}/*", run = "mediainfo --no-preview" }, - # NOTE: Use both --no-metadata and --no-preview will display nothing. :) # Make sure both of your previewers and preloaders has the same arguments (--no-metadata and --no-preview) ] + previewers = [ { url = "*/", run = "folder" }, # Code @@ -317,6 +258,36 @@ previewers = [ { url = "*", run = "file" }, ] +prepend_previewers = [ + ### rich-preview ### + { url = "*.csv", run = "rich-preview" }, # for csv files + { url = "*.md", run = "rich-preview" }, # for markdown (.md) files + { url = "*.rst", run = "rich-preview" }, # for restructured text (.rst) files + { url = "*.ipynb", run = "rich-preview" }, # for jupyter notebooks (.ipynb) + { url = "*.json", run = "rich-preview" }, # for json (.json) files + # { url = "*.lang_type", run = "rich-preview"} # for particular language files eg. .py, .go., .lua, etc. + ### exifaudio ### + { mime = "audio/*", run = "exifaudio" }, + ### eza-preview ### + { url = "*/", run = "eza-preview" }, + ### mediainfo ### + # Replace magick, image, video with mediainfo + { mime = "{audio,video,image}/*", run = "mediainfo" }, + # .srt subtitle, adobe illustrator, adobe photoshop file + { mime = "application/{subrip,postscript,illustrator,dvb.ait,vnd.adobe.illustrator,eps}", run = "mediainfo" }, + # Sometimes AI file is recognized as "application/pdf". Lmao. + # In this case use file extension instead: + { url = "*.{ai,eps,ait}", run = "mediainfo" }, + # Hide metadata by default. + # Example for image mimetype: + { mime = "{image}/*", run = "mediainfo --no-metadata" }, + # Hide image preview by default. + # Example for video mimetype: + { mime = "{video}/*", run = "mediainfo --no-preview" }, + # NOTE: Use both --no-metadata and --no-preview will display nothing. :) + # Make sure both of your previewers and preloaders has the same arguments (--no-metadata and --no-preview) +] + [input] cursor_blink = false diff --git a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE b/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme b/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme deleted file mode 100644 index 006383b..0000000 --- a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Catppuccin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/README.md b/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/README.md deleted file mode 100644 index 20840dc..0000000 --- a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Catppuccin Mocha Flavor for Yazi -

- -## 👀 Preview - - - -## 🎹 Installation - -```sh -ya pkg add yazi-rs/flavors:catppuccin-mocha -``` - -## ⚙ Usage - -Set the content of your `theme.toml` to enable it as your _dark_ flavor: - -```toml -[flavor] -dark = "catppuccin-mocha" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## 📜 License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/flavor.toml b/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/flavor.toml deleted file mode 100644 index 15de14f..0000000 --- a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/flavor.toml +++ /dev/null @@ -1,187 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#94e2d5" } - -# TODO: remove -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#f9e2af", bold = true, italic = true, underline = true } -find_position = { fg = "#f5c2e7", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#a6e3a1", bg = "#a6e3a1" } -marker_cut = { fg = "#f38ba8", bg = "#f38ba8" } -marker_marked = { fg = "#94e2d5", bg = "#94e2d5" } -marker_selected = { fg = "#f9e2af", bg = "#f9e2af" } - -# Count -count_copied = { fg = "#1e1e2e", bg = "#a6e3a1" } -count_cut = { fg = "#1e1e2e", bg = "#f38ba8" } -count_selected = { fg = "#1e1e2e", bg = "#f9e2af" } - -# Border -border_symbol = "│" -border_style = { fg = "#7f849c" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#1e1e2e", bg = "#89b4fa", bold = true } -inactive = { fg = "#89b4fa", bg = "#313244" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#1e1e2e", bg = "#89b4fa", bold = true } -normal_alt = { fg = "#89b4fa", bg = "#313244" } - -# Select mode -select_main = { fg = "#1e1e2e", bg = "#94e2d5", bold = true } -select_alt = { fg = "#94e2d5", bg = "#313244" } - -# Unset mode -unset_main = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true } -unset_alt = { fg = "#f2cdcd", bg = "#313244" } - -# : }}} - - -# : Status bar {{{ - -[status] -# Permissions -perm_sep = { fg = "#7f849c" } -perm_type = { fg = "#89b4fa" } -perm_read = { fg = "#f9e2af" } -perm_write = { fg = "#f38ba8" } -perm_exec = { fg = "#a6e3a1" } - -# Progress -progress_label = { fg = "#ffffff", bold = true } -progress_normal = { fg = "#a6e3a1", bg = "#45475a" } -progress_error = { fg = "#f9e2af", bg = "#f38ba8" } - -# : }}} - - -# : Pick {{{ - -[pick] -border = { fg = "#89b4fa" } -active = { fg = "#f5c2e7", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#89b4fa" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#89b4fa" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#89b4fa" } -title = {} -hovered = { fg = "#f5c2e7", bold = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#313244" } -cand = { fg = "#94e2d5" } -rest = { fg = "#9399b2" } -desc = { fg = "#f5c2e7" } -separator = " îȘœ " -separator_style = { fg = "#585b70" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#94e2d5" } -run = { fg = "#f5c2e7" } -hovered = { reversed = true, bold = true } -footer = { fg = "#313244", bg = "#cdd6f4" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#89b4fa" } -title = { fg = "#89b4fa" } -tbl_col = { fg = "#94e2d5" } -tbl_cell = { fg = "#f5c2e7", bg = "#45475a" } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#a6e3a1" } -title_warn = { fg = "#f9e2af" } -title_error = { fg = "#f38ba8" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Image - { mime = "image/*", fg = "#94e2d5" }, - # Media - { mime = "{audio,video}/*", fg = "#f9e2af" }, - # Archive - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#f5c2e7" }, - # Document - { mime = "application/{pdf,doc,rtf}", fg = "#a6e3a1" }, - # Virtual file system - { mime = "vfs/{absent,stale}", fg = "#9399b2" }, - # Fallback - { url = "*", fg = "#cdd6f4" }, - { url = "*/", fg = "#89b4fa" }, - # TODO: remove - { name = "*", fg = "#cdd6f4" }, - { name = "*/", fg = "#89b4fa" } -] - -# : }}} diff --git a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/preview.png b/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/preview.png deleted file mode 100644 index a684ec8..0000000 Binary files a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/preview.png and /dev/null differ diff --git a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/tmtheme.xml b/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/tmtheme.xml deleted file mode 100644 index c7781ce..0000000 --- a/yazi_1/.config/yazi/flavors/catppuccin-mocha.yazi/tmtheme.xml +++ /dev/null @@ -1,2112 +0,0 @@ - - - - - name - Catppuccin Mocha - semanticClass - theme.dark.catppuccin-mocha - uuid - 627ce890-fabb-4d39-9819-7be71f4bdca7 - author - Catppuccin Org - colorSpaceName - sRGB - settings - - - settings - - background - #1e1e2e - foreground - #cdd6f4 - caret - #f5e0dc - lineHighlight - #313244 - misspelling - #f38ba8 - accent - #cba6f7 - selection - #9399b240 - activeGuide - #45475a - findHighlight - #3e5767 - gutterForeground - #7f849c - - - - name - Basic text & variable names (incl. leading punctuation) - scope - text, source, variable.other.readwrite, punctuation.definition.variable - settings - - foreground - #cdd6f4 - - - - name - Parentheses, Brackets, Braces - scope - punctuation - settings - - foreground - #9399b2 - fontStyle - - - - - name - Comments - scope - comment, punctuation.definition.comment - settings - - foreground - #9399b2 - fontStyle - italic - - - - scope - string, punctuation.definition.string - settings - - foreground - #a6e3a1 - - - - scope - constant.character.escape - settings - - foreground - #f5c2e7 - - - - name - Booleans, constants, numbers - scope - constant.numeric, variable.other.constant, entity.name.constant, constant.language.boolean, constant.language.false, constant.language.true, keyword.other.unit.user-defined, keyword.other.unit.suffix.floating-point - settings - - foreground - #fab387 - - - - scope - keyword, keyword.operator.word, keyword.operator.new, variable.language.super, support.type.primitive, storage.type, storage.modifier, punctuation.definition.keyword - settings - - foreground - #cba6f7 - fontStyle - - - - - scope - entity.name.tag.documentation - settings - - foreground - #cba6f7 - - - - name - Punctuation - scope - keyword.operator, punctuation.accessor, punctuation.definition.generic, meta.function.closure punctuation.section.parameters, punctuation.definition.tag, punctuation.separator.key-value - settings - - foreground - #94e2d5 - - - - scope - entity.name.function, meta.function-call.method, support.function, support.function.misc, variable.function - settings - - foreground - #89b4fa - fontStyle - italic - - - - name - Classes - scope - entity.name.class, entity.other.inherited-class, support.class, meta.function-call.constructor, entity.name.struct - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Enum - scope - entity.name.enum - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Enum member - scope - meta.enum variable.other.readwrite, variable.other.enummember - settings - - foreground - #94e2d5 - - - - name - Object properties - scope - meta.property.object - settings - - foreground - #94e2d5 - - - - name - Types - scope - meta.type, meta.type-alias, support.type, entity.name.type - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Decorators - scope - meta.annotation variable.function, meta.annotation variable.annotation.function, meta.annotation punctuation.definition.annotation, meta.decorator, punctuation.decorator - settings - - foreground - #fab387 - - - - scope - variable.parameter, meta.function.parameters - settings - - foreground - #eba0ac - fontStyle - italic - - - - name - Built-ins - scope - constant.language, support.function.builtin - settings - - foreground - #f38ba8 - - - - scope - entity.other.attribute-name.documentation - settings - - foreground - #f38ba8 - - - - name - Preprocessor directives - scope - keyword.control.directive, punctuation.definition.directive - settings - - foreground - #f9e2af - - - - name - Type parameters - scope - punctuation.definition.typeparameters - settings - - foreground - #89dceb - - - - name - Namespaces - scope - entity.name.namespace - settings - - foreground - #f9e2af - - - - name - Property names (left hand assignments in json/yaml/css) - scope - support.type.property-name.css - settings - - foreground - #89b4fa - fontStyle - - - - - name - This/Self keyword - scope - variable.language.this, variable.language.this punctuation.definition.variable - settings - - foreground - #f38ba8 - - - - name - Object properties - scope - variable.object.property - settings - - foreground - #cdd6f4 - - - - name - String template interpolation - scope - string.template variable, string variable - settings - - foreground - #cdd6f4 - - - - name - `new` as bold - scope - keyword.operator.new - settings - - fontStyle - bold - - - - name - C++ extern keyword - scope - storage.modifier.specifier.extern.cpp - settings - - foreground - #cba6f7 - - - - name - C++ scope resolution - scope - entity.name.scope-resolution.template.call.cpp, entity.name.scope-resolution.parameter.cpp, entity.name.scope-resolution.cpp, entity.name.scope-resolution.function.definition.cpp - settings - - foreground - #f9e2af - - - - name - C++ doc keywords - scope - storage.type.class.doxygen - settings - - fontStyle - - - - - name - C++ operators - scope - storage.modifier.reference.cpp - settings - - foreground - #94e2d5 - - - - name - C# Interpolated Strings - scope - meta.interpolation.cs - settings - - foreground - #cdd6f4 - - - - name - C# xml-style docs - scope - comment.block.documentation.cs - settings - - foreground - #cdd6f4 - - - - name - Classes, reflecting the className color in JSX - scope - source.css entity.other.attribute-name.class.css, entity.other.attribute-name.parent-selector.css punctuation.definition.entity.css - settings - - foreground - #f9e2af - - - - name - Operators - scope - punctuation.separator.operator.css - settings - - foreground - #94e2d5 - - - - name - Pseudo classes - scope - source.css entity.other.attribute-name.pseudo-class - settings - - foreground - #94e2d5 - - - - scope - source.css constant.other.unicode-range - settings - - foreground - #fab387 - - - - scope - source.css variable.parameter.url - settings - - foreground - #a6e3a1 - fontStyle - - - - - name - CSS vendored property names - scope - support.type.vendored.property-name - settings - - foreground - #89dceb - - - - name - Less/SCSS right-hand variables (@/$-prefixed) - scope - source.css meta.property-value variable, source.css meta.property-value variable.other.less, source.css meta.property-value variable.other.less punctuation.definition.variable.less, meta.definition.variable.scss - settings - - foreground - #eba0ac - - - - name - CSS variables (--prefixed) - scope - source.css meta.property-list variable, meta.property-list variable.other.less, meta.property-list variable.other.less punctuation.definition.variable.less - settings - - foreground - #89b4fa - - - - name - CSS Percentage values, styled the same as numbers - scope - keyword.other.unit.percentage.css - settings - - foreground - #fab387 - - - - name - CSS Attribute selectors, styled the same as strings - scope - source.css meta.attribute-selector - settings - - foreground - #a6e3a1 - - - - name - JSON/YAML keys, other left-hand assignments - scope - keyword.other.definition.ini, punctuation.support.type.property-name.json, support.type.property-name.json, punctuation.support.type.property-name.toml, support.type.property-name.toml, entity.name.tag.yaml, punctuation.support.type.property-name.yaml, support.type.property-name.yaml - settings - - foreground - #89b4fa - fontStyle - - - - - name - JSON/YAML constants - scope - constant.language.json, constant.language.yaml - settings - - foreground - #fab387 - - - - name - YAML anchors - scope - entity.name.type.anchor.yaml, variable.other.alias.yaml - settings - - foreground - #f9e2af - fontStyle - - - - - name - TOML tables / ini groups - scope - support.type.property-name.table, entity.name.section.group-title.ini - settings - - foreground - #f9e2af - - - - name - TOML dates - scope - constant.other.time.datetime.offset.toml - settings - - foreground - #f5c2e7 - - - - name - YAML anchor puctuation - scope - punctuation.definition.anchor.yaml, punctuation.definition.alias.yaml - settings - - foreground - #f5c2e7 - - - - name - YAML triple dashes - scope - entity.other.document.begin.yaml - settings - - foreground - #f5c2e7 - - - - name - Markup Diff - scope - markup.changed.diff - settings - - foreground - #fab387 - - - - name - Diff - scope - meta.diff.header.from-file, meta.diff.header.to-file, punctuation.definition.from-file.diff, punctuation.definition.to-file.diff - settings - - foreground - #89b4fa - - - - name - Diff Inserted - scope - markup.inserted.diff - settings - - foreground - #a6e3a1 - - - - name - Diff Deleted - scope - markup.deleted.diff - settings - - foreground - #f38ba8 - - - - name - dotenv left-hand side assignments - scope - variable.other.env - settings - - foreground - #89b4fa - - - - name - dotenv reference to existing env variable - scope - string.quoted variable.other.env - settings - - foreground - #cdd6f4 - - - - name - GDScript functions - scope - support.function.builtin.gdscript - settings - - foreground - #89b4fa - - - - name - GDScript constants - scope - constant.language.gdscript - settings - - foreground - #fab387 - - - - name - Comment keywords - scope - comment meta.annotation.go - settings - - foreground - #eba0ac - - - - name - go:embed, go:build, etc. - scope - comment meta.annotation.parameters.go - settings - - foreground - #fab387 - - - - name - Go constants (nil, true, false) - scope - constant.language.go - settings - - foreground - #fab387 - - - - name - GraphQL variables - scope - variable.graphql - settings - - foreground - #cdd6f4 - - - - name - GraphQL aliases - scope - string.unquoted.alias.graphql - settings - - foreground - #f2cdcd - - - - name - GraphQL enum members - scope - constant.character.enum.graphql - settings - - foreground - #94e2d5 - - - - name - GraphQL field in types - scope - meta.objectvalues.graphql constant.object.key.graphql string.unquoted.graphql - settings - - foreground - #f2cdcd - - - - name - HTML/XML DOCTYPE as keyword - scope - keyword.other.doctype, meta.tag.sgml.doctype punctuation.definition.tag, meta.tag.metadata.doctype entity.name.tag, meta.tag.metadata.doctype punctuation.definition.tag - settings - - foreground - #cba6f7 - - - - name - HTML/XML-like <tags/> - scope - entity.name.tag - settings - - foreground - #89b4fa - fontStyle - - - - - name - Special characters like &amp; - scope - text.html constant.character.entity, text.html constant.character.entity punctuation, constant.character.entity.xml, constant.character.entity.xml punctuation, constant.character.entity.js.jsx, constant.charactger.entity.js.jsx punctuation, constant.character.entity.tsx, constant.character.entity.tsx punctuation - settings - - foreground - #f38ba8 - - - - name - HTML/XML tag attribute values - scope - entity.other.attribute-name - settings - - foreground - #f9e2af - - - - name - Components - scope - support.class.component, support.class.component.jsx, support.class.component.tsx, support.class.component.vue - settings - - foreground - #f5c2e7 - fontStyle - - - - - name - Annotations - scope - punctuation.definition.annotation, storage.type.annotation - settings - - foreground - #fab387 - - - - name - Java enums - scope - constant.other.enum.java - settings - - foreground - #94e2d5 - - - - name - Java imports - scope - storage.modifier.import.java - settings - - foreground - #cdd6f4 - - - - name - Javadoc - scope - comment.block.javadoc.java keyword.other.documentation.javadoc.java - settings - - fontStyle - - - - - name - Exported Variable - scope - meta.export variable.other.readwrite.js - settings - - foreground - #eba0ac - - - - name - JS/TS constants & properties - scope - variable.other.constant.js, variable.other.constant.ts, variable.other.property.js, variable.other.property.ts - settings - - foreground - #cdd6f4 - - - - name - JSDoc; these are mainly params, so styled as such - scope - variable.other.jsdoc, comment.block.documentation variable.other - settings - - foreground - #eba0ac - fontStyle - - - - - name - JSDoc keywords - scope - storage.type.class.jsdoc - settings - - fontStyle - - - - - scope - support.type.object.console.js - settings - - foreground - #cdd6f4 - - - - name - Node constants as keywords (module, etc.) - scope - support.constant.node, support.type.object.module.js - settings - - foreground - #cba6f7 - - - - name - implements as keyword - scope - storage.modifier.implements - settings - - foreground - #cba6f7 - - - - name - Builtin types - scope - constant.language.null.js, constant.language.null.ts, constant.language.undefined.js, constant.language.undefined.ts, support.type.builtin.ts - settings - - foreground - #cba6f7 - - - - scope - variable.parameter.generic - settings - - foreground - #f9e2af - - - - name - Arrow functions - scope - keyword.declaration.function.arrow.js, storage.type.function.arrow.ts - settings - - foreground - #94e2d5 - - - - name - Decorator punctuations (decorators inherit from blue functions, instead of styleguide peach) - scope - punctuation.decorator.ts - settings - - foreground - #89b4fa - fontStyle - italic - - - - name - Extra JS/TS keywords - scope - keyword.operator.expression.in.js, keyword.operator.expression.in.ts, keyword.operator.expression.infer.ts, keyword.operator.expression.instanceof.js, keyword.operator.expression.instanceof.ts, keyword.operator.expression.is, keyword.operator.expression.keyof.ts, keyword.operator.expression.of.js, keyword.operator.expression.of.ts, keyword.operator.expression.typeof.ts - settings - - foreground - #cba6f7 - - - - name - Julia macros - scope - support.function.macro.julia - settings - - foreground - #94e2d5 - fontStyle - italic - - - - name - Julia language constants (true, false) - scope - constant.language.julia - settings - - foreground - #fab387 - - - - name - Julia other constants (these seem to be arguments inside arrays) - scope - constant.other.symbol.julia - settings - - foreground - #eba0ac - - - - name - LaTeX preamble - scope - text.tex keyword.control.preamble - settings - - foreground - #94e2d5 - - - - name - LaTeX be functions - scope - text.tex support.function.be - settings - - foreground - #89dceb - - - - name - LaTeX math - scope - constant.other.general.math.tex - settings - - foreground - #f2cdcd - - - - name - Liquid Builtin Objects & User Defined Variables - scope - variable.language.liquid - settings - - foreground - #f5c2e7 - - - - name - Lua docstring keywords - scope - comment.line.double-dash.documentation.lua storage.type.annotation.lua - settings - - foreground - #cba6f7 - fontStyle - - - - - name - Lua docstring variables - scope - comment.line.double-dash.documentation.lua entity.name.variable.lua, comment.line.double-dash.documentation.lua variable.lua - settings - - foreground - #cdd6f4 - - - - scope - heading.1.markdown punctuation.definition.heading.markdown, heading.1.markdown, heading.1.quarto punctuation.definition.heading.quarto, heading.1.quarto, markup.heading.atx.1.mdx, markup.heading.atx.1.mdx punctuation.definition.heading.mdx, markup.heading.setext.1.markdown, markup.heading.heading-0.asciidoc - settings - - foreground - #f38ba8 - - - - scope - heading.2.markdown punctuation.definition.heading.markdown, heading.2.markdown, heading.2.quarto punctuation.definition.heading.quarto, heading.2.quarto, markup.heading.atx.2.mdx, markup.heading.atx.2.mdx punctuation.definition.heading.mdx, markup.heading.setext.2.markdown, markup.heading.heading-1.asciidoc - settings - - foreground - #fab387 - - - - scope - heading.3.markdown punctuation.definition.heading.markdown, heading.3.markdown, heading.3.quarto punctuation.definition.heading.quarto, heading.3.quarto, markup.heading.atx.3.mdx, markup.heading.atx.3.mdx punctuation.definition.heading.mdx, markup.heading.heading-2.asciidoc - settings - - foreground - #f9e2af - - - - scope - heading.4.markdown punctuation.definition.heading.markdown, heading.4.markdown, heading.4.quarto punctuation.definition.heading.quarto, heading.4.quarto, markup.heading.atx.4.mdx, markup.heading.atx.4.mdx punctuation.definition.heading.mdx, markup.heading.heading-3.asciidoc - settings - - foreground - #a6e3a1 - - - - scope - heading.5.markdown punctuation.definition.heading.markdown, heading.5.markdown, heading.5.quarto punctuation.definition.heading.quarto, heading.5.quarto, markup.heading.atx.5.mdx, markup.heading.atx.5.mdx punctuation.definition.heading.mdx, markup.heading.heading-4.asciidoc - settings - - foreground - #74c7ec - - - - scope - heading.6.markdown punctuation.definition.heading.markdown, heading.6.markdown, heading.6.quarto punctuation.definition.heading.quarto, heading.6.quarto, markup.heading.atx.6.mdx, markup.heading.atx.6.mdx punctuation.definition.heading.mdx, markup.heading.heading-5.asciidoc - settings - - foreground - #b4befe - - - - scope - markup.bold - settings - - foreground - #f38ba8 - fontStyle - bold - - - - scope - markup.italic - settings - - foreground - #f38ba8 - fontStyle - italic - - - - scope - markup.strikethrough - settings - - foreground - #a6adc8 - fontStyle - strikethrough - - - - name - Markdown auto links - scope - punctuation.definition.link, markup.underline.link - settings - - foreground - #89b4fa - - - - name - Markdown links - scope - text.html.markdown punctuation.definition.link.title, text.html.quarto punctuation.definition.link.title, string.other.link.title.markdown, string.other.link.title.quarto, markup.link, punctuation.definition.constant.markdown, punctuation.definition.constant.quarto, constant.other.reference.link.markdown, constant.other.reference.link.quarto, markup.substitution.attribute-reference - settings - - foreground - #b4befe - - - - name - Markdown code spans - scope - punctuation.definition.raw.markdown, punctuation.definition.raw.quarto, markup.inline.raw.string.markdown, markup.inline.raw.string.quarto, markup.raw.block.markdown, markup.raw.block.quarto - settings - - foreground - #a6e3a1 - - - - name - Markdown triple backtick language identifier - scope - fenced_code.block.language - settings - - foreground - #89dceb - - - - name - Markdown triple backticks - scope - markup.fenced_code.block punctuation.definition, markup.raw support.asciidoc - settings - - foreground - #9399b2 - - - - name - Markdown quotes - scope - markup.quote, punctuation.definition.quote.begin - settings - - foreground - #f5c2e7 - - - - name - Markdown separators - scope - meta.separator.markdown - settings - - foreground - #94e2d5 - - - - name - Markdown list bullets - scope - punctuation.definition.list.begin.markdown, punctuation.definition.list.begin.quarto, markup.list.bullet - settings - - foreground - #94e2d5 - - - - name - Quarto headings - scope - markup.heading.quarto - settings - - fontStyle - bold - - - - name - Nix attribute names - scope - entity.other.attribute-name.multipart.nix, entity.other.attribute-name.single.nix - settings - - foreground - #89b4fa - - - - name - Nix parameter names - scope - variable.parameter.name.nix - settings - - foreground - #cdd6f4 - fontStyle - - - - - name - Nix interpolated parameter names - scope - meta.embedded variable.parameter.name.nix - settings - - foreground - #b4befe - fontStyle - - - - - name - Nix paths - scope - string.unquoted.path.nix - settings - - foreground - #f5c2e7 - fontStyle - - - - - name - PHP Attributes - scope - support.attribute.builtin, meta.attribute.php - settings - - foreground - #f9e2af - - - - name - PHP Parameters (needed for the leading dollar sign) - scope - meta.function.parameters.php punctuation.definition.variable.php - settings - - foreground - #eba0ac - - - - name - PHP Constants (null, __FILE__, etc.) - scope - constant.language.php - settings - - foreground - #cba6f7 - - - - name - PHP functions - scope - text.html.php support.function - settings - - foreground - #89dceb - - - - name - PHPdoc keywords - scope - keyword.other.phpdoc.php - settings - - fontStyle - - - - - name - Python argument functions reset to text, otherwise they inherit blue from function-call - scope - support.variable.magic.python, meta.function-call.arguments.python - settings - - foreground - #cdd6f4 - - - - name - Python double underscore functions - scope - support.function.magic.python - settings - - foreground - #89dceb - fontStyle - italic - - - - name - Python `self` keyword - scope - variable.parameter.function.language.special.self.python, variable.language.special.self.python - settings - - foreground - #f38ba8 - fontStyle - italic - - - - name - python keyword flow/logical (for ... in) - scope - keyword.control.flow.python, keyword.operator.logical.python - settings - - foreground - #cba6f7 - - - - name - python storage type - scope - storage.type.function.python - settings - - foreground - #cba6f7 - - - - name - python function support - scope - support.token.decorator.python, meta.function.decorator.identifier.python - settings - - foreground - #89dceb - - - - name - python function calls - scope - meta.function-call.python - settings - - foreground - #89b4fa - - - - name - python function decorators - scope - entity.name.function.decorator.python, punctuation.definition.decorator.python - settings - - foreground - #fab387 - fontStyle - italic - - - - name - python placeholder reset to normal string - scope - constant.character.format.placeholder.other.python - settings - - foreground - #f5c2e7 - - - - name - Python exception & builtins such as exit() - scope - support.type.exception.python, support.function.builtin.python - settings - - foreground - #fab387 - - - - name - entity.name.type - scope - support.type.python - settings - - foreground - #cba6f7 - - - - name - python constants (True/False) - scope - constant.language.python - settings - - foreground - #fab387 - - - - name - Arguments accessed later in the function body - scope - meta.indexed-name.python, meta.item-access.python - settings - - foreground - #eba0ac - fontStyle - italic - - - - name - Python f-strings/binary/unicode storage types - scope - storage.type.string.python - settings - - foreground - #a6e3a1 - fontStyle - italic - - - - name - Python type hints - scope - meta.function.parameters.python - settings - - fontStyle - - - - - name - Regex string begin/end in JS/TS - scope - string.regexp punctuation.definition.string.begin, string.regexp punctuation.definition.string.end - settings - - foreground - #f5c2e7 - - - - name - Regex anchors (^, $) - scope - keyword.control.anchor.regexp - settings - - foreground - #cba6f7 - - - - name - Regex regular string match - scope - string.regexp.ts - settings - - foreground - #cdd6f4 - - - - name - Regex group parenthesis & backreference (\1, \2, \3, ...) - scope - punctuation.definition.group.regexp, keyword.other.back-reference.regexp - settings - - foreground - #a6e3a1 - - - - name - Regex character class [] - scope - punctuation.definition.character-class.regexp - settings - - foreground - #f9e2af - - - - name - Regex character classes (\d, \w, \s) - scope - constant.other.character-class.regexp - settings - - foreground - #f5c2e7 - - - - name - Regex range - scope - constant.other.character-class.range.regexp - settings - - foreground - #f5e0dc - - - - name - Regex quantifier - scope - keyword.operator.quantifier.regexp - settings - - foreground - #94e2d5 - - - - name - Regex constant/numeric - scope - constant.character.numeric.regexp - settings - - foreground - #fab387 - - - - name - Regex lookaheads, negative lookaheads, lookbehinds, negative lookbehinds - scope - punctuation.definition.group.no-capture.regexp, meta.assertion.look-ahead.regexp, meta.assertion.negative-look-ahead.regexp - settings - - foreground - #89b4fa - - - - name - Rust attribute - scope - meta.annotation.rust, meta.annotation.rust punctuation, meta.attribute.rust, punctuation.definition.attribute.rust - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Rust attribute strings - scope - meta.attribute.rust string.quoted.double.rust, meta.attribute.rust string.quoted.single.char.rust - settings - - fontStyle - - - - - name - Rust keyword - scope - entity.name.function.macro.rules.rust, storage.type.module.rust, storage.modifier.rust, storage.type.struct.rust, storage.type.enum.rust, storage.type.trait.rust, storage.type.union.rust, storage.type.impl.rust, storage.type.rust, storage.type.function.rust, storage.type.type.rust - settings - - foreground - #cba6f7 - fontStyle - - - - - name - Rust u/i32, u/i64, etc. - scope - entity.name.type.numeric.rust - settings - - foreground - #cba6f7 - fontStyle - - - - - name - Rust generic - scope - meta.generic.rust - settings - - foreground - #fab387 - - - - name - Rust impl - scope - entity.name.impl.rust - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Rust module - scope - entity.name.module.rust - settings - - foreground - #fab387 - - - - name - Rust trait - scope - entity.name.trait.rust - settings - - foreground - #f9e2af - fontStyle - italic - - - - name - Rust struct - scope - storage.type.source.rust - settings - - foreground - #f9e2af - - - - name - Rust union - scope - entity.name.union.rust - settings - - foreground - #f9e2af - - - - name - Rust enum member - scope - meta.enum.rust storage.type.source.rust - settings - - foreground - #94e2d5 - - - - name - Rust macro - scope - support.macro.rust, meta.macro.rust support.function.rust, entity.name.function.macro.rust - settings - - foreground - #89b4fa - fontStyle - italic - - - - name - Rust lifetime - scope - storage.modifier.lifetime.rust, entity.name.type.lifetime - settings - - foreground - #89b4fa - fontStyle - italic - - - - name - Rust string formatting - scope - string.quoted.double.rust constant.other.placeholder.rust - settings - - foreground - #f5c2e7 - - - - name - Rust return type generic - scope - meta.function.return-type.rust meta.generic.rust storage.type.rust - settings - - foreground - #cdd6f4 - - - - name - Rust functions - scope - meta.function.call.rust - settings - - foreground - #89b4fa - - - - name - Rust angle brackets - scope - punctuation.brackets.angle.rust - settings - - foreground - #89dceb - - - - name - Rust constants - scope - constant.other.caps.rust - settings - - foreground - #fab387 - - - - name - Rust function parameters - scope - meta.function.definition.rust variable.other.rust - settings - - foreground - #eba0ac - - - - name - Rust closure variables - scope - meta.function.call.rust variable.other.rust - settings - - foreground - #cdd6f4 - - - - name - Rust self - scope - variable.language.self.rust - settings - - foreground - #f38ba8 - - - - name - Rust metavariable names - scope - variable.other.metavariable.name.rust, meta.macro.metavariable.rust keyword.operator.macro.dollar.rust - settings - - foreground - #f5c2e7 - - - - name - Shell shebang - scope - comment.line.shebang, comment.line.shebang punctuation.definition.comment, comment.line.shebang, punctuation.definition.comment.shebang.shell, meta.shebang.shell - settings - - foreground - #f5c2e7 - fontStyle - italic - - - - name - Shell shebang command - scope - comment.line.shebang constant.language - settings - - foreground - #94e2d5 - fontStyle - italic - - - - name - Shell interpolated command - scope - meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation, meta.function-call.arguments.shell punctuation.definition.variable.shell, meta.function-call.arguments.shell punctuation.section.interpolation - settings - - foreground - #f38ba8 - - - - name - Shell interpolated command variable - scope - meta.string meta.interpolation.parameter.shell variable.other.readwrite - settings - - foreground - #fab387 - fontStyle - italic - - - - scope - source.shell punctuation.section.interpolation, punctuation.definition.evaluation.backticks.shell - settings - - foreground - #94e2d5 - - - - name - Shell EOF - scope - entity.name.tag.heredoc.shell - settings - - foreground - #cba6f7 - - - - name - Shell quoted variable - scope - string.quoted.double.shell variable.other.normal.shell - settings - - foreground - #cdd6f4 - - - - scope - markup.heading.typst - settings - - foreground - #f38ba8 - - - - name - JSON Keys - scope - source.json meta.mapping.key string - settings - - foreground - #89b4fa - - - - name - JSON key surrounding quotes - scope - source.json meta.mapping.key punctuation.definition.string.begin, source.json meta.mapping.key punctuation.definition.string.end - settings - - foreground - #9399b2 - - - - scope - markup.heading.synopsis.man, markup.heading.title.man, markup.heading.other.man, markup.heading.env.man - settings - - foreground - #cba6f7 - - - - scope - markup.heading.commands.man - settings - - foreground - #89b4fa - - - - scope - markup.heading.env.man - settings - - foreground - #f5c2e7 - - - - name - Man page options - scope - entity.name - settings - - foreground - #94e2d5 - - - - scope - markup.heading.1.markdown - settings - - foreground - #f38ba8 - - - - scope - markup.heading.2.markdown - settings - - foreground - #fab387 - - - - scope - markup.heading.markdown - settings - - foreground - #f9e2af - - - - - \ No newline at end of file diff --git a/yazi_1/.config/yazi/flavors/dracula.yazi b/yazi_1/.config/yazi/flavors/dracula.yazi deleted file mode 160000 index 1b1a8d1..0000000 --- a/yazi_1/.config/yazi/flavors/dracula.yazi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1b1a8d1083474defa9e4c1c3de4db9576f23175f diff --git a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/LICENSE b/yazi_1/.config/yazi/flavors/everforest-medium.yazi/LICENSE deleted file mode 100644 index 978c8ef..0000000 --- a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Chromium Oxide - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/LICENSE-tmtheme b/yazi_1/.config/yazi/flavors/everforest-medium.yazi/LICENSE-tmtheme deleted file mode 100644 index 020b42d..0000000 --- a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Mitchell Hanberg - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/README.md b/yazi_1/.config/yazi/flavors/everforest-medium.yazi/README.md deleted file mode 100644 index 95029b5..0000000 --- a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/README.md +++ /dev/null @@ -1,45 +0,0 @@ -
- Yazi logo -
- -

- Example Flavor for Yazi -

- -## 👀 Preview - - - -## 🎹 Installation - -```bash -ya pkg add Chromium-3-Oxide/everforest-medium -``` - -Or: - -```bash -ya pack -a Chromium-3-Oxide/everforest-medium -``` - -## ⚙ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "everforest-medium" -``` - -For Yazi versions before 0.4: - -```toml -[flavor] -use = "everforest-medium" -``` - -## 📜 License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/flavor.toml b/yazi_1/.config/yazi/flavors/everforest-medium.yazi/flavor.toml deleted file mode 100644 index 6ba84b7..0000000 --- a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/flavor.toml +++ /dev/null @@ -1,229 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#7fbbb3" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_keyword = { fg = "#dbbc7f", bold = true, italic = true, underline = true } -find_position = { fg = "#d699b6", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# Marker -marker_copied = { fg = "#a7c080", bg = "#a7c080" } -marker_cut = { fg = "#e67e80", bg = "#e67e80" } -marker_marked = { fg = "#7fbbb3", bg = "#7fbbb3" } -marker_selected = { fg = "#dbbc7f", bg = "#dbbc7f" } - -# Count -count_copied = { fg = "#343f44", bg = "#a7c080" } -count_cut = { fg = "#343f44", bg = "#e67e80" } -count_selected = { fg = "#343f44", bg = "#dbbc7f" } - -# Border -border_symbol = "│" -border_style = { fg = "#4f585e" } - -# Highlighting -syntect_theme = "" - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { bg = "#7fbbb3", bold = true } -inactive = { fg = "#7fbbb3", bg = "#4f585e" } - -# Separator -sep_inner = { open = "", close = "" } -sep_outer = { open = "", close = "" } - -# : }}} - - -# : Mode {{{ - -[mode] -normal_main = { fg = "#3d484d", bg = "#a7c080", bold = true } -normal_alt = { fg = "#7fbbb3", bg = "#4f585e", bold = true } - -# Select mode -select_main = { fg = "#3d484d", bg = "#e67e80", bold = true } -select_alt = { fg = "#7fbbb3", bg = "#4f585e", bold = true } - -# Unset mode -unset_main = { fg = "#3d484d", bg = "#7fbbb3", bold = true } -unset_alt = { fg = "#7fbbb3", bg = "#4f585e", bold = true } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = {} -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } - -# Permissions -permissions_s = { fg = "#2d353b" } -permissions_t = { fg = "#a7c080" } -permissions_r = { fg = "#dbbc7f" } -permissions_w = { fg = "#e67e80" } -permissions_x = { fg = "#7fbbb3" } - -# Progress -progress_label = { bold = true } -progress_normal = { fg = "#7fbbb3", bg = "#232a2e" } -progress_error = { fg = "#e67e80", bg = "#232a2e" } - -# : }}} - - -# : Which {{{ - -[which] -cols = 3 -mask = { bg = "#2d353b" } -cand = { fg = "#7fbbb3" } -rest = { fg = "#2d353b" } -desc = { fg = "#d699b6" } -separator = " îȘœ " -separator_style = { fg = "#2d353b" } - -# : }}} - - -# : Confirmation {{{ - -[confirm] -border = { fg = "#7fbbb3" } -title = { fg = "#7fbbb3" } -body = {} -list = {} -btn_yes = { reversed = true } -btn_no = {} -btn_labels = [ " [Y]es ", " (N)o " ] - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#7fbbb3" } -title = { fg = "#7fbbb3" } - -# Table -tbl_col = { fg = "#7fbbb3" } -tbl_cell = { fg = "#dbbc7f", reversed = true } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#a7c080" } -title_warn = { fg = "#dbbc7f" } -title_error = { fg = "#e67e80" } - -# Icons -icon_info = "" -icon_warn = "" -icon_error = "" - -# : }}} - - -# : Picker {{{ - -[pick] -border = { fg = "#7fbbb3" } -active = { fg = "#d699b6", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#7fbbb3" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#7fbbb3" } -active = { reversed = true } -inactive = {} - -# Icons -icon_file = "" -icon_folder = "" -icon_command = "" - -# : }}} - - -# : Task manager {{{ - -[tasks] -border = { fg = "#7fbbb3" } -title = {} -hovered = { fg = "#d699b6", underline = true } - -# : }}} - - -# : Help menu {{{ - -[help] -on = { fg = "#7fbbb3" } -run = { fg = "#d699b6" } -desc = {} -hovered = { reversed = true, bold = true } -footer = { fg = "#2d353b", bg = "#d3c6aa" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#7fbbb3" }, - - # Media - { mime = "{audio,video}/*", fg = "#d699b6" }, - - # Archives - { mime = "application/*zip", fg = "#e67e80" }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#e67e80" }, - - # Documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#7fbbb3" }, - - # Fallback - { name = "*", fg = "#83c092" }, - { name = "*/", fg = "#a7c080" } -] - -# : }}} diff --git a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/preview.png b/yazi_1/.config/yazi/flavors/everforest-medium.yazi/preview.png deleted file mode 100644 index d3960cc..0000000 Binary files a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/preview.png and /dev/null differ diff --git a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/tmtheme.xml b/yazi_1/.config/yazi/flavors/everforest-medium.yazi/tmtheme.xml deleted file mode 100644 index e063c97..0000000 --- a/yazi_1/.config/yazi/flavors/everforest-medium.yazi/tmtheme.xml +++ /dev/null @@ -1,3186 +0,0 @@ - - - - - name - Everforest Dark - settings - - - settings - - accent - #a7c080 - background - #2d353b - caret - #d3c6aa - foreground - #d3c6aa - lineHighlight - #3d484d90 - selection - #475258c0 - activeGuide - #9aa79d20 - findHighlight - #899c4040 - misspelling - #da6362 - - - - name - GitGutter deleted - scope - markup.deleted.git_gutter - settings - - foreground - #e67e80a0 - - - - name - GitGutter inserted - scope - markup.inserted.git_gutter - settings - - foreground - #a7c080a0 - - - - name - GitGutter changed - scope - markup.changed.git_gutter - settings - - foreground - #7fbbb3a0 - - - - name - GitGutter untracked - scope - markup.untracked.git_gutter - settings - - foreground - #dbbc7fa0 - - - - name - GitGutter ignored - scope - markup.ignored.git_gutter - settings - - foreground - #4f585e - - - - name - GitGutter comment - scope - comment.line.annotation.git_gutter - settings - - foreground - - name - Comment - scope - comment, string.comment, punctuation.definition.comment - settings - - foreground - #859289 - fontStyle - italic - - - - - - name - Keyword - scope - keyword, storage.type.function, storage.type.class, storage.type.enum, storage.type.interface, storage.type.property, keyword.operator.new, keyword.operator.expression, keyword.operator.new, keyword.operator.delete, storage.type.extends - settings - - foreground - #e67e80 - - - - name - Debug - scope - keyword.other.debugger - settings - - foreground - #e67e80 - - - - name - Storage - scope - storage, modifier, keyword.var, entity.name.tag, keyword.control.case, keyword.control.switch - settings - - foreground - #e69875 - - - - name - Operator - scope - keyword.operator - settings - - foreground - #e69875 - - - - name - String - scope - string, punctuation.definition.string.end, punctuation.definition.string.begin, punctuation.definition.string.template.begin, punctuation.definition.string.template.end - settings - - foreground - #dbbc7f - - - - name - Attribute - scope - entity.other.attribute-name - settings - - foreground - #dbbc7f - - - - name - String Escape - scope - constant.character.escape, punctuation.quasi.element, punctuation.definition.template-expression, punctuation.section.embedded, storage.type.format, constant.other.placeholder, constant.other.placeholder, variable.interpolation - settings - - foreground - #a7c080 - - - - name - Function - scope - entity.name.function, support.function, meta.function, meta.function-call, meta.definition.method - settings - - foreground - #a7c080 - - - - name - Preproc - scope - keyword.control.at-rule, keyword.control.import, keyword.control.export, storage.type.namespace, punctuation.decorator, keyword.control.directive, keyword.preprocessor, punctuation.definition.preprocessor, punctuation.definition.directive, keyword.other.import, keyword.other.package, entity.name.type.namespace, entity.name.scope-resolution, keyword.other.using, keyword.package, keyword.import, keyword.map - settings - - foreground - #83c092 - - - - name - Annotation - scope - storage.type.annotation - settings - - foreground - #83c092 - - - - name - Label - scope - entity.name.label, constant.other.label - settings - - foreground - #83c092 - - - - name - Modules - scope - support.module, support.node, support.other.module, support.type.object.module, entity.name.type.module, entity.name.type.class.module, keyword.control.module - settings - - foreground - #83c092 - - - - name - Type - scope - storage.type, support.type, entity.name.type, keyword.type - settings - - foreground - #7fbbb3 - - - - name - Class - scope - entity.name.type.class, support.class, entity.name.class, entity.other.inherited-class, storage.class - settings - - foreground - #7fbbb3 - - - - name - Number - scope - constant.numeric - settings - - foreground - #d699b6 - - - - name - Boolean - scope - constant.language.boolean - settings - - foreground - #d699b6 - - - - name - Macro - scope - entity.name.function.preprocessor - settings - - foreground - #d699b6 - - - - name - Special identifier - scope - variable.language.this, variable.language.self, variable.language.super, keyword.other.this, variable.language.special, constant.language.null, constant.language.undefined, constant.language.nan - settings - - foreground - #d699b6 - - - - name - Constant - scope - constant.language, support.constant - settings - - foreground - #d699b6 - - - - name - Identifier - scope - variable, support.variable, meta.definition.variable - settings - - foreground - #d3c6aa - - - - name - Property - scope - variable.object.property, support.variable.property, variable.other.property, variable.other.object.property, variable.other.enummember, variable.other.member, meta.object-literal.key - settings - - foreground - #d3c6aa - - - - name - Delimiter - scope - punctuation, meta.brace, meta.delimiter, meta.bracket - settings - - foreground - #d3c6aa - - - - name - Markdown heading1 - scope - heading.1.markdown, markup.heading.setext.1.markdown - settings - - foreground - #e67e80 - fontStyle - bold - - - - name - Markdown heading2 - scope - heading.2.markdown, markup.heading.setext.2.markdown - settings - - foreground - #e69875 - fontStyle - bold - - - - name - Markdown heading3 - scope - heading.3.markdown - settings - - foreground - #dbbc7f - fontStyle - bold - - - - name - Markdown heading4 - scope - heading.4.markdown - settings - - foreground - #a7c080 - fontStyle - bold - - - - name - Markdown heading5 - scope - heading.5.markdown - settings - - foreground - #7fbbb3 - fontStyle - bold - - - - name - Markdown heading6 - scope - heading.6.markdown - settings - - foreground - #d699b6 - fontStyle - bold - - - - name - Markdown heading delimiter - scope - punctuation.definition.heading.markdown - settings - - foreground - #859289 - fontStyle - regular - - - - name - Markdown link - scope - string.other.link.title.markdown, constant.other.reference.link.markdown, string.other.link.description.markdown - settings - - foreground - #d699b6 - fontStyle - regular - - - - name - Markdown link text - scope - markup.underline.link.image.markdown, markup.underline.link.markdown - settings - - foreground - #a7c080 - fontStyle - underline - - - - name - Markdown delimiter - scope - punctuation.definition.string.begin.markdown, punctuation.definition.string.end.markdown, punctuation.definition.italic.markdown, punctuation.definition.quote.begin.markdown, punctuation.definition.metadata.markdown, punctuation.separator.key-value.markdown, punctuation.definition.constant.markdown - settings - - foreground - #859289 - - - - name - Markdown bold delimiter - scope - punctuation.definition.bold.markdown - settings - - foreground - #859289 - fontStyle - regular - - - - name - Markdown separator delimiter - scope - meta.separator.markdown, punctuation.definition.constant.begin.markdown, punctuation.definition.constant.end.markdown - settings - - foreground - #859289 - fontStyle - bold - - - - name - Markdown italic - scope - markup.italic - settings - - fontStyle - italic - - - - name - Markdown bold - scope - markup.bold - settings - - fontStyle - bold - - - - name - Markdown bold italic - scope - markup.bold markup.italic, markup.italic markup.bold - settings - - fontStyle - italic bold - - - - name - Markdown code delimiter - scope - punctuation.definition.markdown, punctuation.definition.raw.markdown - settings - - foreground - #dbbc7f - - - - name - Markdown code type - scope - fenced_code.block.language - settings - - foreground - #dbbc7f - - - - name - Markdown code block - scope - markup.fenced_code.block.markdown, markup.inline.raw.string.markdown - settings - - foreground - #a7c080 - - - - name - Markdown list mark - scope - punctuation.definition.list.begin.markdown - settings - - foreground - #e67e80 - - - - name - reStructuredText heading - scope - punctuation.definition.heading.restructuredtext - settings - - foreground - #e69875 - fontStyle - bold - - - - name - reStructuredText delimiter - scope - punctuation.definition.field.restructuredtext, punctuation.separator.key-value.restructuredtext, punctuation.definition.directive.restructuredtext, punctuation.definition.constant.restructuredtext, punctuation.definition.italic.restructuredtext, punctuation.definition.table.restructuredtext - settings - - foreground - #859289 - - - - name - reStructuredText delimiter bold - scope - punctuation.definition.bold.restructuredtext - settings - - foreground - #859289 - fontStyle - regular - - - - name - reStructuredText aqua - scope - entity.name.tag.restructuredtext, punctuation.definition.link.restructuredtext, punctuation.definition.raw.restructuredtext, punctuation.section.raw.restructuredtext - settings - - foreground - #83c092 - - - - name - reStructuredText purple - scope - constant.other.footnote.link.restructuredtext - settings - - foreground - #d699b6 - - - - name - reStructuredText red - scope - support.directive.restructuredtext - settings - - foreground - #e67e80 - - - - name - reStructuredText green - scope - entity.name.directive.restructuredtext, markup.raw.restructuredtext, markup.raw.inner.restructuredtext, string.other.link.title.restructuredtext - settings - - foreground - #a7c080 - - - - name - LaTex delimiter - scope - punctuation.definition.function.latex, punctuation.definition.function.tex, punctuation.definition.keyword.latex, constant.character.newline.tex, punctuation.definition.keyword.tex - settings - - foreground - #859289 - - - - name - LaTex red - scope - support.function.be.latex - settings - - foreground - #e67e80 - - - - name - LaTex orange - scope - support.function.section.latex, keyword.control.table.cell.latex, keyword.control.table.newline.latex - settings - - foreground - #e69875 - - - - name - LaTex yellow - scope - support.class.latex, variable.parameter.latex, variable.parameter.function.latex, variable.parameter.definition.label.latex, constant.other.reference.label.latex - settings - - foreground - #dbbc7f - - - - name - LaTex purple - scope - keyword.control.preamble.latex - settings - - foreground - #d699b6 - - - - name - Html grey - scope - punctuation.separator.namespace.xml - settings - - foreground - #859289 - - - - name - Html orange - scope - entity.name.tag.html, entity.name.tag.xml, entity.name.tag.localname.xml - settings - - foreground - #e69875 - - - - name - Html yellow - scope - entity.other.attribute-name.html, entity.other.attribute-name.xml, entity.other.attribute-name.localname.xml - settings - - foreground - #dbbc7f - - - - name - Html green - scope - string.quoted.double.html, string.quoted.single.html, punctuation.definition.string.begin.html, punctuation.definition.string.end.html, punctuation.separator.key-value.html, punctuation.definition.string.begin.xml, punctuation.definition.string.end.xml, string.quoted.double.xml, string.quoted.single.xml, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html, punctuation.definition.tag.xml, meta.tag.xml, meta.tag.preprocessor.xml, meta.tag.other.html, meta.tag.block.any.html, meta.tag.inline.any.html - settings - - foreground - #a7c080 - - - - name - Html purple - scope - variable.language.documentroot.xml, meta.tag.sgml.doctype.xml - settings - - foreground - #d699b6 - - - - name - Proto yellow - scope - storage.type.proto - settings - - foreground - #dbbc7f - - - - name - Proto green - scope - string.quoted.double.proto.syntax, string.quoted.single.proto.syntax, string.quoted.double.proto, string.quoted.single.proto - settings - - foreground - #a7c080 - - - - name - Proto aqua - scope - entity.name.class.proto, entity.name.class.message.proto - settings - - foreground - #83c092 - - - - name - CSS grey - scope - punctuation.definition.entity.css, punctuation.separator.key-value.css, punctuation.terminator.rule.css, punctuation.separator.list.comma.css - settings - - foreground - #859289 - - - - name - CSS red - scope - entity.other.attribute-name.class.css - settings - - foreground - #e67e80 - - - - name - CSS orange - scope - keyword.other.unit - settings - - foreground - #e69875 - - - - name - CSS yellow - scope - entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css - settings - - foreground - #dbbc7f - - - - name - CSS green - scope - string.quoted.single.css, string.quoted.double.css, support.constant.property-value.css, meta.property-value.css, punctuation.definition.string.begin.css, punctuation.definition.string.end.css, constant.numeric.css, support.constant.font-name.css, variable.parameter.keyframe-list.css - settings - - foreground - #a7c080 - - - - name - CSS aqua - scope - support.type.property-name.css - settings - - foreground - #83c092 - - - - name - CSS blue - scope - support.type.vendored.property-name.css - settings - - foreground - #7fbbb3 - - - - name - CSS purple - scope - entity.name.tag.css, entity.other.keyframe-offset.css, punctuation.definition.keyword.css, keyword.control.at-rule.keyframes.css, meta.selector.css - settings - - foreground - #d699b6 - - - - name - SASS grey - scope - punctuation.definition.entity.scss, punctuation.separator.key-value.scss, punctuation.terminator.rule.scss, punctuation.separator.list.comma.scss - settings - - foreground - #859289 - - - - name - SASS orange - scope - keyword.control.at-rule.keyframes.scss - settings - - foreground - #e69875 - - - - name - SASS yellow - scope - punctuation.definition.interpolation.begin.bracket.curly.scss, punctuation.definition.interpolation.end.bracket.curly.scss - settings - - foreground - #dbbc7f - - - - name - SASS green - scope - punctuation.definition.string.begin.scss, punctuation.definition.string.end.scss, string.quoted.double.scss, string.quoted.single.scss, constant.character.css.sass, meta.property-value.scss - settings - - foreground - #a7c080 - - - - name - SASS purple - scope - keyword.control.at-rule.include.scss, keyword.control.at-rule.use.scss, keyword.control.at-rule.mixin.scss, keyword.control.at-rule.extend.scss, keyword.control.at-rule.import.scss - settings - - foreground - #d699b6 - - - - name - Stylus white - scope - meta.function.stylus - settings - - foreground - #d3c6aa - - - - name - Stylus yellow - scope - entity.name.function.stylus - settings - - foreground - #dbbc7f - - - - name - JavaScript white - scope - string.unquoted.js - settings - - foreground - #d3c6aa - - - - name - JavaScript grey - scope - punctuation.accessor.js, punctuation.separator.key-value.js, punctuation.separator.label.js, keyword.operator.accessor.js - settings - - foreground - #859289 - - - - name - JavaScript red - scope - punctuation.definition.block.tag.jsdoc - settings - - foreground - #e67e80 - - - - name - JavaScript orange - scope - storage.type.js, storage.type.function.arrow.js - settings - - foreground - #e69875 - - - - name - JSX white - scope - JSXNested - settings - - foreground - #d3c6aa - - - - name - JSX green - scope - punctuation.definition.tag.jsx, entity.other.attribute-name.jsx, punctuation.definition.tag.begin.js.jsx, punctuation.definition.tag.end.js.jsx, entity.other.attribute-name.js.jsx - settings - - foreground - #a7c080 - - - - name - TypeScript white - scope - entity.name.type.module.ts - settings - - foreground - #d3c6aa - - - - name - TypeScript grey - scope - keyword.operator.type.annotation.ts, punctuation.accessor.ts, punctuation.separator.key-value.ts - settings - - foreground - #859289 - - - - name - TypeScript green - scope - punctuation.definition.tag.directive.ts, entity.other.attribute-name.directive.ts - settings - - foreground - #a7c080 - - - - name - TypeScript aqua - scope - entity.name.type.ts, entity.name.type.interface.ts, entity.other.inherited-class.ts, entity.name.type.alias.ts, entity.name.type.class.ts, entity.name.type.enum.ts - settings - - foreground - #83c092 - - - - name - TypeScript orange - scope - storage.type.ts, storage.type.function.arrow.ts, storage.type.type.ts - settings - - foreground - #e69875 - - - - name - TypeScript blue - scope - entity.name.type.module.ts - settings - - foreground - #7fbbb3 - - - - name - TypeScript purple - scope - keyword.control.import.ts, keyword.control.export.ts, storage.type.namespace.ts - settings - - foreground - #d699b6 - - - - name - TSX white - scope - entity.name.type.module.tsx - settings - - foreground - #d3c6aa - - - - name - TSX grey - scope - keyword.operator.type.annotation.tsx, punctuation.accessor.tsx, punctuation.separator.key-value.tsx - settings - - foreground - #859289 - - - - name - TSX green - scope - punctuation.definition.tag.directive.tsx, entity.other.attribute-name.directive.tsx, punctuation.definition.tag.begin.tsx, punctuation.definition.tag.end.tsx, entity.other.attribute-name.tsx - settings - - foreground - #a7c080 - - - - name - TSX aqua - scope - entity.name.type.tsx, entity.name.type.interface.tsx, entity.other.inherited-class.tsx, entity.name.type.alias.tsx, entity.name.type.class.tsx, entity.name.type.enum.tsx - settings - - foreground - #83c092 - - - - name - TSX blue - scope - entity.name.type.module.tsx - settings - - foreground - #7fbbb3 - - - - name - TSX purple - scope - keyword.control.import.tsx, keyword.control.export.tsx, storage.type.namespace.tsx - settings - - foreground - #d699b6 - - - - name - TSX orange - scope - storage.type.tsx, storage.type.function.arrow.tsx, storage.type.type.tsx, support.class.component.tsx - settings - - foreground - #e69875 - - - - name - CoffeeScript orange - scope - storage.type.function.coffee - settings - - foreground - #e69875 - - - - name - PureScript white - scope - meta.type-signature.purescript - settings - - foreground - #d3c6aa - - - - name - PureScript orange - scope - keyword.other.double-colon.purescript, keyword.other.arrow.purescript, keyword.other.big-arrow.purescript - settings - - foreground - #e69875 - - - - name - PureScript yellow - scope - entity.name.function.purescript - settings - - foreground - #dbbc7f - - - - name - PureScript green - scope - string.quoted.single.purescript, string.quoted.double.purescript, punctuation.definition.string.begin.purescript, punctuation.definition.string.end.purescript, string.quoted.triple.purescript, entity.name.type.purescript - settings - - foreground - #a7c080 - - - - name - PureScript purple - scope - support.other.module.purescript - settings - - foreground - #d699b6 - - - - name - Dart grey - scope - punctuation.dot.dart - settings - - foreground - #859289 - - - - name - Dart orange - scope - storage.type.primitive.dart - settings - - foreground - #e69875 - - - - name - Dart yellow - scope - support.class.dart - settings - - foreground - #dbbc7f - - - - name - Dart green - scope - entity.name.function.dart, string.interpolated.single.dart, string.interpolated.double.dart - settings - - foreground - #a7c080 - - - - name - Dart blue - scope - variable.language.dart - settings - - foreground - #7fbbb3 - - - - name - Dart purple - scope - keyword.other.import.dart, storage.type.annotation.dart - settings - - foreground - #d699b6 - - - - name - Pug red - scope - entity.other.attribute-name.class.pug - settings - - foreground - #e67e80 - - - - name - Pug orange - scope - storage.type.function.pug - settings - - foreground - #e69875 - - - - name - Pug aqua - scope - entity.other.attribute-name.tag.pug - settings - - foreground - #83c092 - - - - name - Pug purple - scope - entity.name.tag.pug, storage.type.import.include.pug - settings - - foreground - #d699b6 - - - - name - C white - scope - meta.function-call.c, storage.modifier.array.bracket.square.c, meta.function.definition.parameters.c - settings - - foreground - #d3c6aa - - - - name - C grey - scope - punctuation.separator.dot-access.c, constant.character.escape.line-continuation.c - settings - - foreground - #859289 - - - - name - C red - scope - keyword.control.directive.include.c, punctuation.definition.directive.c, keyword.control.directive.pragma.c, keyword.control.directive.line.c, keyword.control.directive.define.c, keyword.control.directive.conditional.c, keyword.control.directive.diagnostic.error.c, keyword.control.directive.undef.c, keyword.control.directive.conditional.ifdef.c, keyword.control.directive.endif.c, keyword.control.directive.conditional.ifndef.c, keyword.control.directive.conditional.if.c, keyword.control.directive.else.c - settings - - foreground - #e67e80 - - - - name - C orange - scope - punctuation.separator.pointer-access.c - settings - - foreground - #e69875 - - - - name - C aqua - scope - variable.other.member.c - settings - - foreground - #83c092 - - - - name - C++ white - scope - meta.function-call.cpp, storage.modifier.array.bracket.square.cpp, meta.function.definition.parameters.cpp, meta.body.function.definition.cpp - settings - - foreground - #d3c6aa - - - - name - C++ grey - scope - punctuation.separator.dot-access.cpp, constant.character.escape.line-continuation.cpp - settings - - foreground - #859289 - - - - name - C++ red - scope - keyword.control.directive.include.cpp, punctuation.definition.directive.cpp, keyword.control.directive.pragma.cpp, keyword.control.directive.line.cpp, keyword.control.directive.define.cpp, keyword.control.directive.conditional.cpp, keyword.control.directive.diagnostic.error.cpp, keyword.control.directive.undef.cpp, keyword.control.directive.conditional.ifdef.cpp, keyword.control.directive.endif.cpp, keyword.control.directive.conditional.ifndef.cpp, keyword.control.directive.conditional.if.cpp, keyword.control.directive.else.cpp, storage.type.namespace.definition.cpp, keyword.other.using.directive.cpp, storage.type.struct.cpp - settings - - foreground - #e67e80 - - - - name - C++ orange - scope - punctuation.separator.pointer-access.cpp, punctuation.section.angle-brackets.begin.template.call.cpp, punctuation.section.angle-brackets.end.template.call.cpp - settings - - foreground - #e69875 - - - - name - C++ aqua - scope - variable.other.member.cpp - settings - - foreground - #83c092 - - - - name - C# red - scope - keyword.other.using.cs - settings - - foreground - #e67e80 - - - - name - C# yellow - scope - keyword.type.cs, constant.character.escape.cs, punctuation.definition.interpolation.begin.cs, punctuation.definition.interpolation.end.cs - settings - - foreground - #dbbc7f - - - - name - C# green - scope - string.quoted.double.cs, string.quoted.single.cs, punctuation.definition.string.begin.cs, punctuation.definition.string.end.cs - settings - - foreground - #a7c080 - - - - name - C# aqua - scope - variable.other.object.property.cs - settings - - foreground - #83c092 - - - - name - C# purple - scope - entity.name.type.namespace.cs - settings - - foreground - #d699b6 - - - - name - F# white - scope - keyword.symbol.fsharp, constant.language.unit.fsharp - settings - - foreground - #d3c6aa - - - - name - F# yellow - scope - keyword.format.specifier.fsharp, entity.name.type.fsharp - settings - - foreground - #dbbc7f - - - - name - F# green - scope - string.quoted.double.fsharp, string.quoted.single.fsharp, punctuation.definition.string.begin.fsharp, punctuation.definition.string.end.fsharp - settings - - foreground - #a7c080 - - - - name - F# blue - scope - entity.name.section.fsharp - settings - - foreground - #7fbbb3 - - - - name - F# purple - scope - support.function.attribute.fsharp - settings - - foreground - #d699b6 - - - - name - Java grey - scope - punctuation.separator.java, punctuation.separator.period.java - settings - - foreground - #859289 - - - - name - Java red - scope - keyword.other.import.java, keyword.other.package.java - settings - - foreground - #e67e80 - - - - name - Java orange - scope - storage.type.function.arrow.java, keyword.control.ternary.java - settings - - foreground - #e69875 - - - - name - Java aqua - scope - variable.other.property.java - settings - - foreground - #83c092 - - - - name - Java purple - scope - variable.language.wildcard.java, storage.modifier.import.java, storage.type.annotation.java, punctuation.definition.annotation.java, storage.modifier.package.java, entity.name.type.module.java - settings - - foreground - #d699b6 - - - - name - Kotlin red - scope - keyword.other.import.kotlin - settings - - foreground - #e67e80 - - - - name - Kotlin orange - scope - storage.type.kotlin - settings - - foreground - #e69875 - - - - name - Kotlin aqua - scope - constant.language.kotlin - settings - - foreground - #83c092 - - - - name - Kotlin purple - scope - entity.name.package.kotlin, storage.type.annotation.kotlin - settings - - foreground - #d699b6 - - - - name - Scala purple - scope - entity.name.package.scala - settings - - foreground - #d699b6 - - - - name - Scala blue - scope - constant.language.scala - settings - - foreground - #7fbbb3 - - - - name - Scala aqua - scope - entity.name.import.scala - settings - - foreground - #83c092 - - - - name - Scala green - scope - string.quoted.double.scala, string.quoted.single.scala, punctuation.definition.string.begin.scala, punctuation.definition.string.end.scala, string.quoted.double.interpolated.scala, string.quoted.single.interpolated.scala, string.quoted.triple.scala - settings - - foreground - #a7c080 - - - - name - Scala yellow - scope - entity.name.class, entity.other.inherited-class.scala - settings - - foreground - #dbbc7f - - - - name - Scala orange - scope - keyword.declaration.stable.scala, keyword.other.arrow.scala - settings - - foreground - #e69875 - - - - name - Scala red - scope - keyword.other.import.scala - settings - - foreground - #e67e80 - - - - name - Groovy white - scope - keyword.operator.navigation.groovy, meta.method.body.java, meta.definition.method.groovy, meta.definition.method.signature.java - settings - - foreground - #d3c6aa - - - - name - Scala grey - scope - punctuation.separator.groovy - settings - - foreground - #859289 - - - - name - Scala red - scope - keyword.other.import.groovy, keyword.other.package.groovy, keyword.other.import.static.groovy - settings - - foreground - #e67e80 - - - - name - Groovy orange - scope - storage.type.def.groovy - settings - - foreground - #e69875 - - - - name - Groovy green - scope - variable.other.interpolated.groovy, meta.method.groovy - settings - - foreground - #a7c080 - - - - name - Groovy aqua - scope - storage.modifier.import.groovy, storage.modifier.package.groovy - settings - - foreground - #83c092 - - - - name - Groovy purple - scope - storage.type.annotation.groovy - settings - - foreground - #d699b6 - - - - name - Go red - scope - keyword.type.go - settings - - foreground - #e67e80 - - - - name - Go aqua - scope - entity.name.package.go - settings - - foreground - #83c092 - - - - name - Go purple - scope - keyword.import.go, keyword.package.go - settings - - foreground - #d699b6 - - - - name - Rust white - scope - entity.name.type.mod.rust - settings - - foreground - #d3c6aa - - - - name - Rust grey - scope - keyword.operator.path.rust, keyword.operator.member-access.rust - settings - - foreground - #859289 - - - - name - Rust orange - scope - storage.type.rust - settings - - foreground - #e69875 - - - - name - Rust aqua - scope - support.constant.core.rust - settings - - foreground - #83c092 - - - - name - Rust purple - scope - meta.attribute.rust, variable.language.rust, storage.type.module.rust - settings - - foreground - #d699b6 - - - - name - Swift white - scope - meta.function-call.swift, support.function.any-method.swift - settings - - foreground - #d3c6aa - - - - name - Swift aqua - scope - support.variable.swift - settings - - foreground - #83c092 - - - - name - PHP white - scope - keyword.operator.class.php - settings - - foreground - #d3c6aa - - - - name - PHP orange - scope - storage.type.trait.php - settings - - foreground - #e69875 - - - - name - PHP aqua - scope - constant.language.php, support.other.namespace.php - settings - - foreground - #83c092 - - - - name - PHP blue - scope - storage.type.modifier.access.control.public.cpp, storage.type.modifier.access.control.private.cpp - settings - - foreground - #7fbbb3 - - - - name - PHP purple - scope - keyword.control.import.include.php, storage.type.php - settings - - foreground - #d699b6 - - - - name - Python white - scope - meta.function-call.arguments.python - settings - - foreground - #d3c6aa - - - - name - Python grey - scope - punctuation.definition.decorator.python, punctuation.separator.period.python - settings - - foreground - #859289 - - - - name - Python aqua - scope - constant.language.python - settings - - foreground - #83c092 - - - - name - Python purple - scope - keyword.control.import.python, keyword.control.import.from.python - settings - - foreground - #d699b6 - - - - name - Lua aqua - scope - constant.language.lua - settings - - foreground - #83c092 - - - - name - Lua blue - scope - entity.name.class.lua - settings - - foreground - #7fbbb3 - - - - name - Ruby white - scope - meta.function.method.with-arguments.ruby - settings - - foreground - #d3c6aa - - - - name - Ruby grey - scope - punctuation.separator.method.ruby - settings - - foreground - #859289 - - - - name - Ruby orange - scope - keyword.control.pseudo-method.ruby, storage.type.variable.ruby - settings - - foreground - #e69875 - - - - name - Ruby green - scope - keyword.other.special-method.ruby - settings - - foreground - #a7c080 - - - - name - Ruby purple - scope - keyword.control.module.ruby, punctuation.definition.constant.ruby - settings - - foreground - #d699b6 - - - - name - Ruby yellow - scope - string.regexp.character-class.ruby,string.regexp.interpolated.ruby,punctuation.definition.character-class.ruby,string.regexp.group.ruby, punctuation.section.regexp.ruby, punctuation.definition.group.ruby - settings - - foreground - #dbbc7f - - - - name - Ruby blue - scope - variable.other.constant.ruby - settings - - foreground - #7fbbb3 - - - - name - Haskell orange - scope - keyword.other.arrow.haskell, keyword.other.big-arrow.haskell, keyword.other.double-colon.haskell - settings - - foreground - #e69875 - - - - name - Haskell yellow - scope - storage.type.haskell - settings - - foreground - #dbbc7f - - - - name - Haskell green - scope - constant.other.haskell, string.quoted.double.haskell, string.quoted.single.haskell, punctuation.definition.string.begin.haskell, punctuation.definition.string.end.haskell - settings - - foreground - #a7c080 - - - - name - Haskell blue - scope - entity.name.function.haskell - settings - - foreground - #7fbbb3 - - - - name - Haskell aqua - scope - entity.name.namespace, meta.preprocessor.haskell - settings - - foreground - #83c092 - - - - name - Julia red - scope - keyword.control.import.julia, keyword.control.export.julia - settings - - foreground - #e67e80 - - - - name - Julia orange - scope - keyword.storage.modifier.julia - settings - - foreground - #e69875 - - - - name - Julia aqua - scope - constant.language.julia - settings - - foreground - #83c092 - - - - name - Julia purple - scope - support.function.macro.julia - settings - - foreground - #d699b6 - - - - name - Elm white - scope - keyword.other.period.elm - settings - - foreground - #d3c6aa - - - - name - Elm yellow - scope - storage.type.elm - settings - - foreground - #dbbc7f - - - - name - R orange - scope - keyword.other.r - settings - - foreground - #e69875 - - - - name - R green - scope - entity.name.function.r, variable.function.r - settings - - foreground - #a7c080 - - - - name - R aqua - scope - constant.language.r - settings - - foreground - #83c092 - - - - name - R purple - scope - entity.namespace.r - settings - - foreground - #d699b6 - - - - name - Erlang grey - scope - punctuation.separator.module-function.erlang, punctuation.section.directive.begin.erlang - settings - - foreground - #859289 - - - - name - Erlang red - scope - keyword.control.directive.erlang, keyword.control.directive.define.erlang - settings - - foreground - #e67e80 - - - - name - Erlang yellow - scope - entity.name.type.class.module.erlang - settings - - foreground - #dbbc7f - - - - name - Erlang green - scope - string.quoted.double.erlang, string.quoted.single.erlang, punctuation.definition.string.begin.erlang, punctuation.definition.string.end.erlang - settings - - foreground - #a7c080 - - - - name - Erlang purple - scope - keyword.control.directive.export.erlang, keyword.control.directive.module.erlang, keyword.control.directive.import.erlang, keyword.control.directive.behaviour.erlang - settings - - foreground - #d699b6 - - - - name - Elixir aqua - scope - variable.other.readwrite.module.elixir, punctuation.definition.variable.elixir - settings - - foreground - #83c092 - - - - name - Elixir blue - scope - constant.language.elixir - settings - - foreground - #7fbbb3 - - - - name - Elixir purple - scope - keyword.control.module.elixir - settings - - foreground - #d699b6 - - - - name - OCaml white - scope - entity.name.type.value-signature.ocaml - settings - - foreground - #d3c6aa - - - - name - OCaml orange - scope - keyword.other.ocaml - settings - - foreground - #e69875 - - - - name - OCaml aqua - scope - constant.language.variant.ocaml - settings - - foreground - #83c092 - - - - name - Perl red - scope - storage.type.sub.perl, storage.type.declare.routine.perl - settings - - foreground - #e67e80 - - - - name - Lisp white - scope - meta.function.lisp - settings - - foreground - #d3c6aa - - - - name - Lisp red - scope - storage.type.function-type.lisp - settings - - foreground - #e67e80 - - - - name - Lisp green - scope - keyword.constant.lisp - settings - - foreground - #a7c080 - - - - name - Lisp aqua - scope - entity.name.function.lisp - settings - - foreground - #83c092 - - - - name - Clojure green - scope - constant.keyword.clojure, support.variable.clojure, meta.definition.variable.clojure - settings - - foreground - #a7c080 - - - - name - Clojure purple - scope - entity.global.clojure - settings - - foreground - #d699b6 - - - - name - Clojure blue - scope - entity.name.function.clojure - settings - - foreground - #7fbbb3 - - - - name - Shell white - scope - meta.scope.if-block.shell, meta.scope.group.shell - settings - - foreground - #d3c6aa - - - - name - Shell yellow - scope - support.function.builtin.shell, entity.name.function.shell - settings - - foreground - #dbbc7f - - - - name - Shell green - scope - string.quoted.double.shell, string.quoted.single.shell, punctuation.definition.string.begin.shell, punctuation.definition.string.end.shell, string.unquoted.heredoc.shell - settings - - foreground - #a7c080 - - - - name - Shell purple - scope - keyword.control.heredoc-token.shell, variable.other.normal.shell, punctuation.definition.variable.shell, variable.other.special.shell, variable.other.positional.shell, variable.other.bracket.shell - settings - - foreground - #d699b6 - - - - name - Fish red - scope - support.function.builtin.fish - settings - - foreground - #e67e80 - - - - name - Fish orange - scope - support.function.unix.fish - settings - - foreground - #e69875 - - - - name - Fish blue - scope - variable.other.normal.fish, punctuation.definition.variable.fish, variable.other.fixed.fish, variable.other.special.fish - settings - - foreground - #7fbbb3 - - - - name - Fish green - scope - string.quoted.double.fish, punctuation.definition.string.end.fish, punctuation.definition.string.begin.fish, string.quoted.single.fish - settings - - foreground - #a7c080 - - - - name - Fish purple - scope - constant.character.escape.single.fish - settings - - foreground - #d699b6 - - - - name - PowerShell grey - scope - punctuation.definition.variable.powershell - settings - - foreground - #859289 - - - - name - PowerShell yellow - scope - entity.name.function.powershell, support.function.attribute.powershell, support.function.powershell - settings - - foreground - #dbbc7f - - - - name - PowerShell green - scope - string.quoted.single.powershell, string.quoted.double.powershell, punctuation.definition.string.begin.powershell, punctuation.definition.string.end.powershell, string.quoted.double.heredoc.powershell - settings - - foreground - #a7c080 - - - - name - PowerShell aqua - scope - variable.other.member.powershell - settings - - foreground - #83c092 - - - - name - GraphQL white - scope - string.unquoted.alias.graphql - settings - - foreground - #d3c6aa - - - - name - GraphQL red - scope - keyword.type.graphql - settings - - foreground - #e67e80 - - - - name - GraphQL purple - scope - entity.name.fragment.graphql - settings - - foreground - #d699b6 - - - - name - Makefile orange - scope - entity.name.function.target.makefile - settings - - foreground - #e69875 - - - - name - Makefile yellow - scope - variable.other.makefile - settings - - foreground - #dbbc7f - - - - name - Makefile green - scope - meta.scope.prerequisites.makefile - settings - - foreground - #a7c080 - - - - name - CMake green - scope - string.source.cmake - settings - - foreground - #a7c080 - - - - name - CMake aqua - scope - entity.source.cmake - settings - - foreground - #83c092 - - - - name - CMake purple - scope - storage.source.cmake - settings - - foreground - #d699b6 - - - - name - VimL grey - scope - punctuation.definition.map.viml - settings - - foreground - #859289 - - - - name - VimL orange - scope - storage.type.map.viml - settings - - foreground - #e69875 - - - - name - VimL green - scope - constant.character.map.viml, constant.character.map.key.viml - settings - - foreground - #a7c080 - - - - name - VimL blue - scope - constant.character.map.special.viml - settings - - foreground - #7fbbb3 - - - - name - Tmux green - scope - constant.language.tmux, constant.numeric.tmux - settings - - foreground - #a7c080 - - - - name - Dockerfile orange - scope - entity.name.function.package-manager.dockerfile - settings - - foreground - #e69875 - - - - name - Dockerfile yellow - scope - keyword.operator.flag.dockerfile - settings - - foreground - #dbbc7f - - - - name - Dockerfile green - scope - string.quoted.double.dockerfile, string.quoted.single.dockerfile - settings - - foreground - #a7c080 - - - - name - Dockerfile aqua - scope - constant.character.escape.dockerfile - settings - - foreground - #83c092 - - - - name - Dockerfile purple - scope - entity.name.type.base-image.dockerfile, entity.name.image.dockerfile - settings - - foreground - #d699b6 - - - - name - Diff grey - scope - punctuation.definition.separator.diff - settings - - foreground - #859289 - - - - name - Diff red - scope - markup.deleted.diff, punctuation.definition.deleted.diff - settings - - foreground - #e67e80 - - - - name - Diff orange - scope - meta.diff.range.context, punctuation.definition.range.diff - settings - - foreground - #e69875 - - - - name - Diff yellow - scope - meta.diff.header.from-file - settings - - foreground - #dbbc7f - - - - name - Diff green - scope - markup.inserted.diff, punctuation.definition.inserted.diff - settings - - foreground - #a7c080 - - - - name - Diff blue - scope - markup.changed.diff, punctuation.definition.changed.diff - settings - - foreground - #7fbbb3 - - - - name - Diff purple - scope - punctuation.definition.from-file.diff - settings - - foreground - #d699b6 - - - - name - Git red - scope - entity.name.section.group-title.ini, punctuation.definition.entity.ini - settings - - foreground - #e67e80 - - - - name - Git orange - scope - punctuation.separator.key-value.ini - settings - - foreground - #e69875 - - - - name - Git green - scope - string.quoted.double.ini, string.quoted.single.ini, punctuation.definition.string.begin.ini, punctuation.definition.string.end.ini - settings - - foreground - #a7c080 - - - - name - Git aqua - scope - keyword.other.definition.ini - settings - - foreground - #83c092 - - - - name - SQL yellow - scope - support.function.aggregate.sql - settings - - foreground - #dbbc7f - - - - name - SQL green - scope - string.quoted.single.sql, punctuation.definition.string.end.sql, punctuation.definition.string.begin.sql, string.quoted.double.sql - settings - - foreground - #a7c080 - - - - name - GraphQL yellow - scope - support.type.graphql - settings - - foreground - #dbbc7f - - - - name - GraphQL blue - scope - variable.parameter.graphql - settings - - foreground - #7fbbb3 - - - - name - GraphQL aqua - scope - constant.character.enum.graphql - settings - - foreground - #83c092 - - - - name - JSON grey - scope - punctuation.support.type.property-name.begin.json, punctuation.support.type.property-name.end.json, punctuation.separator.dictionary.key-value.json, punctuation.definition.string.begin.json, punctuation.definition.string.end.json, punctuation.separator.dictionary.pair.json, punctuation.separator.array.json - settings - - foreground - #859289 - - - - name - JSON orange - scope - support.type.property-name.json - settings - - foreground - #e69875 - - - - name - JSON green - scope - string.quoted.double.json - settings - - foreground - #a7c080 - - - - name - YAML grey - scope - punctuation.separator.key-value.mapping.yaml - settings - - foreground - #859289 - - - - name - YAML green - scope - string.unquoted.plain.out.yaml, string.quoted.single.yaml, string.quoted.double.yaml, punctuation.definition.string.begin.yaml, punctuation.definition.string.end.yaml, string.unquoted.plain.in.yaml, string.unquoted.block.yaml - settings - - foreground - #a7c080 - - - - name - YAML aqua - scope - punctuation.definition.anchor.yaml, punctuation.definition.block.sequence.item.yaml - settings - - foreground - #83c092 - - - - name - TOML orange - scope - keyword.key.toml - settings - - foreground - #e69875 - - - - name - TOML green - scope - string.quoted.single.basic.line.toml, string.quoted.single.literal.line.toml, punctuation.definition.keyValuePair.toml - settings - - foreground - #a7c080 - - - - name - TOML blue - scope - constant.other.boolean.toml - settings - - foreground - #7fbbb3 - - - - name - TOML purple - scope - entity.other.attribute-name.table.toml, punctuation.definition.table.toml, entity.other.attribute-name.table.array.toml, punctuation.definition.table.array.toml - settings - - foreground - #d699b6 - - - - name - Comment - scope - comment, string.comment, punctuation.definition.comment - settings - - foreground - #859289 - fontStyle - italic - - - - uuid - 3f688e48-bd62-4cd7-9981-9b491786d8c6 - colorSpaceName - sRGB - semanticClass - theme.dark.everforest-dark - author - - comment - - - diff --git a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE b/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE deleted file mode 100644 index e6984c6..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2024 Ben Yip - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE-tmtheme b/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE-tmtheme deleted file mode 100644 index c996915..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Subhaditya Nath - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/README.md b/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/README.md deleted file mode 100644 index a6d6964..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/README.md +++ /dev/null @@ -1,32 +0,0 @@ -
-Yazi logo -
- -

- Gruvbox Dark Flavor for Yazi -

- -## 👀 Preview - - - -## 🎹 Installation - -```bash -ya pkg add bennyyip/gruvbox-dark -``` - -## ⚙ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "gruvbox-dark" -``` - -## 📜 License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/flavor.toml b/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/flavor.toml deleted file mode 100644 index c0aeb59..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/flavor.toml +++ /dev/null @@ -1,220 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#83a598" } - -# Find -find_keyword = { fg = "#b8bb26", bold = true, italic = true, underline = true } -find_position = { fg = "#fe8019", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# Marker -marker_copied = { fg = "#8ec07c", bg = "#8ec07c" } -marker_cut = { fg = "#d3869b", bg = "#d3869b" } -marker_marked = { fg = "#83a598", bg = "#83a598" } -marker_selected = { fg = "#fbf1c7", bg = "#fbf1c7" } - -# Count -count_copied = { fg = "#282828", bg = "#8ec07c" } -count_cut = { fg = "#282828", bg = "#d3869b" } -count_selected = { fg = "#282828", bg = "#fbf1c7" } - -# Border -border_symbol = "│" -border_style = { fg = "#665c54" } -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#282828", bg = "#a89984" } -inactive = { fg = "#a89984", bg = "#504945" } - -# Separator -sep_inner = { open = "", close = "" } -sep_outer = { open = "", close = "" } - -# : }}} - - -# : Mode {{{ - -[mode] -normal_main = { fg = "#282828", bg = "#a89984", bold = true } -normal_alt = { fg = "#a89984", bg = "#504945" } - -# Select mode -select_main = { fg = "#282828", bg = "#fe8019", bold = true } -select_alt = { fg = "#a89984", bg = "#504945" } - -# Unset mode -unset_main = { fg = "#282828", bg = "#b8bb26", bold = true } -unset_alt = { fg = "#a89984", bg = "#504945" } - -# : }}} - - -# : Indicator of hovered file {{{ - -[indicator] -parent = { reversed = true } -current = { reversed = true } -preview = { underline = true } -padding = { open = "█", close = "█" } - -# : }}} - - -# : Status {{{ - -[status] -overall = { } -sep_left = { open = "\ue0be", close = "\ue0b8" } -sep_right = { open = "\ue0be", close = "\ue0b8" } -# Permissions -perm_sep = { fg = "#665c54" } -perm_type = { fg = "#504945" } -perm_read = { fg = "#b8bb26" } -perm_write = { fg = "#fb4934" } -perm_exec = { fg = "#b8bb26" } - -# Progress -progress_label = { fg = "#ebdbb2", bold = true } -progress_normal = { fg = "#504945", bg = "#3c3836" } -progress_error = { fg = "#fb4934", bg = "#3c3836" } - -# : }}} - - -# : Which {{{ - -[which] -cols = 3 -mask = { bg = "#3c3836" } -cand = { fg = "#83a598" } -rest = { fg = "#928374" } -desc = { fg = "#fe8019" } -separator = " îȘœ " -separator_style = { fg = "#504945" } - -# : }}} - - -# : Confirmation {{{ - -[confirm] -border = { fg = "#a89984" } -title = { fg = "#83a598" } -body = { fg = "#fbf1c7" } -list = { fg = "#ebdbb2" } -btn_yes = { reversed = true, fg = "#ebdbb2" } -btn_no = {} -btn_labels = [ " [Y]es ", " (N)o " ] - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#83a598" } -title = { fg = "#83a598" } - -# Table -tbl_col = { fg = "#83a598" } -tbl_cell = { fg = "#fabd2f", reversed = true } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#8ec07c" } -title_warn = { fg = "#fbf1c7" } -title_error = { fg = "#d3869b" } - -# : }}} - - -# : Picker {{{ - -[pick] -border = { fg = "#458588" } -active = { fg = "#d3869b", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#ebdbb2" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#a89984" } -active = { reversed = true, fg = "#83a598" } -inactive = { fg = "#ebdbb2" } - - - -# : Task manager {{{ - -[tasks] -border = { fg = "#504945" } -title = {} -hovered = { underline = true } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#83a598" } -run = { fg = "#d3869b" } -desc = {} -hovered = { reversed = true, bold = true } -footer = { fg = "#3c3836", bg = "#a89984" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#d3869b" }, - - # Media - { mime = "{audio,video}/*", fg = "#fabd2f" }, - - # Archives - { mime = "application/*zip", fg = "#fb4934" }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#fb4934" }, - - # Documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#689d6a" }, - - # Fallback - { url = "*", fg = "#ebdbb2" }, - { url = "*/", fg = "#83a598" }, -] - -# : }}} - diff --git a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/preview.png b/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/preview.png deleted file mode 100644 index 48cdce8..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/preview.png +++ /dev/null @@ -1 +0,0 @@ -placeholder diff --git a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/tmtheme.xml b/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/tmtheme.xml deleted file mode 100644 index 59c1ecd..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-dark.yazi/tmtheme.xml +++ /dev/null @@ -1,1509 +0,0 @@ - - - - - comment - Based on gruvbox for Vim (https://github.com/morhetz/gruvbox) - originalAuthor - Pavel Pertsev (https://github.com/morhetz) - author - Brian Reilly (https://github.com/Briles/gruvbox) - name - gruvbox (Dark) (Medium) - colorSpaceName - sRGB - settings - - - settings - - background - #222222 - caret - #a89984 - foreground - #ebdbb280 - invisibles - #ebdbb226 - lineHighlight - #3c3836 - selection - #3c3836 - inactiveSelection - #3c3836 - guide - #ebdbb226 - activeGuide - #ebdbb280 - stackGuide - #ebdbb240 - bracketContentsOptions - underline - bracketContentsForeground - #bdae93 - bracketsOptions - underline - bracketsForeground - #bdae93 - gutterForeground - #928374 - highlight - #fbf1c7 - highlightForeground - #fbf1c7 - findHighlight - #d79921 - findHighlightForeground - #222222 - tagsOptions - underline - selectionBorder - #3c3836 - popupCss - - html { - background-color: #1b1b1b; - color: #fbf1c7; - padding: 12px; - } - - a { - color: #8ec07c; - } - - .error, .deleted { - color: #fb4934; - } - - .success, .inserted, .name { - color: #b8bb26; - } - - .warning, .modified { - color: #fabd2f; - } - - .type { - color: #fabd2f; - font-style: italic; - } - - .param { - color: #fbf1c7; - } - - .current { - text-decoration: underline; - } - - - - - name - Text and Source Base Colors - scope - meta.group, meta.method-call.source.cs, meta.method.attribute.source.cs, meta.method.body.java, meta.method.body.source.cs, meta.method.source.cs, none, source, text - settings - - foreground - #fbf1c7 - - - - name - Punctuation - scope - entity.quasi.element meta.group.braces, keyword.operator keyword.operator.neon, keyword.operator operator.neon, keyword.operator.accessor, keyword.other.accessor, meta.attribute-selector keyword.operator.stylus, meta.brace, meta.delimiter, meta.group.braces, meta.punctuation.separator, meta.separator, punctuation - settings - - foreground - #fbf1c7 - - - - name - Comments - scope - comment, comment text, markup.strikethrough, punctuation.definition.comment, punctuation.whitespace.comment, string.comment, text.cancelled - settings - - fontStyle - italic - foreground - #928374 - - - - name - Keywords Inside Comments - scope - comment.keyword, comment.keyword.punctuation - settings - - foreground - #d5c4a1 - - - - name - DocBlockr & Other Keywords Inside Comments - scope - comment.parameter, comment.punctuation, comment.string, comment.type, keyword.other.phpdoc.php, punctuation.definition.keyword.javadoc, source.groovy keyword.other.documentation, source.java keyword.other.documentation, storage.type.annotation.coffeescript, storage.type.class.jsdoc - settings - - foreground - #bdae93 - - - - name - Entity - scope - constant.language.name, entity.name.type, entity.other.inherited-class - settings - - foreground - #fabd2f - - - - name - Template String Punctuation - scope - constant.other.placeholder, entity.name.tag.mustache, entity.tag.tagbraces, punctuation.definition.string.template, punctuation.definition.template-expression, punctuation.quasi, punctuation.section.embedded, string.interpolated, variable.other.interpolation.scss - settings - - foreground - #8ec07c - - - - name - Keywords - scope - js.embedded.control.flow keyword.operator.js, keyword, keyword.control, keyword.operator.logical.python, meta.at-rule.media support.function.misc, meta.prolog.haml, meta.tag.sgml.doctype.html, storage.type.function.jade, storage.type.function.pug, storage.type.import.haxe, storage.type.import.include.jade, storage.type.import.include.pug, support.keyword.timing-direction, variable.documentroot - settings - - foreground - #fb4934 - - - - name - CSS At-Rule Punctuation (@) & At-Rule Vendor Prefixes - scope - keyword.control.at-rule support.type.property-vendor, punctuation.definition.keyword - settings - - foreground - #cc241d - - - - name - Operators - scope - keyword.control.new, keyword.control.operator, keyword.operator, keyword.other.arrow, keyword.other.double-colon, punctuation.operator - settings - - foreground - #8ec07c - - - - name - Constants Punctuation - scope - constant.other.color punctuation.definition.constant, constant.other.symbol punctuation.definition.constant, constant.other.unit, keyword.other.unit, punctuation.section.flowtype, support.constant.unicode-range.prefix - settings - - foreground - #b16286 - - - - name - Storage - scope - storage, storage.type.annotation, storage.type.primitive - settings - - foreground - #fb4934 - - - - scope - storage.modifier.import, storage.modifier.package, storage.type.import, variable.import, variable.package - settings - - foreground - #fbf1c7 - - - - name - Function Keyword - scope - entity.quasi.tag.name, meta.function storage.type.matlab, storage.type.function - settings - - foreground - #8ec07c - - - - name - Variables - scope - entity.name.val.declaration, entity.name.variable, meta.definition.variable, storage.type.variable, support.type.custom-property, support.type.variable-name, variable, variable.interpolation variable, variable.other.interpolation variable, variable.parameter.dosbatch, variable.parameter.output.function.matlab, variable.parameter.sass - settings - - foreground - #83a598 - - - - name - Variable - Punctuation - scope - keyword.other.custom-property.prefix, punctuation.definition.custom-property, punctuation.definition.variable, support.constant.custom-property-name.prefix, variable.interpolation, variable.other.dollar punctuation.dollar, variable.other.object.dollar punctuation.dollar - settings - - foreground - #458588 - - - - name - Function Declaration - Punctuation - scope - entity.name.function punctuation.dollar - settings - - foreground - #98971a - - - - name - Object Properties - scope - meta.property.object - settings - - foreground - #fbf1c7 - - - - name - Object Literal Properties - scope - constant.other.object.key string, meta.object-literal.key - settings - - foreground - #fbf1c7 - - - - name - Parameters - scope - meta.parameters, variable.parameter - settings - - foreground - #fbf1c7 - - - - name - SASS Import URL - scope - variable.parameter.url - settings - - foreground - #b8bb26 - - - - name - Language Constants - scope - constant, constant.numeric, constant.other, constant.other.color, constant.other.symbol, support.constant, support.constant.color, support.constant.font-name, support.constant.media, support.constant.prototype, variable.language - settings - - foreground - #d3869b - - - - name - Language Constants Punctuation - scope - variable.language punctuation.definition.variable - settings - - foreground - #b16286 - - - - name - User-Defined Constants - scope - entity.name.constant, variable.other.constant - settings - - foreground - #fabd2f - - - - name - Escaped Characters - scope - constant.character.escape, constant.character.escaped, constant.character.quoted, constant.other.character-class.escape - settings - - foreground - #fb4934 - - - - name - Invalids and Illegals - scope - invalid - settings - - foreground - #fbf1c7 - background - #fb4934 - - - - name - Inner Scopes of Invalids and Illegals - scope - invalid keyword.other.custom-property.prefix, invalid support.type.custom-property.name - settings - - foreground - #fbf1c7 - - - - name - Errors - scope - message.error - settings - - foreground - #fb4934 - - - - name - Strings - scope - meta.object-literal.key string, string - settings - - foreground - #b8bb26 - - - - name - JSON Keys - scope - meta.structure.dictionary.key.json string - settings - - foreground - #83a598 - - - - name - Regular Expressions Text - scope - source.regexp, string.regexp - settings - - foreground - #b8bb26 - - - - name - Regular Expressions Start & End Punctuation - scope - string.regexp punctuation.definition.string - settings - - foreground - #bdae93 - - - - name - Regular Expressions Character Class Punctuation ([]) - scope - keyword.control.set.regexp, punctuation.definition.character-class, string.regexp.character-class.ruby - settings - - foreground - #d3869b - - - - name - Regular Expressions Capturing Group - scope - string.regexp.group - settings - - foreground - #fbf1c7 - - - - name - Regular Expressions Assertions - scope - constant.other.assertion.regexp, punctuation.definition.group.assertion.regexp, punctuation.definition.group.capture.regexp - settings - - foreground - #83a598 - - - - name - Regular Expressions Character Class - scope - constant.other.character-class.escape.backslash.regexp, keyword.control.character-class.regexp, string.regexp.character-class constant.character.escape - settings - - foreground - #fabd2f - - - - name - Regular Expressions Quantifiers & Operators - scope - string.regexp.arbitrary-repetition, string.regexp.arbitrary-repetition punctuation - settings - - foreground - #8ec07c - - - - name - Hyperlinks - scope - constant.other.reference.link, string.other.link - settings - - foreground - #8ec07c - - - - name - Hyperlink Punctuation - scope - meta.image.inline punctuation.definition.string, meta.link.inline punctuation.definition.string, meta.link.reference punctuation.definition.constant, meta.link.reference.literal punctuation.definition.constant, meta.link.reference.literal punctuation.definition.string - settings - - foreground - #689d6a - - - - name - Markup Tag Punctuation - scope - punctuation.definition.tag - settings - - foreground - #83a598 - - - - name - Markdown Heading - scope - markup.heading - settings - - foreground - #b8bb26 - - - - name - Markdown Heading Punctuation - scope - punctuation.definition.heading, punctuation.definition.identity - settings - - foreground - #98971a - - - - name - Markdown Bold Text - scope - markup.bold - settings - - foreground - #fe8019 - fontStyle - bold - - - - name - Markdown Bold Text Punctuation - scope - punctuation.definition.bold - settings - - foreground - #d65d0e - fontStyle - bold - - - - name - Markdown Italic Text - scope - markup.italic - settings - - foreground - #fb4934 - fontStyle - italic - - - - name - Markdown Italic Text Punctuation - scope - punctuation.definition.italic - settings - - foreground - #cc241d - fontStyle - italic - - - - name - Markdown Inline Code - scope - markup.raw.inline - settings - - foreground - #fabd2f - - - - name - Markdown Inline Code Punctuation - scope - markup.raw.inline punctuation.definition.raw - settings - - foreground - #d79921 - - - - name - Markdown Quoted - scope - markup.quote - settings - - foreground - #d3869b - - - - name - Markdown Quoted Punctuation - scope - markup.quote punctuation.definition.blockquote - settings - - foreground - #b16286 - - - - name - Markdown List - scope - markup.list - settings - - foreground - #83a598 - - - - name - Markdown List Punctuation - scope - markup.list punctuation.definition.list_item - settings - - foreground - #458588 - - - - name - Markdown Separators - scope - meta.separator.markdown - settings - - foreground - #928374 - - - - name - Support - scope - meta.function-call.constructor variable.type, support.class, support.type, variable.other.class - settings - - foreground - #fabd2f - - - - name - Supporting Type - Dollar Punctuation - scope - support.class punctuation.dollar - settings - - foreground - #d79921 - - - - name - Function Calls - scope - entity.name.function.jade, entity.name.function.pug, keyword.other.special-method, meta.function-call variable.function, meta.function-call variable.other.dollar.only punctuation.dollar, support.function - settings - - foreground - #8ec07c - - - - name - Method Calls - scope - meta.function-call.method support.function, meta.function-call.method variable.function, meta.function-call.static variable.function, meta.method-call, meta.method-call support.function, meta.method-call variable.function, support.function.mutator - settings - - foreground - #689d6a - - - - name - Special Variables - scope - support.module - settings - - foreground - #d3869b - - - - name - Entities - scope - entity.name.accessor, entity.name.function, entity.name.label, entity.name.section - settings - - foreground - #b8bb26 - - - - name - Modules - scope - entity.name.module - settings - - foreground - #fe8019 - - - - name - HTML & CSS ID - scope - constant.id.tag, entity.name.tag.id, entity.other.attribute-name.id - settings - - foreground - #fe8019 - - - - name - HTML & CSS ID Punctuation (#) - scope - entity.other.attribute-name.id punctuation.definition.entity - settings - - foreground - #d65d0e - - - - name - HTML & CSS Class - scope - entity.name.tag.class, entity.other.attribute-name.class - settings - - foreground - #fabd2f - - - - name - HTML & CSS Class Punctuation (.) - scope - entity.other.attribute-name.class punctuation.definition.entity - settings - - foreground - #d79921 - - - - name - CSS Attribute Selector Attribute Name - scope - meta.attribute-selector entity.other.attribute-name - settings - - foreground - #d79921 - - - - name - HTML & XML Entity Punctuation - scope - constant.character.entity punctuation.definition.constant, constant.character.entity punctuation.definition.entity - settings - - foreground - #b16286 - - - - scope - entity.name.class, entity.name.type.class - settings - - foreground - #fabd2f - - - - name - Markup Tag - scope - entity.name.function.neon, entity.name.namespace.wildcard, entity.name.tag, entity.tag, keyword.control.untitled, keyword.doctype.xml, keyword.operator support.other.neon, punctuation.definition.prolog.haml, source.less keyword.control.html.elements - settings - - foreground - #83a598 - - - - name - HTML Attribute Names - scope - entity.name.attribute-name, entity.other.attribute-name, meta.section.attributes.haml constant.other.symbol.ruby - settings - - foreground - #fabd2f - - - - name - CSS Pseudo Elements/Classes & Vendor Prefixes - scope - entity.other.attribute-name.placeholder punctuation.definition.entity, entity.other.attribute-name.pseudo-class, entity.other.attribute-name.pseudo-element, entity.other.attribute-name.tag.pseudo-class, entity.other.attribute-name.tag.pseudo-element, entity.other.pseudo-class, entity.other.pseudo-element, support.type.vendor-prefix - settings - - foreground - #d79921 - - - - name - CSS Animations / Keyframes - scope - entity.function-name.stylus, entity.other.animation-keyframe.stylus, entity.other.animation-name, keyword.language.function.misc.stylus, meta.at-rule.keyframes entity.name.function, variable.other.animation-name - settings - - foreground - #8ec07c - - - - name - Author-Defined Names - scope - entity.other.namespace-prefix - settings - - foreground - #8ec07c - - - - scope - meta.class.body, meta.tag - settings - - foreground - #fbf1c7 - - - - name - Markdown Image & Hyperlink - scope - meta.image, meta.link - settings - - foreground - #d3869b - - - - name - Markdown Image & Hyperlink Punctuation - scope - meta.image punctuation.definition.metadata, meta.link punctuation.definition.metadata - settings - - foreground - #b16286 - - - - scope - meta.require - settings - - foreground - #b8bb26 - - - - name - Function Call Braces - scope - constant.name.attribute.tag.jade, constant.name.attribute.tag.pug, meta.brace.round, meta.function-call meta.group punctuation.definition.group, punctuation.definition.method-parameters, punctuation.definition.parameters - settings - - foreground - #bdae93 - - - - name - CSS Property Names - scope - meta.property-name, support.type.property-name, support.type.shape.definition support.constant.property-value - settings - - foreground - #b8bb26 - - - - name - CSS Property Name Vendor Prefixes - scope - meta.property-name support.type.vendor-prefix, support.type.property-name.media support.type.vendor-prefix - settings - - foreground - #98971a - - - - name - CSS Property Values - scope - constant.string.sass, meta.property-value, support.constant.property-value - settings - - foreground - #fbf1c7 - - - - name - CSS Property Value Vendor Prefixes - scope - meta.property-value support.type.vendor-prefix - settings - - foreground - #bdae93 - - - - name - Diff Foreground Text - scope - source.diff - settings - - foreground - #a89984 - - - - name - Diff Header Text From - scope - meta.diff.header.from-file - settings - - foreground - #83a598 - - - - name - Diff Header Text From Punctuation - scope - punctuation.definition.from-file - settings - - foreground - #458588 - - - - name - Diff Header Text To - scope - meta.diff.header.to-file - settings - - foreground - #d3869b - - - - name - Diff Header Text To Punctuation - scope - punctuation.definition.to-file - settings - - foreground - #b16286 - - - - name - Diff Additions & Deletions Stats - scope - meta.diff.range, meta.toc-list.line-number - settings - - foreground - #fabd2f - - - - name - Diff Additions & Deletions Stats Punctuation - scope - punctuation.definition.range.diff - settings - - foreground - #d79921 - - - - name - FiF Line Number - scope - constant.numeric.line-number - settings - - foreground - #928374 - - - - name - FiF Line Number Matched - scope - constant.numeric.line-number.match - settings - - foreground - #8ec07c - - - - name - FiF Filename - scope - entity.name.filename - settings - - foreground - #b8bb26 - - - - name - GitGutter & Diff Deleted - scope - markup.deleted, punctuation.definition.deleted - settings - - foreground - #fb4934 - - - - name - GitGutter & Diff Inserted - scope - markup.inserted, punctuation.definition.inserted - settings - - foreground - #b8bb26 - - - - name - GitGutter & Diff Changed - scope - markup.changed, punctuation.definition.changed - settings - - foreground - #fabd2f - - - - name - GitGutter ignored - scope - markup.ignored - settings - - foreground - #928374 - - - - name - GitGutter untracked - scope - markup.untracked - settings - - foreground - #928374 - - - - name - Bracket Tag - scope - brackethighlighter.tag - settings - - foreground - #bdae93 - - - - name - Bracket Curly - scope - brackethighlighter.curly - settings - - foreground - #bdae93 - - - - name - Bracket Round - scope - brackethighlighter.round - settings - - foreground - #bdae93 - - - - name - Bracket Square - scope - brackethighlighter.square - settings - - foreground - #bdae93 - - - - name - Bracket Angle - scope - brackethighlighter.angle - settings - - foreground - #bdae93 - - - - name - Bracket Quote - scope - brackethighlighter.quote - settings - - foreground - #bdae93 - - - - name - Bracket Unmatched - scope - brackethighlighter.unmatched - settings - - foreground - #fb4934 - - - - name - SublimeLinter Error - scope - sublimelinter.mark.error - settings - - foreground - #fb4934 - - - - name - SublimeLinter Gutter Mark - scope - sublimelinter.gutter-mark - settings - - foreground - #928374 - - - - name - SublimeLinter Warning - scope - sublimelinter.mark.warning - settings - - foreground - #fabd2f - - - - name - HexViewer Upper Byte Nibble - scope - raw.nibble.upper - settings - - foreground - #fbf1c7 - - - - name - HexViewer Lower Byte Nibble - scope - raw.nibble.lower - settings - - foreground - #fbf1c7 - - - - name - HexViewer Highlight - scope - hexviewer.highlight - settings - - foreground - #222222 - background - #fabd2f - - - - name - HexViewer Edited Highlight - scope - hexviewer.highlight.edited - settings - - foreground - #222222 - background - #fe8019 - - - - name - Raw New Line: Carriage Return - scope - glyph.carriage-return - settings - - foreground - #ebdbb226 - - - - name - Raw New Line: New Line Glyph - scope - glyph.new-line - settings - - foreground - #ebdbb226 - - - - name - PlainTasks: Header - scope - keyword.control.header.todo - settings - - foreground - #b8bb26 - background - #3a3a3a - - - - name - PlainTasks: Notes - scope - notes.todo - settings - - foreground - #bdae93 - - - - name - PlainTasks: Punctuation - scope - text.todo punctuation.definition.bold, text.todo punctuation.definition.italic - settings - - foreground - #7c6f64 - - - - name - PlainTasks: Task Pending - scope - meta.item.todo.pending - settings - - foreground - #fbf1c7 - - - - name - PlainTasks: Task Pending Punctuation - scope - punctuation.definition.bullet.pending.todo - settings - - foreground - #928374 - - - - name - PlainTasks: Task Completed Punctuation - scope - punctuation.definition.bullet.completed.todo - settings - - foreground - #8ec07c - - - - name - PlainTasks: Task Cancelled Punctuation - scope - punctuation.definition.bullet.cancelled.todo - settings - - foreground - #fb4934 - - - - name - PlainTasks: Tag Critical - scope - string.other.tag.todo.critical - settings - - foreground - #fb4934 - fontStyle - bold - - - - name - PlainTasks: Tag High - scope - string.other.tag.todo.high - settings - - foreground - #fe8019 - fontStyle - bold - - - - name - PlainTasks: Tag Low - scope - string.other.tag.todo.low - settings - - foreground - #83a598 - fontStyle - bold - - - - name - PlainTasks: Tag Today - scope - string.other.tag.todo.today - settings - - foreground - #fabd2f - fontStyle - bold - - - - name - PlainTasks: Tag - scope - meta.tag.todo - settings - - foreground - #d3869b - - - - name - PlainTasks: URL - scope - punctuation.definition.url, todo.url - settings - - foreground - #83a598 - - - - name - PlainTasks: Separator - scope - meta.punctuation.archive.todo, meta.punctuation.separator.todo - settings - - fontStyle - italic - foreground - #928374 - - - - - diff --git a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/LICENSE b/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/LICENSE deleted file mode 100644 index 89d0a34..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 - Matthew Dong - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/LICENSE-tmtheme b/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/LICENSE-tmtheme deleted file mode 100644 index 11069ed..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/README.md b/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/README.md deleted file mode 100644 index ca8eadc..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/README.md +++ /dev/null @@ -1,42 +0,0 @@ -
- Yazi logo -
- -

- Gruvbox Material Flavor for Yazi -

- -## 👀 Preview - -![gruvbox-material](./preview.png) - -## 🎹 Installation - -### Using package manager - -```bash -ya pkg add matt-dong-123/gruvbox-material -``` - -### Manual install - -```bash -# Linux/macOS -git clone https://github.com/your-username/gruvbox-material.yazi.git ~/.config/yazi/flavors/gruvbox-material.yazi - -# Windows -git clone https://github.com/your-username/gruvbox-material.yazi.git %AppData%\yazi\config\flavors\gruvbox-material.yazi -``` - -## ⚙ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "gruvbox-material" -``` - -## 📜 License - -Check the [LICENSE](LICENSE) file for more details. diff --git a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/flavor.toml b/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/flavor.toml deleted file mode 100644 index d01918c..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/flavor.toml +++ /dev/null @@ -1,214 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#89b482" } - -# Find -find_keyword = { fg = "#d8a657", bold = true, italic = true, underline = true } -find_position = { fg = "#d3869b", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#a9b665", bg = "#a9b665" } -marker_cut = { fg = "#ea6962", bg = "#ea6962" } -marker_marked = { fg = "#89b482", bg = "#89b482" } -marker_selected = { fg = "#d8a657", bg = "#d8a657" } - -# Count -count_copied = { fg = "#282828", bg = "#a9b665" } -count_cut = { fg = "#282828", bg = "#ea6962" } -count_selected = { fg = "#282828", bg = "#d8a657" } - -# Border -border_symbol = "│" -border_style = { fg = "#928374" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#282828", bg = "#7daea3", bold = true } -inactive = { fg = "#7daea3", bg = "#32302f" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#282828", bg = "#7daea3", bold = true } -normal_alt = { fg = "#7daea3", bg = "#32302f" } - -# Select mode -select_main = { fg = "#282828", bg = "#89b482", bold = true } -select_alt = { fg = "#89b482", bg = "#32302f" } - -# Unset mode -unset_main = { fg = "#282828", bg = "#ea6962", bold = true } -unset_alt = { fg = "#ea6962", bg = "#32302f" } - -# : }}} - - -# : Status bar {{{ - -[status] -# Permissions -perm_sep = { fg = "#928374" } -perm_type = { fg = "#7daea3" } -perm_read = { fg = "#d8a657" } -perm_write = { fg = "#ea6962" } -perm_exec = { fg = "#a9b665" } - -# Progress -progress_label = { fg = "#ddc7a1", bold = true } -progress_normal = { fg = "#a9b665", bg = "#45403d" } -progress_error = { fg = "#d8a657", bg = "#ea6962" } - -# : }}} - - -# : Pick {{{ - -[pick] -border = { fg = "#7daea3" } -active = { fg = "#d3869b", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#7daea3" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#7daea3" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#7daea3" } -title = {} -hovered = { fg = "#d3869b", bold = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#32302f" } -cand = { fg = "#89b482" } -rest = { fg = "#a89984" } -desc = { fg = "#d3869b" } -separator = " îȘœ " -separator_style = { fg = "#7c6f64" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#89b482" } -run = { fg = "#d3869b" } -hovered = { reversed = true, bold = true } -footer = { fg = "#32302f", bg = "#d4be98" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#7daea3" } -title = { fg = "#7daea3" } -tbl_col = { fg = "#89b482" } -tbl_cell = { fg = "#d3869b", bg = "#45403d" } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#a9b665" } -title_warn = { fg = "#d8a657" } -title_error = { fg = "#ea6962" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Image - { mime = "image/*", fg = "#89b482" }, - # Media - { mime = "{audio,video}/*", fg = "#d8a657" }, - # Archive - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#d3869b" }, - # Document - { mime = "application/{pdf,doc,rtf}", fg = "#a9b665" }, - # Virtual file system - { mime = "vfs/{absent,stale}", fg = "#a89984" }, - # Fallback - { url = "*", fg = "#d4be98" }, - { url = "*/", fg = "#7daea3" }, -] - -# : }}} - -[icon] - -dirs = [ - { name = ".config", text = "î—Œ", fg = "#d3869b" }, - { name = ".git", text = "", fg = "#89b482" }, - { name = ".github", text = "î—œ", fg = "#7daea3" }, - { name = ".npm", text = "", fg = "#7daea3" }, - { name = "Desktop", text = "", fg = "#89b482" }, - { name = "Development", text = "", fg = "#89b482" }, - { name = "Documents", text = "", fg = "#89b482" }, - { name = "Downloads", text = "", fg = "#89b482" }, - { name = "Library", text = "", fg = "#89b482" }, - { name = "Movies", text = "", fg = "#89b482" }, - { name = "Music", text = "", fg = "#89b482" }, - { name = "Pictures", text = "", fg = "#89b482" }, - { name = "Public", text = "", fg = "#89b482" }, - { name = "Videos", text = "", fg = "#89b482" }, -] -conds = [ - # Special files - { if = "orphan", text = "", fg = "#d4be98" }, - { if = "link", text = "", fg = "#928374" }, - { if = "block", text = "", fg = "#ea6962" }, - { if = "char", text = "", fg = "#ea6962" }, - { if = "fifo", text = "", fg = "#ea6962" }, - { if = "sock", text = "", fg = "#ea6962" }, - { if = "sticky", text = "", fg = "#ea6962" }, - { if = "dummy", text = "", fg = "#ea6962" }, - - # Fallback - { if = "dir", text = "", fg = "#7daea3" }, - { if = "exec", text = "", fg = "#a9b665" }, - { if = "!dir", text = "", fg = "#d4be98" }, -] \ No newline at end of file diff --git a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/preview.png b/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/preview.png deleted file mode 100644 index bbf67c2..0000000 Binary files a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/preview.png and /dev/null differ diff --git a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/tmtheme.xml b/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/tmtheme.xml deleted file mode 100644 index 37e064d..0000000 --- a/yazi_1/.config/yazi/flavors/gruvbox-material.yazi/tmtheme.xml +++ /dev/null @@ -1,1376 +0,0 @@ - - - - author - Matthew Dong (github.com/matt-dong-123) - colorSpaceName - sRGB - name - gruvbox-material - semanticClass - gruvbox-material - settings - - - settings - - activeGuide - #363b54 - background - #282828 - caret - #d8a657 - findHighlight - #e78a4e - findHighlightForeground - #282828 - foreground - #d4be98 - guide - #7c6f64 - gutterForeground - #928374 - inactiveSelection - #32302f - invisibles - #7c6f64 - lineHighlight - #32302f - selection - #d3869b - selectionBorder - #d3869b - shadow - #282828 - stackGuide - #7c6f64 - tagsOptions - underline - - - - name - Italics - Comments, Storage, Keyword Flow, Vue attributes, Decorators - scope - comment, meta.var.expr storage.type, keyword.control.flow, meta.directive.vue punctuation.separator.key-value.html, meta.directive.vue entity.other.attribute-name.html, tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js, storage.modifier - settings - - fontStyle - italic - - - - name - Comment - scope - comment, comment.block.documentation, punctuation.definition.comment - settings - - foreground - #928374 - - - - name - Comment Doc - scope - comment.block.documentation variable, comment.block.documentation storage, comment.block.documentation punctuation, comment.block.documentation keyword, comment.block.documentation support, comment.block.documentation markup, comment.block.documentation markup.inline.raw.string.markdown, keyword.other.phpdoc.php - settings - - foreground - #928374 - - - - name - Number, Boolean, Undefined, Null - scope - variable.other.constant, punctuation.definition.constant, constant.language, constant.numeric, support.constant - settings - - foreground - #e78a4e - - - - name - String, Symbols, Markup Heading - scope - meta.property.lua,string.unquoted.key.lua,support.other.metaproperty.lua,support.other.metaproperty.lua,constant.other.symbol, constant.other.key, markup.heading, meta.attribute-selector - settings - - fontStyle - - foreground - #89b482 - - - - name - String - scope - string - settings - - fontStyle - - foreground - #a9b665 - - - - name - Colors - scope - constant.other.color, constant.other.color.rgb-value.hex punctuation.definition.constant - settings - - foreground - #7daea3 - - - - name - Info - scope - markup.info - settings - - foreground - #89b482 - background - #32302f - - - - name - Warning - scope - markup.warning - settings - - foreground - #d8a657 - background - #45403d - - - - name - Error - scope - markup.error - settings - - foreground - #ea6962 - background - #45403d - - - - name - Invalid - scope - invalid, invalid.illegal - settings - - foreground - #ea6962 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #d3869b - - - - name - Storage Type - scope - storage.type - settings - - foreground - #d3869b - - - - name - Storage - modifier, var, const, let - scope - meta.var.expr storage.type, storage.modifier - settings - - foreground - #d3869b - - - - name - Interpolation - scope - punctuation.definition.template-expression, punctuation.section.embedded - settings - - foreground - #7daea3 - - - - name - Spread - scope - keyword.operator.spread, keyword.operator.rest - settings - - fontStyle - bold - foreground - #ea6962 - - - - name - Operator, Misc - scope - keyword.operator, keyword.control.as, keyword.other, keyword.operator.bitwise.shift, punctuation, punctuation.definition.constant.markdown, punctuation.definition.string, punctuation.support.type.property-name, text.html.vue-html meta.tag, punctuation.definition.keyword, punctuation.terminator.rule, punctuation.definition.entity, punctuation.definition.tag, punctuation.separator.inheritance.php, punctuation.definition.tag.html, keyword.other.template, keyword.other.substitution, entity.name.operator, text.html.vue meta.tag.block.any.html, text.html.vue meta.tag.inline.any.html, text.html.vue meta.tag.other.html, text.html.twig meta.tag.inline.any.html, text.html.twig meta.tag.block.any.html, text.html.twig meta.tag.structure.any.html, text.html.twig meta.tag.any.html - settings - - foreground - #89b482 - - - - name - Import, Export, From, Default - scope - keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.default, meta.import keyword.other - settings - - foreground - #7daea3 - - - - name - Keyword - scope - keyword, keyword.control, keyword.other.important - settings - - foreground - #d3869b - - - - name - Keyword SQL - scope - keyword.other.DML - settings - - foreground - #7daea3 - - - - name - Keyword Operator Logical, Arrow, Ternary, Comparison - scope - keyword.operator.logical, storage.type.function, keyword.operator.bitwise, keyword.operator.ternary, keyword.operator.comparison, keyword.operator.relational, keyword.operator.or.regexp - settings - - foreground - #d3869b - - - - name - Tag - scope - entity.name.tag, entity.name.tag support.class.component, meta.tag - settings - - foreground - #ea6962 - - - - name - Tag Punctuation - scope - punctuation.definition.tag, punctuation.definition.tag.html, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html - settings - - foreground - #d3869b - - - - name - Blade - scope - keyword.blade, entity.name.function.blade - settings - - foreground - #7daea3 - - - - name - PHP - Embedded Tag - scope - punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php - settings - - foreground - #89b482 - - - - name - Smarty - Twig tag - Blade - scope - punctuation.definition.variable.smarty, punctuation.section.embedded.begin.smarty, punctuation.section.embedded.end.smarty, meta.tag.template.value.twig, punctuation.section.tag.twig, meta.tag.expression.twig, punctuation.definition.tag.expression.twig, punctuation.definition.tag.output.twig, variable.parameter.smarty - settings - - foreground - #7daea3 - - - - name - Smarty - Twig variable - function - scope - variable.other.property.twig, support.function.twig, meta.function-call.twig, keyword.control.twig, keyword.control.smarty, keyword.operator.other.twig, keyword.operator.comparison.twig, support.function.functions.twig, support.function.functions.twig, keyword.operator.assignment.twig, support.function.filters.twig, support.function.built-in.smarty, keyword.operator.smarty, text.blade text.html.blade custom.compiler.blade.php punctuation.section.embedded.php entity.name.tag.block.any.html, text.blade text.html.blade custom.compiler.blade.php punctuation.section.embedded.php constant.other.inline-data.html, text.blade text.html.blade custom.compiler.blade.php support.function constant.other.inline-data.html - settings - - foreground - #7daea3 - - - - name - Globals - PHP Constants etc - scope - constant.other.php, variable.other.global.safer, variable.other.global.safer punctuation.definition.variable, variable.other.global, variable.other.global punctuation.definition.variable, constant.other - settings - - foreground - #d8a657 - - - - name - Variables - scope - variable, support.variable, string constant.other.placeholder - settings - - foreground - #d4be98 - - - - name - Object Variable - scope - variable.other.object, support.module.node - settings - - foreground - #d4be98 - - - - name - Object Key - scope - meta.object-literal.key, meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js, string.alias.graphql, string.unquoted.graphql, string.unquoted.alias.graphql, meta.field.declaration.ts variable.object.property - settings - - foreground - #89b482 - - - - name - Object Property - scope - variable.other.property, support.variable.property, support.variable.property.dom, meta.function-call variable.other.object.property, variable.language.prototype, meta.property.object, variable.other.member - settings - - foreground - #7daea3 - - - - name - Object Property - scope - variable.other.object.property - settings - - foreground - #d4be98 - - - - name - Object Literal Member lvl 3 (Vue Prop Validation) - scope - meta.objectliteral meta.object.member meta.objectliteral meta.object.member meta.objectliteral meta.object.member meta.object-literal.key - settings - - foreground - #89b482 - - - - name - C-related Block Level Variables - scope - source.cpp meta.block variable.other - settings - - foreground - #ea6962 - - - - name - Other Variable - scope - support.other.variable - settings - - foreground - #ea6962 - - - - name - Methods - scope - meta.class-method.js entity.name.function.js, entity.name.method.js, variable.function.constructor, keyword.other.special-method, storage.type.cs - settings - - foreground - #7daea3 - - - - name - Function Definition - scope - entity.name.function, meta.function-call, meta.function-call entity.name.function, variable.function, meta.definition.method entity.name.function, meta.object-literal entity.name.function - settings - - foreground - #7daea3 - - - - name - Function Argument - scope - variable.parameter.function.language.special, variable.parameter, meta.function.parameters punctuation.definition.variable, meta.function.parameter variable - settings - - foreground - #d8a657 - - - - name - Constant, Tag Attribute - scope - keyword.other.type.php, storage.type.php, constant.character, constant.escape, keyword.other.unit - settings - - foreground - #d3869b - - - - name - Variable Definition - scope - meta.definition.variable variable.other.constant, meta.definition.variable variable.other.readwrite, variable.other.declaration - settings - - foreground - #d3869b - - - - name - Inherited Class - scope - entity.other.inherited-class - settings - - fontStyle - - foreground - #d3869b - - - - name - Class, Support, DOM, etc - scope - support.class, support.type, variable.other.readwrite.alias, support.orther.namespace.use.php, meta.use.php, support.other.namespace.php, support.type.sys-types, support.variable.dom, support.constant.math, support.type.object.module, support.constant.json, entity.name.namespace, meta.import.qualifier, entity.name.class - settings - - foreground - #89b482 - - - - name - Class Name - scope - entity.name - settings - - foreground - #d4be98 - - - - name - Support Function - scope - support.function - settings - - foreground - #7daea3 - - - - name - CSS Class and Support - scope - source.css support.type.property-name, source.sass support.type.property-name, source.scss support.type.property-name, source.less support.type.property-name, source.stylus support.type.property-name, source.postcss support.type.property-name, support.type.property-name.css, support.type.vendored.property-name, support.type.map.key - settings - - foreground - #7daea3 - - - - name - CSS Font - scope - support.constant.font-name, meta.definition.variable - settings - - foreground - #a9b665 - - - - name - CSS Class - scope - entity.other.attribute-name.class, meta.at-rule.mixin.scss entity.name.function.scss - settings - - foreground - #a9b665 - - - - name - CSS ID - scope - entity.other.attribute-name.id - settings - - foreground - #ea6962 - - - - name - CSS Tag - scope - entity.name.tag.css, entity.name.tag.reference, entity.name.tag.scss - settings - - foreground - #89b482 - - - - name - CSS Tag Reference - scope - entity.name.tag.reference - settings - - foreground - #d8a657 - - - - name - CSS Property Separator - scope - meta.property-list punctuation.separator.key-value - settings - - foreground - #89b482 - - - - name - CSS Punctuation - scope - meta.property-list, punctuation.definition.entity.css - settings - - foreground - #d8a657 - - - - name - SCSS @ - scope - meta.at-rule.mixin keyword.control.at-rule.mixin, meta.at-rule.include entity.name.function.scss, meta.at-rule.include keyword.control.at-rule.include - settings - - foreground - #d3869b - - - - name - SCSS Mixins, Extends, Include Keyword - scope - keyword.control.at-rule.include punctuation.definition.keyword, keyword.control.at-rule.mixin punctuation.definition.keyword, meta.at-rule.include keyword.control.at-rule.include, keyword.control.at-rule.extend punctuation.definition.keyword, meta.at-rule.extend keyword.control.at-rule.extend, entity.other.attribute-name.placeholder.css punctuation.definition.entity.css, meta.at-rule.media keyword.control.at-rule.media, meta.at-rule.mixin keyword.control.at-rule.mixin, meta.at-rule.function keyword.control.at-rule.function, keyword.control punctuation.definition.keyword, meta.at-rule.import.scss entity.other.attribute-name.placeholder.scss punctuation.definition.entity.scss, meta.at-rule.import.scss keyword.control.at-rule.import.scss - settings - - foreground - #d3869b - - - - name - SCSS Include Mixin Argument - scope - meta.property-list meta.at-rule.include - settings - - foreground - #d4be98 - - - - name - CSS value - scope - support.constant.property-value - settings - - foreground - #e78a4e - - - - name - Sub-methods - scope - entity.name.module.js, variable.import.parameter.js, variable.other.class.js - settings - - foreground - #d4be98 - - - - name - Language methods - scope - variable.language - settings - - foreground - #ea6962 - - - - name - Variable punctuation - scope - variable.other punctuation.definition.variable - settings - - foreground - #d4be98 - - - - name - Keyword this with Punctuation, ES7 Bind Operator - scope - source.js constant.other.object.key.js string.unquoted.label.js, variable.language.this punctuation.definition.variable, keyword.other.this - settings - - foreground - #ea6962 - - - - name - HTML Attributes - scope - entity.other.attribute-name, text.html.basic entity.other.attribute-name.html, text.html.basic entity.other.attribute-name, text.blade entity.other.attribute-name.class, text.html.smarty entity.other.attribute-name.class - settings - - foreground - #d3869b - - - - name - Vue Template attributes - scope - meta.directive.vue punctuation.separator.key-value.html, meta.directive.vue entity.other.attribute-name.html - settings - - foreground - #d3869b - - - - name - Vue Template attribute separator - scope - meta.directive.vue punctuation.separator.key-value.html - settings - - foreground - #89b482 - - - - name - CSS IDs - scope - source.sass keyword.control - settings - - foreground - #7daea3 - - - - name - CSS pseudo selectors - scope - entity.other.attribute-name.pseudo-class, entity.other.attribute-name.pseudo-element, entity.other.attribute-name.placeholder, meta.property-list meta.property-value - settings - - foreground - #d3869b - - - - name - Inserted - scope - markup.inserted - settings - - foreground - #a9b665 - - - - name - Deleted - scope - markup.deleted - settings - - foreground - #ea6962 - - - - name - Changed - scope - markup.changed - settings - - foreground - #7daea3 - - - - name - Regular Expressions - scope - string.regexp - settings - - foreground - #89b482 - - - - name - Regular Expressions - Punctuation - scope - punctuation.definition.group - settings - - foreground - #ea6962 - - - - name - Regular Expressions - Character Class - scope - constant.other.character-class.regexp - settings - - foreground - #d3869b - - - - name - Regular Expressions - Character Class Set - scope - constant.other.character-class.set.regexp, punctuation.definition.character-class.regexp - settings - - foreground - #d8a657 - - - - name - Regular Expressions - Quantifier - scope - keyword.operator.quantifier.regexp - settings - - foreground - #89b482 - - - - name - Regular Expressions - Backslash - scope - constant.character.escape.backslash - settings - - foreground - #d4be98 - - - - name - Escape Characters - scope - constant.character.escape - settings - - foreground - #89b482 - - - - name - Decorators - scope - tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js - settings - - foreground - #7daea3 - - - - name - CSS Units - scope - keyword.other.unit - settings - - foreground - #ea6962 - - - - name - JSON Key - Level 0 - scope - source.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #7daea3 - - - - name - JSON Key - Level 1 - scope - source.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #89b482 - - - - name - JSON Key - Level 2 - scope - source.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #7daea3 - - - - name - JSON Key - Level 3 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #d3869b - - - - name - JSON Key - Level 4 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #d8a657 - - - - name - JSON Key - Level 5 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #89b482 - - - - name - JSON Key - Level 6 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #89b482 - - - - name - JSON Key - Level 7 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json - settings - - foreground - #ea6962 - - - - name - JSON Key - Level 8 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json punctuation.definition.string.end.json - settings - - foreground - #a9b665 - - - - name - JSON Key - value - scope - source.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json - settings - - foreground - #a9b665 - - - - name - Plain Punctuation - scope - punctuation.definition.list_item.markdown - settings - - foreground - #89b482 - - - - name - Block Punctuation - scope - meta.block, meta.brace, punctuation.definition.block, punctuation.definition.use, punctuation.definition.group.shell, punctuation.definition.class, punctuation.definition.begin.bracket, punctuation.definition.end.bracket, punctuation.definition.parameters, punctuation.definition.arguments, punctuation.definition.dictionary, punctuation.definition.array, punctuation.section - settings - - foreground - #89b482 - - - - name - Markdown - Plain - scope - meta.jsx.children, meta.embedded.block - settings - - foreground - #d4be98 - - - - name - HTML text - scope - text.html - settings - - foreground - #7daea3 - - - - name - Markdown - Markup Raw Inline - scope - text.html.markdown markup.inline.raw.markdown - settings - - foreground - #d3869b - - - - name - Markdown - Markup Raw Inline Punctuation - scope - text.html.markdown markup.inline.raw.markdown punctuation.definition.raw.markdown - settings - - foreground - #7c6f64 - - - - name - Markdown - Heading 1 - scope - heading.1.markdown entity.name, heading.1.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #89b482 - - - - name - Markdown - Heading 2 - scope - heading.2.markdown entity.name, heading.2.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #89b482 - - - - name - Markdown - Heading 3 - scope - heading.3.markdown entity.name, heading.3.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #7daea3 - - - - name - Markdown - Heading 4 - scope - heading.4.markdown entity.name, heading.4.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #7daea3 - - - - name - Markdown - Heading 5 - scope - heading.5.markdown entity.name, heading.5.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #7daea3 - - - - name - Markdown - Heading 6 - scope - heading.6.markdown entity.name, heading.6.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #a89984 - - - - name - Markup - Italic - scope - markup.italic, markup.italic punctuation - settings - - fontStyle - italic - foreground - #d4be98 - - - - name - Markup - Bold - scope - markup.bold, markup.bold punctuation - settings - - fontStyle - bold - foreground - #d4be98 - - - - name - Markup - Bold-Italic - scope - markup.bold markup.italic, markup.bold markup.italic punctuation - settings - - fontStyle - bold italic - foreground - #d4be98 - - - - name - Markup - Underline - scope - markup.underline, markup.underline punctuation - settings - - fontStyle - underline - - - - name - Markdown - Blockquote - scope - markup.quote punctuation.definition.blockquote.markdown - settings - - foreground - #7c6f64 - - - - name - Markup - Quote - scope - markup.quote - settings - - fontStyle - italic - - - - name - Markdown - Link - scope - string.other.link, markup.underline.link, constant.other.reference.link.markdown, string.other.link.description.title.markdown - settings - - foreground - #89b482 - - - - name - Markdown - Fenced Code Block - scope - markup.fenced_code.block.markdown, markup.inline.raw.string.markdown, variable.language.fenced.markdown - settings - - foreground - #89b482 - - - - name - Markdown - Separator - scope - meta.separator - settings - - fontStyle - bold - foreground - #7c6f64 - - - - name - Markup - Table - scope - markup.table - settings - - foreground - #d4be98 - - - - name - Token - Info - scope - token.info-token - settings - - foreground - #89b482 - - - - name - Token - Warn - scope - token.warn-token - settings - - foreground - #d8a657 - - - - name - Token - Error - scope - token.error-token - settings - - foreground - #ea6962 - - - - name - Token - Debug - scope - token.debug-token - settings - - foreground - #d3869b - - - - name - Apache Tag - scope - entity.tag.apacheconf - settings - - foreground - #ea6962 - - - - name - Preprocessor - scope - meta.preprocessor - settings - - foreground - #89b482 - - - - name - ENV value - scope - source.env - settings - - foreground - #7daea3 - - - - uuid - 06f855e3-9fb7-4fb1-b790-aef06065f34e - - diff --git a/yazi_1/.config/yazi/flavors/kanagawa.yazi/LICENSE b/yazi_1/.config/yazi/flavors/kanagawa.yazi/LICENSE deleted file mode 100644 index 1b1dfdc..0000000 --- a/yazi_1/.config/yazi/flavors/kanagawa.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Dmitry Nefedov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme b/yazi_1/.config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme deleted file mode 100644 index 1b1dfdc..0000000 --- a/yazi_1/.config/yazi/flavors/kanagawa.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Dmitry Nefedov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/kanagawa.yazi/README.md b/yazi_1/.config/yazi/flavors/kanagawa.yazi/README.md deleted file mode 100644 index d314236..0000000 --- a/yazi_1/.config/yazi/flavors/kanagawa.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Kanagawa Flavor for Yazi -

- -## 👀 Preview - - - -## 🎹 Installation - -```bash -ya pkg add dangooddd/kanagawa -``` - -## ⚙ Usage - -> [!Note] -> To achieve the look like in the screenshot you also need to install -> [full-border](https://github.com/yazi-rs/plugins/tree/main/full-border.yazi) plugin! - -Add these lines to your `theme.toml` configuration file to use it: - -```toml -[flavor] -dark = "kanagawa" -``` - -## 📜 License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/yazi_1/.config/yazi/flavors/kanagawa.yazi/flavor.toml b/yazi_1/.config/yazi/flavors/kanagawa.yazi/flavor.toml deleted file mode 100644 index 7703335..0000000 --- a/yazi_1/.config/yazi/flavors/kanagawa.yazi/flavor.toml +++ /dev/null @@ -1,143 +0,0 @@ -## Color palette -## Check https://github.com/rebelot/kanagawa.nvim for more details -# sumiInk0 "#16161d" dark bg -# sumiInk3 "#1f1f28" bg -# sumiInk4 "#2a2a37" -# sumiInk6 "#54546d" -# fujiWhite "#dcd7ba" fg -# oldWhite "#c8c093" dark fg -# fujiGray "#727169" -# peachRed "#ff5d62" -# autumnRed "#c34043" -# crystalBlue "#7e9cd8" -# waveRed "#e46876" -# carpYellow "#e6c384" -# springGreen "#98bb6c" -# autumnGreen "#76946a" -# oniViolet "#957fb8" -# waveAqua1 "#6a9589" -# surimiOrange "#ffa066" -# waveAqua2 "#7aa89f" - -[mgr] -marker_copied = { fg = "#98bb6c", bg = "#98bb6c" } -marker_cut = { fg = "#e46876", bg = "#e46876" } -marker_marked = { fg = "#957fb8", bg = "#957fb8" } -marker_selected = { fg = "#ffa066", bg = "#ffa066" } - -cwd = { fg = "#e6c384" } - -find_keyword = { fg = "#ffa066", bg = "#1f1f28" } -find_position = {} - -count_copied = { fg = "#1f1f28", bg = "#98bb6c" } -count_cut = { fg = "#1f1f28", bg = "#e46876" } -count_selected = { fg = "#1f1f28", bg = "#ffa066" } - -border_symbol = "│" -border_style = { fg = "#dcd7ba" } - -[indicator] -parent = { reversed = true } -current = { reversed = true } -preview = { reversed = true } - -[tabs] -active = { fg = "#1f1f28", bg = "#7e9cd8" } -inactive = { fg = "#7e9cd8", bg = "#2a2a37" } - -sep_inner = { open = "", close = "" } -sep_outer = { open = "", close = "" } - - -[mode] -normal_main = { fg = "#1f1f28", bg = "#7e9cd8" } -normal_alt = { fg = "#7e9cd8", bg = "#2a2a37" } -select_main = { fg = "#1f1f28", bg = "#957fb8" } -select_alt = { fg = "#957fb8", bg = "#2a2a37" } -unset_main = { fg = "#1f1f28", bg = "#e6c384" } -unset_alt = { fg = "#e6c384", bg = "#2a2a37" } - - -[status] -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } -overall = { fg = "#c8c093", bg = "#16161d" } - -progress_label = { fg = "#7e9cd8", bold = true } -progress_normal = { fg = "#2a2a37", bg = "#1f1f28" } -progress_error = { fg = "#2a2a37", bg = "#1f1f28" } - -perm_type = { fg = "#98bb6c" } -perm_read = { fg = "#e6c384" } -perm_write = { fg = "#ff5d62" } -perm_exec = { fg = "#7aa89f" } -perm_sep = { fg = "#957fb8" } - - -[pick] -border = { fg = "#7fb4ca" } -active = { fg = "#957fb8", bold = true } -inactive = {} - -[input] -border = { fg = "#7fb4ca" } -title = {} -value = {} -selected = { reversed = true } - -[completion] -border = { fg = "#7fb4ca" } -active = { reversed = true } -inactive = {} - -[tasks] -border = { fg = "#7fb4ca" } -title = {} -hovered = { fg = "#957fb8" } - -[which] -cols = 2 -separator = " - " -separator_style = { fg = "#727169" } -mask = { bg = "#16161d" } -rest = { fg = "#727169" } -cand = { fg = "#7e9cd8" } -desc = { fg = "#54546d" } - -[help] -on = { fg = "#7aa89f" } -run = { fg = "#957fb8" } -desc = {} -hovered = { reversed = true, bold = true } -footer = { fg = "#1f1f28", bg = "#dcd7ba" } - -[notify] -title_info = { fg = "#98bb6c" } -title_warn = { fg = "#e6c384" } -title_error = { fg = "#ff5d62" } - -[filetype] -rules = [ - # images - { mime = "image/*", fg = "#e6c384" }, - - # media - { mime = "{audio,video}/*", fg = "#957fb8" }, - - # archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#e46876" }, - - # documents - { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#6a9589" }, - - # broken links - { url = "*", is = "orphan", fg = "#c34043" }, - - # executables - { url = "*", is = "exec", fg = "#76946a" }, - - # fallback - { url = "*", fg = "#dcd7ba" }, - { url = "*/", fg = "#7e9cd8" }, -] diff --git a/yazi_1/.config/yazi/flavors/kanagawa.yazi/preview.png b/yazi_1/.config/yazi/flavors/kanagawa.yazi/preview.png deleted file mode 100644 index 87d0767..0000000 Binary files a/yazi_1/.config/yazi/flavors/kanagawa.yazi/preview.png and /dev/null differ diff --git a/yazi_1/.config/yazi/flavors/kanagawa.yazi/tmtheme.xml b/yazi_1/.config/yazi/flavors/kanagawa.yazi/tmtheme.xml deleted file mode 100644 index 737e459..0000000 --- a/yazi_1/.config/yazi/flavors/kanagawa.yazi/tmtheme.xml +++ /dev/null @@ -1,448 +0,0 @@ - - - - - name - Kanagawa - settings - - - settings - - background - #1F1F28 - caret - #C8C093 - foreground - #DCD7BA - invisibles - #54546D - lineHighlight - #2D4F67 - selection - #2D4F67 - findHighlight - #2D4F67 - selectionBorder - #222218 - gutterForeground - #54546D - - - - name - Comment - scope - comment - settings - - foreground - #727169 - - - - name - String - scope - string - settings - - foreground - #98BB6C - - - - name - Number - scope - constant.numeric - settings - - foreground - #D27E99 - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #FFA066 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #E6C384 - - - - name - Variable - scope - variable - settings - - fontStyle - #E6C384 - - - - name - Ruby's @variable - scope - variable.other.readwrite.instance - settings - - fontStyle - - foreground - #E6C384 - - - - name - String interpolation - scope - constant.character.escaped, constant.character.escape, string source, string source.ruby - settings - - fontStyle - - foreground - #C0A36E - - - - name - Keyword - scope - keyword - settings - - foreground - #E46876 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #957FB8 - - - - name - Storage type - scope - storage.type - settings - - foreground - #957FB8 - - - - name - Class name - scope - entity.name.class - settings - - foreground - #7AA89F - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - foreground - #7AA89F - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - - foreground - #7E9CD8 - - - - name - Function argument - scope - variable.parameter - settings - - foreground - #b8b4d0 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #E6C384 - - - - name - Library function - scope - support.function - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Library constant - scope - support.constant - settings - - fontStyle - - foreground - #7FB4CA - - - - name - Library class/type - scope - support.type, support.class - settings - - foreground - #7AA89F - - - - name - Library variable - scope - support.other.variable - settings - - foreground - #FFA066 - - - - name - Invalid - scope - invalid - settings - - fontStyle - - foreground - #FF5D62 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #717C7C - - - - name - JSON String - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #957FB8 - - - - name - diff.header - scope - meta.diff, meta.diff.header - settings - - foreground - #7E9CD8 - - - - name - diff.deleted - scope - markup.deleted - settings - - background - #43242B - - - - name - diff.inserted - scope - markup.inserted - settings - - background - #2B3328 - - - - name - diff.changed - scope - markup.changed - settings - - background - #49443C - - - - scope - constant.numeric.line-number.find-in-files - match - settings - - foreground - #54546D - - - - scope - entity.name.filename - settings - - foreground - #C8C093 - - - - scope - message.error - settings - - foreground - #E82424 - - - - name - JSON Punctuation - scope - punctuation.definition.string.begin.json - meta.structure.dictionary.value.json, punctuation.definition.string.end.json - meta.structure.dictionary.value.json - settings - - foreground - #9CABCA - - - - name - JSON Structure - scope - meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #957FB8 - - - - name - JSON String - scope - meta.structure.dictionary.value.json string.quoted.double.json - settings - - foreground - #ffffff - - - - name - Escape Characters - scope - constant.character.escape - settings - - foreground - #FF5D62 - - - - name - Regular Expressions - scope - string.regexp - settings - - foreground - #E6C384 - - - - uuid - 592FC036-6BB7-4676-A2F5-2894D48C8E33 - colorSpaceName - sRGB - semanticClass - theme.dark.kanagawa - - diff --git a/yazi_1/.config/yazi/flavors/monokai.yazi/LICENSE b/yazi_1/.config/yazi/flavors/monokai.yazi/LICENSE deleted file mode 100644 index e69de29..0000000 diff --git a/yazi_1/.config/yazi/flavors/monokai.yazi/LICENSE-tmtheme b/yazi_1/.config/yazi/flavors/monokai.yazi/LICENSE-tmtheme deleted file mode 100644 index e69de29..0000000 diff --git a/yazi_1/.config/yazi/flavors/monokai.yazi/README.md b/yazi_1/.config/yazi/flavors/monokai.yazi/README.md deleted file mode 100644 index 6303635..0000000 --- a/yazi_1/.config/yazi/flavors/monokai.yazi/README.md +++ /dev/null @@ -1,37 +0,0 @@ -
- Yazi logo -
- -

- Monokai flavor for Yazi -

- -## 👀 Preview - - - -## 🎹 Installation - - -```sh -ya pkg add malick-tammal/monokai -``` - -## ⚙ Usage - -Add it to your `theme.toml` as dark flavor: - -```toml -[flavor] -dark = "monokai" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## 📜 License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/yazi_1/.config/yazi/flavors/monokai.yazi/flavor.toml b/yazi_1/.config/yazi/flavors/monokai.yazi/flavor.toml deleted file mode 100644 index fab2a95..0000000 --- a/yazi_1/.config/yazi/flavors/monokai.yazi/flavor.toml +++ /dev/null @@ -1,182 +0,0 @@ -#---------------------------------------------------------- -#-- HACK: Monokai -#---------------------------------------------------------- - -[mgr] -cwd = { fg = "#78DCE8" } - -# Hovered -hovered = { reversed = true } -preview_hovered = { underline = true } - -# Find -find_symbol = " Finding: " -find_keyword = { fg = "#FF6188", bold = true, italic = true, underline = true } -find_position = { fg = "#AB9DF2", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { fg = "#78DCE8", italic = true } - -# Marker -marker_copied = { fg = "#A9DC76", bg = "#A9DC76" } -marker_cut = { fg = "lightred", bg = "lightred" } -marker_marked = { fg = "#AB9DF2", bg = "#AB9DF2" } -marker_selected = { fg = "#FF6188", bg = "#FF6188" } - -# Count -count_copied = { fg = "#221F22", bg = "#A9DC76" } -count_cut = { fg = "#221F22", bg = "#FF6188" } -count_selected = { fg = "#221F22", bg = "#FFD866" } - -# Border -border_symbol = "│" -border_style = { fg = "#727072" } - -# Tabs -[tabs] -active = { fg = "#221F22", bg = "#FFD866", bold = true } -inactive = { fg = "#FFD866", bg = "#221F22" } - -# Separator -sep_inner = { open = "", close = "" } -sep_outer = { open = "", close = "" } - -# Modes -[mode] -# Normal mode -normal_main = { fg = "#2D2A2E", bg = "#FFD866", bold = true } -normal_alt = { fg = "#FFD866", bg = "#403E41" } - -# Select mode -select_main = { fg = "#2D2A2E", bg = "#AB9DF2", bold = true } -select_alt = { fg = "#AB9DF2", bg = "#403E41" } - -# Unset mode -unset_main = { bg = "#FF6188", bold = true } -unset_alt = { fg = "#FF6188", bg = "gray" } - -# Status bar -[status] -overall = {} -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } - -# Permissions -perm_sep = { fg = "#727072" } -perm_type = { fg = "#A9DC76" } -perm_read = { fg = "#FFD866" } -perm_write = { fg = "#FF6188" } -perm_exec = { fg = "#78DCE8" } - -# Progress -progress_label = { bold = true } -progress_normal = { fg = "#78DCE8", bg = "#2D2A2E" } -progress_error = { fg = "#FF6188", bg = "#2D2A2E" } - -# Which -[which] -cols = 3 -mask = { bg = "#2D2A2E" } -cand = { fg = "lightcyan" } -rest = { fg = "#727072" } -desc = { fg = "lightmagenta" } -separator = " îȘœ " -separator_style = { fg = "#727072" } - -# Confirmation -[confirm] -border = { fg = "#FFD866" } -title = { fg = "#FFD866" } -content = {} -list = {} -btn_yes = { reversed = true } -btn_no = {} -btn_labels = [" [Y]es ", " (N)o "] - -# Spotter -[spot] -border = { fg = "#78DCE8" } -title = { fg = "#78DCE8" } - -# Table -tbl_col = { fg = "#78DCE8" } -tbl_cell = { fg = "#FFD866", reversed = true } - -# Norifications -[notify] -title_info = { fg = "#A9DC76" } -title_warn = { fg = "#FFD866" } -title_error = { fg = "#FF6188" } - -# Icons -icon_info = "" -icon_warn = "" -icon_error = "" - -# Picker -[pick] -border = { fg = "#78DCE8" } -active = { fg = "#AB9DF2", bold = true } -inactive = {} - -# Input -[input] -border = { fg = "#78DCE8" } -title = {} -value = {} -selected = { reversed = true } - -# Completion -[cmp] -border = { fg = "#78DCE8" } -active = { reversed = true } -inactive = {} - -# Icons -icon_file = "" -icon_folder = "" -icon_command = "" - -# : Task manager {{{ -[tasks] -border = { fg = "#78DCE8" } -title = {} -hovered = { fg = "#AB9DF2", underline = true } - -# Help menu -[help] -on = { fg = "#78DCE8" } -run = { fg = "#AB9DF2" } -desc = {} -hovered = { reversed = true, bold = true } -footer = { fg = "#221F22", bg = "#FDFFF1" } - -# File-specific styles -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#FFD866" }, - - # Media - { mime = "{audio,video}/*", fg = "#A9DC76" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#FF6188" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#78DCE8" }, - - # Empty files - { mime = "inode/empty", fg = "#FF6188" }, - - # Special files - { url = "*", is = "orphan", bg = "#FF6188" }, - { url = "*", is = "exec", fg = "#A9DC76" }, - - # Dummy files - { url = "*", is = "dummy", bg = "#FF6188" }, - { url = "*/", is = "dummy", bg = "#FF6188" }, - - # Fallback - { url = "*/", fg = "#FC9767", bold = true }, -] diff --git a/yazi_1/.config/yazi/flavors/monokai.yazi/preview.png b/yazi_1/.config/yazi/flavors/monokai.yazi/preview.png deleted file mode 100644 index 5b71ba8..0000000 Binary files a/yazi_1/.config/yazi/flavors/monokai.yazi/preview.png and /dev/null differ diff --git a/yazi_1/.config/yazi/flavors/monokai.yazi/tmtheme.xml b/yazi_1/.config/yazi/flavors/monokai.yazi/tmtheme.xml deleted file mode 100644 index fbf090b..0000000 --- a/yazi_1/.config/yazi/flavors/monokai.yazi/tmtheme.xml +++ /dev/null @@ -1,300 +0,0 @@ - - - - - gutterSettings - - background - #49483E - divider - #75715E - foreground - #75715E - - name - Monokai - semanticClass - theme.dark.monokai - settings - - - settings - - background - #272822 - caret - #F8F8F0 - foreground - #F8F8F2 - invisibles - #49483E - lineHighlight - #49483E - selection - #49483E - - - - name - Comment - scope - comment - settings - - foreground - #75715E - - - - name - String - scope - string - settings - - foreground - #E6DB74 - - - - name - Number - scope - constant.numeric - settings - - foreground - #AE81FF - - - - name - Built-in constant - scope - constant.language - settings - - foreground - #AE81FF - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #AE81FF - - - - name - Variable - scope - variable - settings - - fontStyle - - - - - name - Keyword - scope - keyword - settings - - foreground - #F92672 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #F92672 - - - - name - Storage type - scope - storage.type - settings - - fontStyle - italic - foreground - #66D9EF - - - - name - Class name - scope - entity.name.class - settings - - fontStyle - underline - foreground - #A6E22E - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - italic underline - foreground - #A6E22E - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - - foreground - #A6E22E - - - - name - Function argument - scope - variable.parameter - settings - - fontStyle - italic - foreground - #FD971F - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - - foreground - #F92672 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #A6E22E - - - - name - Library function - scope - support.function - settings - - fontStyle - - foreground - #66D9EF - - - - name - Library constant - scope - support.constant - settings - - fontStyle - - foreground - #66D9EF - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - italic - foreground - #66D9EF - - - - name - Library variable - scope - support.other.variable - settings - - fontStyle - - - - - name - Invalid - scope - invalid - settings - - background - #F92672 - fontStyle - - foreground - #F8F8F0 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - background - #AE81FF - foreground - #F8F8F0 - - - - uuid - D8D5E82E-3D5B-46B5-B38E-8C841C21347D - - diff --git a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE b/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE deleted file mode 100644 index 78e74c8..0000000 --- a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Mintass - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE-tmtheme b/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE-tmtheme deleted file mode 100644 index ef13b56..0000000 --- a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 RosĂ© Pine - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/README.md b/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/README.md deleted file mode 100644 index b241c25..0000000 --- a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
- Yazi logo -
- -

- Rosé Pine Moon Flavor for Yazi -

- -## 👀 Preview - - - -## 🎹 Installation - -```sh -ya pkg add Mintass/rose-pine-moon -``` - -## ⚙ Usage - -To set it as your dark flavor, change the content of your `theme.toml` to: - -```toml -[flavor] -dark = "rose-pine-moon" -``` - -Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor. - -See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details. - -## 📜 License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/flavor.toml b/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/flavor.toml deleted file mode 100644 index 67fb881..0000000 --- a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/flavor.toml +++ /dev/null @@ -1,253 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : App {{{ - -[app] -overall = { bg = "#232136" } - -# : }}} - - -# : Manager {{{ - -[mgr] -cwd = { fg = "#9ccfd8" } - -# Find -find_keyword = { fg = "#f6c177", bold = true, italic = true, underline = true } -find_position = { fg = "#c4a7e7", bg = "reset", bold = true, italic = true } - -# Symlink -symlink_target = { italic = true } - -# Marker -marker_copied = { fg = "#3e8fb0", bg = "#3e8fb0" } -marker_cut = { fg = "#eb6f92", bg = "#eb6f92" } -marker_marked = { fg = "#ea9a97", bg = "#ea9a97" } -marker_selected = { fg = "#f6c177", bg = "#f6c177" } - -# Count -count_copied = { fg = "#e0def4", bg = "#3e8fb0" } -count_cut = { fg = "#e0def4", bg = "#eb6f92" } -count_selected = { fg = "#232136", bg = "#f6c177" } - -# Border -border_symbol = "│" -border_style = { fg = "#56526e" } - -# Highlighting -syntect_theme = "" - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#e0def4", bg = "#3e8fb0", bold = true } -inactive = { fg = "#3e8fb0", bg = "#e0def4" } - -# Separator -sep_inner = { open = "", close = "" } -sep_outer = { open = "", close = "" } - -# : }}} - - -# : Mode {{{ - -[mode] -normal_main = { fg = "#232136", bg = "#9ccfd8", bold = true } -normal_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# Select mode -select_main = { fg = "#232136", bg = "#eb6f92", bold = true } -select_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# Unset mode -unset_main = { fg = "#232136", bg = "#eb6f92", bold = true } -unset_alt = { fg = "#232136", bg = "#e0def4", bold = true } - -# : }}} - - -# : Indicator of hovered file {{{ - -[indicator] -parent = { reversed = true } -current = { reversed = true } -preview = { underline = true } -padding = { open = "", close = "" } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = { bg = "#232136" } -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } - -# Permissions -perm_sep = { fg = "#6e6a86" } -perm_type = { fg = "#c4a7e7" } -perm_read = { fg = "#f6c177" } -perm_write = { fg = "#eb6f92" } -perm_exec = { fg = "#9ccfd8" } - -# Progress -progress_label = { fg = "#e0def4", bold = true } -progress_normal = { fg = "#3e8fb0", bg = "#2a283e" } -progress_error = { fg = "#eb6f92", bg = "#2a283e" } - -# : }}} - - -# : Which {{{ - -[which] -cols = 3 -mask = { bg = "#2a273f" } -cand = { fg = "#9ccfd8" } -rest = { fg = "#6e6a86" } -desc = { fg = "#f6c177" } -separator = " îȘœ " -separator_style = { fg = "#6e6a86" } - -# : }}} - - -# : Confirmation {{{ - -[confirm] -border = { fg = "#56526e" } -title = { fg = "#eb6f92", bold = true } -body = { fg = "#e0def4" } -list = { fg = "#e0def4" } -btn_yes = { fg = "#232136", bg = "#3e8fb0", bold = true } -btn_no = { fg = "#232136", bg = "#e0def4", bold = true } -btn_labels = [ " [y]es ", " (n)o " ] - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#56526e" } -title = { fg = "#9ccfd8", bold = true } - -# Table -tbl_col = { fg = "#9ccfd8" } -tbl_cell = { fg = "#232136", bg = "#f6c177", bold = true } - -# : }}} - - -# : Notification {{{ - -[notify] -title_info = { fg = "#3e8fb0" } -title_warn = { fg = "#f6c177" } -title_error = { fg = "#eb6f92" } - -# Icons -icon_info = "" -icon_warn = "" -icon_error = "" - -# : }}} - - -# : Picker {{{ - -[pick] -border = { fg = "#3e8fb0" } -active = { fg = "#c4a7e7", bold = true } -inactive = { fg = "#908caa" } - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#3e8fb0" } -title = { bold = true } -value = { fg = "#e0def4" } -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#3e8fb0" } -active = { bg = "#e0def4", fg = "#232136", bold = true } -inactive = { fg = "#908caa" } - -# Icons -icon_file = "" -icon_folder = "" -icon_command = "" - -# : }}} - - -# : Task manager {{{ - -[tasks] -border = { fg = "#3e8fb0" } -title = { bold = true } -hovered = { fg = "#c4a7e7", bold = true, reversed = true } - -# : }}} - - -# : Help menu {{{ - -[help] -on = { fg = "#9ccfd8" } -run = { fg = "#c4a7e7" } -desc = { fg = "#f6c177" } -hovered = { reversed = true, bold = true } -footer = { fg = "#232136", bg = "#e0def4" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] -rules = [ - # Images - { mime = "image/*", fg = "#c4a7e7" }, - - # Media - { mime = "{audio,video}/*", fg = "#f6c177" }, - - # Archives - { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#eb6f92" }, - - # Documents - { mime = "application/{pdf,doc,rtf}", fg = "#ea9a97" }, - - # Empty files - # { mime = "inode/empty", fg = "#eb6f92" }, - - # Special files - { url = "*", is = "orphan", fg = "#232136", bg = "#eb6f92" }, - { url = "*", is = "exec", fg = "#9ccfd8" }, - - # Dummy files - { url = "*", is = "dummy", fg = "#232136", bg = "#eb6f92" }, - { url = "*/", is = "dummy", fg = "#232136", bg = "#eb6f92" }, - - # Fallback - { url = "*", fg = "#e0def4" }, - { url = "*/", fg = "#3e8fb0" } -] - -# : }}} diff --git a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/preview.png b/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/preview.png deleted file mode 100644 index 9661964..0000000 Binary files a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/preview.png and /dev/null differ diff --git a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/tmtheme.xml b/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/tmtheme.xml deleted file mode 100644 index 3e26d9c..0000000 --- a/yazi_1/.config/yazi/flavors/rose-pine-moon.yazi/tmtheme.xml +++ /dev/null @@ -1,316 +0,0 @@ - - - - - name - RosĂ© Pine Moon - settings - - - settings - - background - #232136 - caret - #56526e - foreground - #e0def4 - invisibles - #2a273f - lineHighlight - #2a283e - selection - #6e6a86 - - - - name - Comment - scope - comment - settings - - fontStyle - italic - foreground - #908caa - - - - name - String - scope - string, punctuation.definition.string - settings - - foreground - #f6c177 - - - - name - Number - scope - constant.numeric - settings - - foreground - #f6c177 - - - - name - Built-in constant - scope - constant.language - settings - - fontStyle - bold - foreground - #f6c177 - - - - name - User-defined constant - scope - constant.character, constant.other - settings - - foreground - #f6c177 - - - - name - Variable - scope - variable - settings - - fontStyle - italic - foreground - #e0def4 - - - - name - Keyword - scope - keyword - settings - - foreground - #3e8fb0 - - - - name - Storage - scope - storage - settings - - fontStyle - - foreground - #9ccfd8 - - - - name - Storage type - scope - storage.type - settings - - fontStyle - - foreground - #9ccfd8 - - - - name - Class name - scope - entity.name.class - settings - - fontStyle - bold - foreground - #3e8fb0 - - - - name - Inherited class - scope - entity.other.inherited-class - settings - - fontStyle - italic - foreground - #3e8fb0 - - - - name - Function name - scope - entity.name.function - settings - - fontStyle - italic - foreground - #ea9a97 - - - - name - Function argument - scope - variable.parameter - settings - - fontStyle - - foreground - #c4a7e7 - - - - name - Tag name - scope - entity.name.tag - settings - - fontStyle - bold - foreground - #3e8fb0 - - - - name - Tag attribute - scope - entity.other.attribute-name - settings - - fontStyle - - foreground - #c4a7e7 - - - - name - Library function - scope - support.function - settings - - fontStyle - bold - foreground - #ea9a97 - - - - name - Library constant - scope - support.constant - settings - - fontStyle - bold - foreground - #f6c177 - - - - name - Library class/type - scope - support.type, support.class - settings - - fontStyle - bold - foreground - #9ccfd8 - - - - name - Library variable - scope - support.other.variable - settings - - fontStyle - bold - foreground - #eb6f92 - - - - name - Invalid - scope - invalid - settings - - background - #eb6f92 - fontStyle - - foreground - #e0def4 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - background - #c4a7e7 - foreground - #e0def4 - - - - name - Punctuation, Operators - scope - punctuation, keyword.operator - settings - - foreground - #908caa - - - - colorSpaceName - sRGB - semanticClass - theme.dark.rosĂ©-pine-moon - author - arrrgi - comment - All natural pine, faux fur and a bit of soho vibes for the classy minimalist - uuid - CC28B8FB-96BA-43EB-B71F-5AA3D3EBB0BB - - diff --git a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/LICENSE b/yazi_1/.config/yazi/flavors/tokyo-night.yazi/LICENSE deleted file mode 100644 index 9a5124e..0000000 --- a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 - sxyazi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/LICENSE-tmtheme b/yazi_1/.config/yazi/flavors/tokyo-night.yazi/LICENSE-tmtheme deleted file mode 100644 index 44b4479..0000000 --- a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/LICENSE-tmtheme +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Himanshu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/README.md b/yazi_1/.config/yazi/flavors/tokyo-night.yazi/README.md deleted file mode 100644 index 70eb613..0000000 --- a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/README.md +++ /dev/null @@ -1,47 +0,0 @@ -
- Yazi logo -
- -

- Tokyo Night Flavor for Yazi -

- -## 👀 Preview - - - -## 🎹 Installation - -### Using package manager - -```bash -ya pkg add BennyOe/tokyo-night -``` - -### Manual install - -```bash -# Linux/macOS -git clone https://github.com/BennyOe/tokyo-night.yazi.git ~/.config/yazi/flavors/tokyo-night.yazi - -# Windows -git clone https://github.com/BennyOe/tokyo-night.yazi.git %AppData%\yazi\config\flavors\tokyo-night.yazi -``` - -## ⚙ Usage - -Add the these lines to your `theme.toml` configuration file to use it: - - -```toml -[flavor] -use = "tokyo-night" -# For Yazi 0.4 and above -dark = "tokyo-night" -``` - -## 📜 License - -The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. - -Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/flavor.toml b/yazi_1/.config/yazi/flavors/tokyo-night.yazi/flavor.toml deleted file mode 100644 index 9f008c6..0000000 --- a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/flavor.toml +++ /dev/null @@ -1,201 +0,0 @@ -# vim:fileencoding=utf-8:foldmethod=marker - -# : Manager {{{ - -[mgr] -cwd = { fg = "#7aa2f7" } - -# Find -find_keyword = { fg = "#f7768e", bold = true, italic = true, underline = true } -find_position = { fg = "#bb9af7", bg = "reset", bold = true, italic = true } - -# Marker -marker_copied = { fg = "#9ece6a", bg = "#9ece6a" } -marker_cut = { fg = "#e0af68", bg = "#f7768e" } -marker_marked = { fg = "#7aa2f7", bg = "#7dcfff" } -marker_selected = { fg = "#e0af68", bg = "#e0af68" } - -# Count -count_copied = { fg = "#1a1b26", bg = "#9ece6a" } -count_cut = { fg = "#1a1b26", bg = "#e0af68" } -count_selected = { fg = "#1a1b26", bg = "#7aa2f7" } - -# Border -border_symbol = "│" -border_style = { fg = "#414868" } - -# : }}} - - -# : Tabs {{{ - -[tabs] -active = { fg = "#292e42", bg = "#7aa2f7", bold = true } -inactive = { fg = "#7aa2f7", bg = "#292e42" } - -# : }}} - - -# : Mode {{{ - -[mode] - -normal_main = { fg = "#292e42", bg = "#7aa2f7", bold = true } -normal_alt = { fg = "#7aa2f7", bg = "#292e42" } - -# Select mode -select_main = { fg = "#292e42", bg = "#9ece6a", bold = true } -select_alt = { fg = "#7aa2f7", bg = "#292e42" } - -# Unset mode -unset_main = { fg = "#292e42", bg = "#bb9af7", bold = true } -unset_alt = { fg = "#7aa2f7", bg = "#292e42" } - -# : }}} - - -# : Status bar {{{ - -[status] -overall = { fg = "#7aa2f7" } -sep_left = { open = "", close = "" } -sep_right = { open = "", close = "" } - - -# Progress -progress_label = { fg = "#292e42", bold = true } -progress_normal = { fg = "#7aa2f7", bg = "#292e42" } -progress_error = { fg = "#f7768e", bg = "#292e42" } - -# Permissions -perm_sep = { fg = "#7aa2f7" } -perm_type = { fg = "#9ece6a" } -perm_read = { fg = "#e0af68" } -perm_write = { fg = "#f7768e" } -perm_exec = { fg = "#bb9af7" } - - -# : }}} - -# : Pick {{{ - -[pick] -border = { fg = "#7aa2f7" } -active = { fg = "#bb9af7", bold = true } -inactive = {} - -# : }}} - - -# : Input {{{ - -[input] -border = { fg = "#7aa2f7" } -title = {} -value = {} -selected = { reversed = true } - -# : }}} - - -# : Completion {{{ - -[cmp] -border = { fg = "#7aa2f7" } - -# : }}} - - -# : Tasks {{{ - -[tasks] -border = { fg = "#7aa2f7" } -title = {} -hovered = { fg = "#bb9af7", underline = true } - -# : }}} - - -# : Which {{{ - -[which] -mask = { bg = "#414868" } -cand = { fg = "#9ece6a" } -rest = { fg = "#a9b1d6" } -desc = { fg = "#bb9af7" } -separator = " îȘœ " -separator_style = { fg = "#626880" } - -# : }}} - - -# : Help {{{ - -[help] -on = { fg = "#9ece6a" } -run = { fg = "#bb9af7" } -hovered = { reversed = true, bold = true } -footer = { fg = "#1a1b26", bg = "#a9b1d6" } - -# : }}} - - -# : Spotter {{{ - -[spot] -border = { fg = "#7aa2f7" } -title = { fg = "#7aa2f7" } -tbl_col = { fg = "#9ece6a" } -tbl_cell = { fg = "#bb9af7", bg = "#292e42" } - -# : }}} - - -# : Notify {{{ - -[notify] -title_info = { fg = "#9ece6a" } -title_warn = { fg = "#f7768e" } -title_error = { fg = "#e0af68" } - -# : }}} - - -# : File-specific styles {{{ - -[filetype] - -rules = [ - # Images - { mime = "image/*", fg = "#e0af68" }, - - # Media - { mime = "video/*", fg = "#f7768e" }, - { mime = "audio/*", fg = "#f7768e" }, - - # Archives - { mime = "application/zip", fg = "#bb9af7" }, - { mime = "application/x-tar", fg = "#bb9af7" }, - { mime = "application/x-bzip*", fg = "#bb9af7" }, - { mime = "application/x-bzip2", fg = "#bb9af7" }, - { mime = "application/x-7z-compressed", fg = "#bb9af7" }, - { mime = "application/x-rar", fg = "#bb9af7" }, - { mime = "application/x-xz", fg = "#bb9af7" }, - - # Documents - { mime = "application/doc", fg = "#9ece6a" }, - { mime = "application/epub+zip", fg = "#9ece6a" }, - { mime = "application/pdf", fg = "#9ece6a" }, - { mime = "application/rtf", fg = "#9ece6a" }, - { mime = "application/vnd.*", fg = "#9ece6a" }, - - # Special files - { mime = "*", is = "orphan", fg = "#f29cb4", bg = "#93000a" }, - { mime = "application/*exec*", fg = "#f7768e" }, - - # Fallback - { url = "*", fg = "#c6d0f5" }, - { url = "*/", fg = "#7aa2f7" }, -] - -# : }}} diff --git a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/preview.png b/yazi_1/.config/yazi/flavors/tokyo-night.yazi/preview.png deleted file mode 100644 index 75f2f4a..0000000 Binary files a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/preview.png and /dev/null differ diff --git a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/tmtheme.xml b/yazi_1/.config/yazi/flavors/tokyo-night.yazi/tmtheme.xml deleted file mode 100644 index 21d2163..0000000 --- a/yazi_1/.config/yazi/flavors/tokyo-night.yazi/tmtheme.xml +++ /dev/null @@ -1,1329 +0,0 @@ - - - - - author - Kristi Russell (http://github.com/enkia) - colorSpaceName - sRGB - name - Enki-Tokyo-Night - semanticClass - enki.theme.tokyo - settings - - - settings - - activeGuide - #363b54 - background - #1d1f29 - caret - #DBC08A - findHighlight - #ffa300 - findHighlightForeground - #000000 - foreground - #AFBAD4ff - guide - #4f4f5e40 - gutterForeground - #3b415caa - inactiveSelection - #282833 - invisibles - #4f4f5e - lineHighlight - #00000030 - phantomCss - <![CDATA[ html { position: relative; } ]]> - popupCss - <![CDATA[ html { color: #B376B3; background-color: #2b2d3a; padding: 10px; } a { color: #6189BB; line-height: 1.2; text-decoration: none; } .error, .deleted { color: #50B4DC; } .success, .inserted { color: #9DBA72; } .warning, .modified { color: #ffa300; } ]]> - selection - #9D599D40 - selectionBorder - #9D599D - shadow - #00000010 - stackGuide - #4f4f5e60 - tagsOptions - underline - - - - name - Italics - Comments, Storage, Keyword Flow, Vue attributes, Decorators - scope - comment, meta.var.expr storage.type, keyword.control.flow, meta.directive.vue punctuation.separator.key-value.html, meta.directive.vue entity.other.attribute-name.html, tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js, storage.modifier - settings - - fontStyle - italic - - - - name - Comment - scope - comment, comment.block.documentation, punctuation.definition.comment - settings - - foreground - #444b6a - - - - name - Comment Doc - scope - comment.block.documentation variable, comment.block.documentation storage, comment.block.documentation punctuation, comment.block.documentation keyword, comment.block.documentation support, comment.block.documentation markup, comment.block.documentation markup.inline.raw.string.markdown, keyword.other.phpdoc.php - settings - - foreground - #7982a9 - - - - name - Number, Boolean, Undefined, Null - scope - variable.other.constant, punctuation.definition.constant, constant.language, constant.numeric, support.constant - settings - - foreground - #ff9e64 - - - - name - String, Symbols, Markup Heading - scope - string, constant.other.symbol, constant.other.key, markup.heading, meta.attribute-selector - settings - - fontStyle - - foreground - #9ece6a - - - - name - Colors - scope - constant.other.color, constant.other.color.rgb-value.hex punctuation.definition.constant - settings - - foreground - #9aa5ce - - - - name - Invalid - scope - invalid, invalid.illegal - settings - - foreground - #ff5370 - - - - name - Invalid deprecated - scope - invalid.deprecated - settings - - foreground - #bb9af7 - - - - name - Storage Type - scope - storage.type - settings - - foreground - #bb9af7 - - - - name - Storage - modifier, var, const, let - scope - meta.var.expr storage.type, storage.modifier - settings - - foreground - #9d7cd8 - - - - name - Interpolation - scope - punctuation.definition.template-expression, punctuation.section.embedded - settings - - foreground - #7dcfff - - - - name - Spread - scope - keyword.operator.spread, keyword.operator.rest - settings - - fontStyle - bold - foreground - #f7768e - - - - name - Operator, Misc - scope - keyword.operator, keyword.control.as, keyword.other, keyword.operator.bitwise.shift, punctuation, punctuation.definition.constant.markdown, punctuation.definition.string, punctuation.support.type.property-name, text.html.vue-html meta.tag, punctuation.definition.keyword, punctuation.terminator.rule, punctuation.definition.entity, punctuation.definition.tag, punctuation.separator.inheritance.php, punctuation.definition.tag.html, keyword.other.template, keyword.other.substitution, entity.name.operator, text.html.vue meta.tag.block.any.html, text.html.vue meta.tag.inline.any.html, text.html.vue meta.tag.other.html, text.html.twig meta.tag.inline.any.html, text.html.twig meta.tag.block.any.html, text.html.twig meta.tag.structure.any.html, text.html.twig meta.tag.any.html - settings - - foreground - #89ddff - - - - name - Import, Export, From, Default - scope - keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.default, meta.import keyword.other - settings - - foreground - #7dcfff - - - - name - Keyword - scope - keyword, keyword.control, keyword.other.important - settings - - foreground - #bb9af7 - - - - name - Keyword SQL - scope - keyword.other.DML - settings - - foreground - #7dcfff - - - - name - Keyword Operator Logical, Arrow, Ternary, Comparison - scope - keyword.operator.logical, storage.type.function, keyword.operator.bitwise, keyword.operator.ternary, keyword.operator.comparison, keyword.operator.relational, keyword.operator.or.regexp - settings - - foreground - #bb9af7 - - - - name - Tag - scope - entity.name.tag, entity.name.tag support.class.component, meta.tag - settings - - foreground - #f7768e - - - - name - Tag Punctuation - scope - punctuation.definition.tag, punctuation.definition.tag.html, punctuation.definition.tag.begin.html, punctuation.definition.tag.end.html - settings - - foreground - #ba3c97 - - - - name - Blade - scope - keyword.blade, entity.name.function.blade - settings - - foreground - #7aa2f7 - - - - name - PHP - Embedded Tag - scope - punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php - settings - - foreground - #0db9d7 - - - - name - Smarty - Twig tag - Blade - scope - punctuation.definition.variable.smarty, punctuation.section.embedded.begin.smarty, punctuation.section.embedded.end.smarty, meta.tag.template.value.twig, punctuation.section.tag.twig, meta.tag.expression.twig, punctuation.definition.tag.expression.twig, punctuation.definition.tag.output.twig, variable.parameter.smarty - settings - - foreground - #7DCFFF - - - - name - Smarty - Twig variable - function - scope - variable.other.property.twig, support.function.twig, meta.function-call.twig, keyword.control.twig, keyword.control.smarty, keyword.operator.other.twig, keyword.operator.comparison.twig, support.function.functions.twig, support.function.functions.twig, keyword.operator.assignment.twig, support.function.filters.twig, support.function.built-in.smarty, keyword.operator.smarty, text.blade text.html.blade custom.compiler.blade.php punctuation.section.embedded.php entity.name.tag.block.any.html, text.blade text.html.blade custom.compiler.blade.php punctuation.section.embedded.php constant.other.inline-data.html, text.blade text.html.blade custom.compiler.blade.php support.function constant.other.inline-data.html - settings - - foreground - #0db9d7 - - - - name - Globals - PHP Constants etc - scope - constant.other.php, variable.other.global.safer, variable.other.global.safer punctuation.definition.variable, variable.other.global, variable.other.global punctuation.definition.variable, constant.other - settings - - foreground - #e0af68 - - - - name - Variables - scope - variable, support.variable, string constant.other.placeholder - settings - - foreground - #c0caf5 - - - - name - Object Variable - scope - variable.other.object, support.module.node - settings - - foreground - #c0caf5 - - - - name - Object Key - scope - meta.object-literal.key, meta.group.braces.curly constant.other.object.key.js string.unquoted.label.js, string.alias.graphql, string.unquoted.graphql, string.unquoted.alias.graphql, meta.field.declaration.ts variable.object.property - settings - - foreground - #73daca - - - - name - Object Property - scope - variable.other.property, support.variable.property, support.variable.property.dom, meta.function-call variable.other.object.property, variable.language.prototype, meta.property.object, variable.other.member - settings - - foreground - #7dcfff - - - - name - Object Property - scope - variable.other.object.property - settings - - foreground - #c0caf5 - - - - name - Object Literal Member lvl 3 (Vue Prop Validation) - scope - meta.objectliteral meta.object.member meta.objectliteral meta.object.member meta.objectliteral meta.object.member meta.object-literal.key - settings - - foreground - #41a6b5 - - - - name - C-related Block Level Variables - scope - source.cpp meta.block variable.other - settings - - foreground - #f7768e - - - - name - Other Variable - scope - support.other.variable - settings - - foreground - #f7768e - - - - name - Methods - scope - meta.class-method.js entity.name.function.js, entity.name.method.js, variable.function.constructor, keyword.other.special-method, storage.type.cs - settings - - foreground - #7aa2f7 - - - - name - Function Definition - scope - entity.name.function, meta.function-call, meta.function-call entity.name.function, variable.function, meta.definition.method entity.name.function, meta.object-literal entity.name.function - settings - - foreground - #7aa2f7 - - - - name - Function Argument - scope - variable.parameter.function.language.special, variable.parameter, meta.function.parameters punctuation.definition.variable, meta.function.parameter variable - settings - - foreground - #e0af68 - - - - name - Constant, Tag Attribute - scope - keyword.other.type.php, storage.type.php, constant.character, constant.escape, keyword.other.unit - settings - - foreground - #bb9af7 - - - - name - Variable Definition - scope - meta.definition.variable variable.other.constant, meta.definition.variable variable.other.readwrite, variable.other.declaration - settings - - foreground - #bb9af7 - - - - name - Inherited Class - scope - entity.other.inherited-class - settings - - fontStyle - - foreground - #bb9af7 - - - - name - Class, Support, DOM, etc - scope - support.class, support.type, variable.other.readwrite.alias, support.orther.namespace.use.php, meta.use.php, support.other.namespace.php, support.type.sys-types, support.variable.dom, support.constant.math, support.type.object.module, support.constant.json, entity.name.namespace, meta.import.qualifier, entity.name.class - settings - - foreground - #0db9d7 - - - - name - Class Name - scope - entity.name - settings - - foreground - #c0caf5 - - - - name - Support Function - scope - support.function - settings - - foreground - #0db9d7 - - - - name - CSS Class and Support - scope - source.css support.type.property-name, source.sass support.type.property-name, source.scss support.type.property-name, source.less support.type.property-name, source.stylus support.type.property-name, source.postcss support.type.property-name, support.type.property-name.css, support.type.vendored.property-name, support.type.map.key - settings - - foreground - #7aa2f7 - - - - name - CSS Font - scope - support.constant.font-name, meta.definition.variable - settings - - foreground - #9ece6a - - - - name - CSS Class - scope - entity.other.attribute-name.class, meta.at-rule.mixin.scss entity.name.function.scss - settings - - foreground - #9ece6a - - - - name - CSS ID - scope - entity.other.attribute-name.id - settings - - foreground - #fc7b7b - - - - name - CSS Tag - scope - entity.name.tag.css, entity.name.tag.reference, entity.name.tag.scss - settings - - foreground - #0db9d7 - - - - name - CSS Tag Reference - scope - entity.name.tag.reference - settings - - foreground - #e0af68 - - - - name - CSS Property Separator - scope - meta.property-list punctuation.separator.key-value - settings - - foreground - #9abdf5 - - - - name - CSS Punctuation - scope - meta.property-list, punctuation.definition.entity.css - settings - - foreground - #e0af68 - - - - name - SCSS @ - scope - meta.at-rule.mixin keyword.control.at-rule.mixin, meta.at-rule.include entity.name.function.scss, meta.at-rule.include keyword.control.at-rule.include - settings - - foreground - #bb9af7 - - - - name - SCSS Mixins, Extends, Include Keyword - scope - keyword.control.at-rule.include punctuation.definition.keyword, keyword.control.at-rule.mixin punctuation.definition.keyword, meta.at-rule.include keyword.control.at-rule.include, keyword.control.at-rule.extend punctuation.definition.keyword, meta.at-rule.extend keyword.control.at-rule.extend, entity.other.attribute-name.placeholder.css punctuation.definition.entity.css, meta.at-rule.media keyword.control.at-rule.media, meta.at-rule.mixin keyword.control.at-rule.mixin, meta.at-rule.function keyword.control.at-rule.function, keyword.control punctuation.definition.keyword, meta.at-rule.import.scss entity.other.attribute-name.placeholder.scss punctuation.definition.entity.scss, meta.at-rule.import.scss keyword.control.at-rule.import.scss - settings - - foreground - #9d7cd8 - - - - name - SCSS Include Mixin Argument - scope - meta.property-list meta.at-rule.include - settings - - foreground - #c0caf5 - - - - name - CSS value - scope - support.constant.property-value - settings - - foreground - #ff9e64 - - - - name - Sub-methods - scope - entity.name.module.js, variable.import.parameter.js, variable.other.class.js - settings - - foreground - #c0caf5 - - - - name - Language methods - scope - variable.language - settings - - foreground - #f7768e - - - - name - Variable punctuation - scope - variable.other punctuation.definition.variable - settings - - foreground - #c0caf5 - - - - name - Keyword this with Punctuation, ES7 Bind Operator - scope - source.js constant.other.object.key.js string.unquoted.label.js, variable.language.this punctuation.definition.variable, keyword.other.this - settings - - foreground - #f7768e - - - - name - HTML Attributes - scope - entity.other.attribute-name, text.html.basic entity.other.attribute-name.html, text.html.basic entity.other.attribute-name, text.blade entity.other.attribute-name.class, text.html.smarty entity.other.attribute-name.class - settings - - foreground - #bb9af7 - - - - name - Vue Template attributes - scope - meta.directive.vue punctuation.separator.key-value.html, meta.directive.vue entity.other.attribute-name.html - settings - - foreground - #bb9af7 - - - - name - Vue Template attribute separator - scope - meta.directive.vue punctuation.separator.key-value.html - settings - - foreground - #89ddff - - - - name - CSS IDs - scope - source.sass keyword.control - settings - - foreground - #7aa2f7 - - - - name - CSS psuedo selectors - scope - entity.other.attribute-name.pseudo-class, entity.other.attribute-name.pseudo-element, entity.other.attribute-name.placeholder, meta.property-list meta.property-value - settings - - foreground - #bb9af7 - - - - name - Inserted - scope - markup.inserted - settings - - foreground - #449dab - - - - name - Deleted - scope - markup.deleted - settings - - foreground - #914c54 - - - - name - Changed - scope - markup.changed - settings - - foreground - #6183bb - - - - name - Regular Expressions - scope - string.regexp - settings - - foreground - #b4f9f8 - - - - name - Regular Expressions - Punctuation - scope - punctuation.definition.group - settings - - foreground - #f7768e - - - - name - Regular Expressions - Character Class - scope - constant.other.character-class.regexp - settings - - foreground - #bb9af7 - - - - name - Regular Expressions - Character Class Set - scope - constant.other.character-class.set.regexp, punctuation.definition.character-class.regexp - settings - - foreground - #e0af68 - - - - name - Regular Expressions - Quantifier - scope - keyword.operator.quantifier.regexp - settings - - foreground - #89ddff - - - - name - Regular Expressions - Backslash - scope - constant.character.escape.backslash - settings - - foreground - #c0caf5 - - - - name - Escape Characters - scope - constant.character.escape - settings - - foreground - #89ddff - - - - name - Decorators - scope - tag.decorator.js entity.name.tag.js, tag.decorator.js punctuation.definition.tag.js - settings - - foreground - #7aa2f7 - - - - name - CSS Units - scope - keyword.other.unit - settings - - foreground - #f7768e - - - - name - JSON Key - Level 0 - scope - source.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #7aa2f7 - - - - name - JSON Key - Level 1 - scope - source.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #0db9d7 - - - - name - JSON Key - Level 2 - scope - source.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #7dcfff - - - - name - JSON Key - Level 3 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #bb9af7 - - - - name - JSON Key - Level 4 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #e0af68 - - - - name - JSON Key - Level 5 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #0db9d7 - - - - name - JSON Key - Level 6 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json string.quoted.double.json - settings - - foreground - #73daca - - - - name - JSON Key - Level 7 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json - settings - - foreground - #f7768e - - - - name - JSON Key - Level 8 - scope - source.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.value.json meta.sequence.json meta.mapping.key.json string.quoted.double.json punctuation.definition.string.end.json - settings - - foreground - #9ece6a - - - - name - JSON Key - value - scope - source.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json, source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.array.json meta.structure.dictionary.json meta.structure.dictionary.value.json string.quoted.double.json - settings - - foreground - #9ece6a - - - - name - Plain Punctuation - scope - punctuation.definition.list_item.markdown - settings - - foreground - #9abdf5 - - - - name - Block Punctuation - scope - meta.block, meta.brace, punctuation.definition.block, punctuation.definition.use, punctuation.definition.group.shell, punctuation.definition.class, punctuation.definition.begin.bracket, punctuation.definition.end.bracket, punctuation.definition.parameters, punctuation.definition.arguments, punctuation.definition.dictionary, punctuation.definition.array, punctuation.section - settings - - foreground - #9abdf5 - - - - name - Markdown - Plain - scope - meta.jsx.children, meta.embedded.block - settings - - foreground - #c0caf5 - - - - name - HTML text - scope - text.html - settings - - foreground - #9aa5ce - - - - name - Markdown - Markup Raw Inline - scope - text.html.markdown markup.inline.raw.markdown - settings - - foreground - #bb9af7 - - - - name - Markdown - Markup Raw Inline Punctuation - scope - text.html.markdown markup.inline.raw.markdown punctuation.definition.raw.markdown - settings - - foreground - #4E5579 - - - - name - Markdown - Heading 1 - scope - heading.1.markdown entity.name, heading.1.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #89ddff - - - - name - Markdown - Heading 2 - scope - heading.2.markdown entity.name, heading.2.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #61bdf2 - - - - name - Markdown - Heading 3 - scope - heading.3.markdown entity.name, heading.3.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #7aa2f7 - - - - name - Markdown - Heading 4 - scope - heading.4.markdown entity.name, heading.4.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #6d91de - - - - name - Markdown - Heading 5 - scope - heading.5.markdown entity.name, heading.5.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #9aa5ce - - - - name - Markdown - Heading 6 - scope - heading.6.markdown entity.name, heading.6.markdown punctuation.definition.heading.markdown - settings - - fontStyle - bold - foreground - #747ca1 - - - - name - Markup - Italic - scope - markup.italic, markup.italic punctuation - settings - - fontStyle - italic - foreground - #c0caf5 - - - - name - Markup - Bold - scope - markup.bold, markup.bold punctuation - settings - - fontStyle - bold - foreground - #c0caf5 - - - - name - Markup - Bold-Italic - scope - markup.bold markup.italic, markup.bold markup.italic punctuation - settings - - fontStyle - bold italic - foreground - #c0caf5 - - - - name - Markup - Underline - scope - markup.underline, markup.underline punctuation - settings - - fontStyle - underline - - - - name - Markdown - Blockquote - scope - markup.quote punctuation.definition.blockquote.markdown - settings - - foreground - #4e5579 - - - - name - Markup - Quote - scope - markup.quote - settings - - fontStyle - italic - - - - name - Markdown - Link - scope - string.other.link, markup.underline.link, constant.other.reference.link.markdown, string.other.link.description.title.markdown - settings - - foreground - #73daca - - - - name - Markdown - Fenced Code Block - scope - markup.fenced_code.block.markdown, markup.inline.raw.string.markdown, variable.language.fenced.markdown - settings - - foreground - #89ddff - - - - name - Markdown - Separator - scope - meta.separator - settings - - fontStyle - bold - foreground - #444b6a - - - - name - Markup - Table - scope - markup.table - settings - - foreground - #c0cefc - - - - name - Token - Info - scope - token.info-token - settings - - foreground - #0db9d7 - - - - name - Token - Warn - scope - token.warn-token - settings - - foreground - #ffdb69 - - - - name - Token - Error - scope - token.error-token - settings - - foreground - #db4b4b - - - - name - Token - Debug - scope - token.debug-token - settings - - foreground - #b267e6 - - - - name - Apache Tag - scope - entity.tag.apacheconf - settings - - foreground - #f7768e - - - - name - Preprocessor - scope - meta.preprocessor - settings - - foreground - #73daca - - - - name - ENV value - scope - source.env - settings - - foreground - #7aa2f7 - - - - uuid - 06f855e3-9fb7-4fb1-b790-aef06065f34e - - diff --git a/yazi_1/.config/yazi/init.lua b/yazi_1/.config/yazi/init.lua deleted file mode 100644 index 24b6f61..0000000 --- a/yazi_1/.config/yazi/init.lua +++ /dev/null @@ -1,358 +0,0 @@ --- Change this to switch themes --- local THEME = "kanagawa" --- local THEME = "catppuccin-mocha" --- local THEME = "everforest-medium" --- local THEME = "gruvbox-material" --- local THEME = "tokyo-night" -local THEME = "rose_pine-moon" - --- local theme_colors = { --- rose_pine = { --- primary = "#c4a7e7", -- iris/mauve (purple-like color from rose-pine palette) --- secondary = "#6e6a86", -- muted/subtle (comparable to comment/gray colors) --- yanked = "#9ccfd8", -- foam (cyan-like accent color) --- cut = "#eb6f92", -- love (red-like accent color) --- }, --- carbonfox = { --- primary = "#78a9ff", --- secondary = "#525252", --- yanked = "#3ddbd9", --- cut = "#ff7eb6", --- }, --- kanagawa = { --- primary = "#7e9cd8", --- secondary = "#54546d", --- yanked = "#7aa89f", --- cut = "#e82424", --- }, --- sonokai = { --- primary = "#76cce0", --- secondary = "#7f8490", --- yanked = "#fc5d7c", --- cut = "#f85e84", --- }, --- catppuccin = { --- primary = "#89b4fa", --- secondary = "#6c7086", --- yanked = "#94e2d5", --- cut = "#f38ba8", --- }, --- dracula = { --- primary = "#bd93f9", -- purple --- secondary = "#6272a4", -- comment --- yanked = "#8be9fd", -- cyan --- cut = "#ff5555", -- red --- }, --- everforest = { --- primary = "#7fbbb3", -- aqua --- secondary = "#859289", -- gray --- yanked = "#a7c080", -- green --- cut = "#e67e80", -- red --- }, --- gruvbox = { --- primary = "#7daea3", -- aqua --- secondary = "#7c6f64", -- gray --- yanked = "#a9b665", -- green --- cut = "#ea6962", -- red --- }, --- nightfox = { --- primary = "#719cd6", -- blue --- secondary = "#738091", -- comment --- yanked = "#63cdcf", -- cyan --- cut = "#c94f6d", -- red --- }, --- onedark = { --- primary = "#61afef", -- blue --- secondary = "#5c6370", -- gray --- yanked = "#56b6c2", -- cyan --- cut = "#e06c75", -- red --- }, --- } - --- eocal c = theme_colors[THEME] - --- require("yaziline"):setup({ --- color = c.primary, --- secondary_color = c.secondary, --- default_files_color = "darkgray", --- selected_files_color = "white", --- yanked_files_color = c.yanked, --- cut_files_color = c.cut, --- separator_style = "angly", -- "angly" | "curvy" | "liney" | "empty" --- separator_open = "î‚Č", --- separator_close = "", --- separator_open_thin = "", --- separator_close_thin = "", --- separator_head = "", --- separator_tail = "", - --- select_symbol = "", --- yank_symbol = "󰆐", - --- filename_max_length = 24, -- truncate when filename > 24 --- filename_truncate_length = 6, -- leave 6 chars on both sides --- filename_truncate_separator = "...", --- }) - -require("recycle-bin"):setup({ - trash_dir = "~/.local/share/Trash/", -}) - --- require("omp"):setup({ config = "/home/liph/.config/yazi/omp/omp.toml" }) - -require("mime-ext"):setup({ - -- with_files = { - -- tex = "text/makefile", - -- }, - - with_exts = { - tex = "text/makefile", - }, -}) - -require("full-border"):setup({ - type = ui.Border.ROUNDED, -}) - --- git-yazi plugin --- th.git = th.git or {} --- th.git.modified = ui.Style():fg("blue") --- th.git.deleted = ui.Style():fg("red"):bold() -require("git"):setup() --- whoosh plugin --- You can configure your bookmarks using simplified syntax --- local bookmarks = { --- { tag = "Documents", path = "~/Documents", key = "D" }, --- } - --- You can also configure bookmarks with key arrays --- local bookmarks = { --- { tag = "Desktop", path = "~/Desktop", key = { "d", "D" } }, --- { tag = "Documents", path = "~/Documents", key = { "d", "d" } }, --- { tag = "Downloads", path = "~/Downloads", key = "o" }, --- { tag = "Downloads", path = "~/Downloads", key = "o" }, --- { tag = "Downloads", path = "~/Downloads", key = "o" }, --- { tag = "Downloads", path = "~/Downloads", key = "o" }, --- { tag = "Downloads", path = "~/Downloads", key = "o" }, --- } - -require("whoosh"):setup({ - -- Configuration bookmarks (cannot be deleted through plugin) - bookmarks = bookmarks, - - -- Notification settings - jump_notify = false, - - -- Key generation for auto-assigning bookmark keys - keys = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - - -- Configure the built-in menu action hotkeys - -- false - hide menu item - special_keys = { - create_temp = "", -- Create a temporary bookmark from the menu - fuzzy_search = "", -- Launch fuzzy search (fzf) - history = "", -- Open directory history - previous_dir = "", -- Jump back to the previous directory - }, - - -- File path for storing user bookmarks - bookmarks_path = ( - ya.target_family() == "windows" and os.getenv("APPDATA") .. "\\yazi\\config\\plugins\\whoosh.yazi\\bookmarks" - ) or (os.getenv("HOME") .. "/.config/yazi/plugins/whoosh.yazi/bookmarks"), - - -- Replace home directory with "~" - home_alias_enabled = true, -- Toggle home aliasing in displays - - -- Path truncation in navigation menu - path_truncate_enabled = false, -- Enable/disable path truncation - path_max_depth = 3, -- Maximum path depth before truncation - - -- Path truncation in fuzzy search (fzf) - fzf_path_truncate_enabled = false, -- Enable/disable path truncation in fzf - fzf_path_max_depth = 5, -- Maximum path depth before truncation in fzf - - -- Long folder name truncation - path_truncate_long_names_enabled = false, -- Enable in navigation menu - fzf_path_truncate_long_names_enabled = false, -- Enable in fzf - path_max_folder_name_length = 20, -- Max length in navigation menu - fzf_path_max_folder_name_length = 20, -- Max length in fzf - - -- History directory settings - history_size = 10, -- Number of directories in history (default 10) - history_fzf_path_truncate_enabled = false, -- Enable/disable path truncation by depth for history - history_fzf_path_max_depth = 5, -- Maximum path depth before truncation for history (default 5) - history_fzf_path_truncate_long_names_enabled = false, -- Enable/disable long folder name truncation for history - history_fzf_path_max_folder_name_length = 30, -- Maximum length for folder names in history (default 30) -}) - --- projetc plugin -require("projects"):setup({ - event = { - save = { - enable = true, - name = "project-saved", - }, - load = { - enable = true, - name = "project-loaded", - }, - delete = { - enable = true, - name = "project-deleted", - }, - delete_all = { - enable = true, - name = "project-deleted-all", - }, - merge = { - enable = true, - name = "project-merged", - }, - }, - save = { - method = "yazi", -- yazi | lua - yazi_load_event = "@projects-load", -- event name when loading projects in `yazi` method - lua_save_path = "", -- path of saved file in `lua` method, comment out or assign explicitly - -- default value: - -- windows: "%APPDATA%/yazi/state/projects.json" - -- unix: "~/.local/state/yazi/projects.json" - }, - last = { - update_after_save = true, - update_after_load = true, - update_before_quit = false, - load_after_start = false, - }, - merge = { - event = "projects-merge", - quit_after_merge = false, - }, - notify = { - enable = true, - title = "Projects", - timeout = 3, - level = "info", - }, -}) - --- yafg plugin -require("yafg"):setup({ - editor = "nvim", -- Editor command (default: "hx") - args = { "--noplugin" }, -- Additional editor arguments (default: {}) - file_arg_format = "+{row} {file}", -- File argument format (default: "{file}:{row}:{col}") -}) - -require("simple-tag"):setup({ - -- UI display mode (icon, text, hidden) - ui_mode = "icon", -- (Optional) - - -- Disable tag key hints (popup in bottom right corner) - hints_disabled = false, -- (Optional) - - -- linemode order: adjusts icon/text position. For example, if you want icon to be on the most left of linemode then set linemode_order larger than 1000. - -- More info: https://github.com/sxyazi/yazi/blob/077faacc9a84bb5a06c5a8185a71405b0cb3dc8a/yazi-plugin/preset/components/linemode.lua#L4-L5 - linemode_order = 500, -- (Optional) - - -- You can backup/restore this folder within the same OS (Linux, windows, or MacOS). - -- But you can't restore backed up folder in the different OS because they use difference absolute path. - -- save_path = -- full path to save tags folder (Optional) - -- - Linux/MacOS: os.getenv("HOME") .. "/.config/yazi/tags" - -- - Windows: os.getenv("APPDATA") .. "\\yazi\\config\\tags" - - -- Set tag colors - colors = { -- (Optional) - -- Set this same value with `theme.toml` > [mgr] > hovered > reversed - -- Default theme use "reversed = true". - -- More info: https://github.com/sxyazi/yazi/blob/077faacc9a84bb5a06c5a8185a71405b0cb3dc8a/yazi-config/preset/theme-dark.toml#L25 - reversed = true, -- (Optional) - - -- More colors: https://yazi-rs.github.io/docs/configuration/theme#types.color - -- format: [tag key] = "color" - ["*"] = "#bf68d9", -- (Optional) - ["$"] = "green", - ["!"] = "#cc9057", - ["1"] = "cyan", - ["p"] = "red", - }, - - -- Set tag icons. Only show when ui_mode = "icon". - -- Any text or nerdfont icons should work as long as you use nerdfont to render yazi. - -- Default icon from mactag.yazi: ●; Some generic icons: ï€Ź, , 󱈀 - -- More icon from nerd fonts: https://www.nerdfonts.com/cheat-sheet - icons = { -- (Optional) - -- default icon - default = "󰚋", - - -- format: [tag key] = "tag icon" - ["*"] = "*", - ["$"] = "", - ["!"] = "", - ["p"] = "", - }, -}) --- require("omp"):setup({ --- config = "/home/liph/.config/ohmyposh/yazi-zen.json", --- }) - --- default config -require("fchar"):setup({ - -- if true: f -> file, File, FILE - insensitive = true, - -- if true: f -> file, .file, @file, #file, ...file - skip_symbols = true, - -- if {"yazi-"}: f -> file, yazi-file - skip_prefix = {}, - -- start: f -> file - -- word: f -> file, also-file - -- all: f -> file, also-file, alsofile, elf - search_location = "start", - aliases = {}, -}) - --- aliases for German -require("fchar"):setup({ - aliases = { - a = "Ă€", - o = "ö", - u = "ĂŒ", - s = "ß", - }, -}) - --- you may want to turn off the search regex from --- showing up in the header by doing this -function Header:flags() - local cwd = self._current.cwd - local filter = self._current.files.filter - - local t = {} - if cwd.is_search then - t[#t + 1] = string.format("search: %s", cwd.domain) - end - if filter then - t[#t + 1] = string.format("filter: %s", filter) - end - return #t == 0 and "" or " (" .. table.concat(t, ", ") .. ")" -end - -require("dupes"):setup({ - -- Global settings - save_op = false, -- Save results to file by default - -- auto_confirm = true, -- Skip confirmation for apply (use with caution!) - - profiles = { - -- Interactive mode: recursively scan and display duplicates - interactive = { - args = { "-r" }, - }, - -- Apply mode: recursively scan and DELETE duplicates - apply = { - args = { "-r", "-N", "-d" }, - save_op = true, -- Save results before deletion - }, - -- Custom profile example (uncomment to use) - -- custom = { - -- args = { "-r", "-s", }, -- Your custom jdupes flags - -- }, - }, -}) diff --git a/yazi_1/.config/yazi/keymap.toml b/yazi_1/.config/yazi/keymap.toml deleted file mode 100644 index 0448b07..0000000 --- a/yazi_1/.config/yazi/keymap.toml +++ /dev/null @@ -1,536 +0,0 @@ -[mgr] -prepend_keymap = [ - - - ### smart-paste plugin ### - { on = "P", run = "plugin smart-paste", desc = "Paste into the hovered directory or CWD" }, - - ### open-with-cmd plugin ### - { on = "o", run = "plugin open-with-cmd -- block", desc = "Open with command in the terminal" }, - { on = "O", run = "plugin open-with-cmd", desc = "Open with command" }, - - ### bypass plugin ### - { on = [ - "L", - ], run = "plugin bypass", desc = "Recursively enter child directory, skipping children with only a single subdirectory" }, - { on = [ - "H", - ], run = "plugin bypass reverse", desc = "Recursively enter parent directory, skipping parents with only a single subdirectory" }, - - ### recycle-bin plugin - { on = [ - "R", - "b", - ], run = "plugin recycle-bin", desc = "Open Recycle Bin menu" }, - - ### dupes plugin ### - { on = [ - "", - "i", - ], run = "plugin dupes interactive", desc = "Run dupes interactive" }, - { on = [ - "", - "o", - ], run = "plugin dupes override", desc = "Run dupes override" }, - { on = [ - "", - "d", - ], run = "plugin dupes dry", desc = "Run dupes dry" }, - { on = [ - "", - "a", - ], run = "plugin dupes apply", desc = "Run dupes apply" }, - { on = [ - "", - "c", - ], run = "plugin dupes custom", desc = "Run dupes custom" }, - - ### toggle-pane plugin ### - { on = "W", run = "plugin toggle-pane max-preview", desc = "Maximize or restore the preview pane" }, - { on = "E", run = "plugin toggle-pane min-preview", desc = "Minimize or restore the preview pane" }, - - ### what size plugin ### - { on = "i", run = "plugin what-size", desc = "Calc size of selection or cwd" }, - - ### rsync plugin ### - { on = [ - "R", - ], run = "plugin rsync", desc = "Copy files using rsync" }, - - ### yafg plugin ### - { on = [ - "F", - "G", - ], run = "plugin yafg" }, - - ###### GIT ###### - ### open-git-remote plugin ### - { on = [ - "g", - "l", - ], run = "plugin open-git-remote", desc = "open git remote url" }, - ### lazygit plugin ### - { on = [ - "g", - "i", - ], run = "plugin lazygit", desc = "run lazygit" }, - ### vcs-files plugin ### - { on = [ - "g", - "c", - ], run = "plugin vcs-files", desc = "Show Git file changes" }, - - ### mount plugin ### - { on = "M", run = "plugin mount" }, - - # ### smart-enter plugin ### - { on = "l", run = "plugin smart-enter", desc = "Enter the child directory, or open the file" }, - - ### f-char plugin ### - { on = "f", run = "plugin fchar", desc = "Jump to char" }, - # ### jump-to-char plugin ### - # { on = "f", run = "plugin jump-to-char", desc = "Jump to char" }, - - ### whoosh plugin ### - { on = "[", run = "plugin whoosh jump_by_key", desc = "Jump bookmark by key" }, - # Direct fuzzy search access - { on = "}", run = "plugin whoosh jump_by_fzf", desc = "Direct fuzzy search for bookmarks" }, - # Basic bookmark operations - { on = [ - "]", - "a", - ], run = "plugin whoosh save", desc = "Add bookmark (hovered file/directory)" }, - { on = [ - "]", - "A", - ], run = "plugin whoosh save_cwd", desc = "Add bookmark (current directory)" }, - # Temporary bookmarks - { on = [ - "]", - "t", - ], run = "plugin whoosh save_temp", desc = "Add temporary bookmark (hovered file/directory)" }, - { on = [ - "]", - "T", - ], run = "plugin whoosh save_cwd_temp", desc = "Add temporary bookmark (current directory)" }, - # Jump to bookmarks - { on = "", run = "plugin whoosh jump_key_k", desc = "Jump directly to bookmark with key k" }, - { on = [ - "]", - "f", - ], run = "plugin whoosh jump_by_fzf", desc = "Jump bookmark by fzf" }, - # Delete bookmarks - { on = [ - "]", - "d", - ], run = "plugin whoosh delete_by_key", desc = "Delete bookmark by key" }, - { on = [ - "]", - "D", - ], run = "plugin whoosh delete_by_fzf", desc = "Delete bookmarks by fzf (use TAB to select multiple)" }, - { on = [ - "]", - "C", - ], run = "plugin whoosh delete_all", desc = "Delete all user bookmarks" }, - # Rename Bookmarks - { on = [ - "]", - "r", - ], run = "plugin whoosh rename_by_key", desc = "Rename bookmark by key" }, - { on = [ - "]", - "R", - ], run = "plugin whoosh rename_by_fzf", desc = "Rename bookmark by fzf" }, - # Navigation - { on = [ - "", - ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search" }, - # { on = [ - # "q", - # "q", - # ], run = "quit", desc = "Exit the process" }, - { on = [ - "", - ], run = "close", desc = "Close the current tab, or quit if it is last tab" }, - - ### projects plugin ### - { on = [ - "P", - "p", - ], run = "plugin projects 'load SomeProject'", desc = "Load the 'SomeProject' project" }, - { on = [ - "P", - "s", - ], run = "plugin projects save", desc = "Save current project" }, - { on = [ - "P", - "l", - ], run = "plugin projects load", desc = "Load project" }, - { on = [ - "P", - "P", - ], run = "plugin projects load_last", desc = "Load last project" }, - { on = [ - "P", - "d", - ], run = "plugin projects delete", desc = "Delete project" }, - { on = [ - "P", - "D", - ], run = "plugin projects delete_all", desc = "Delete all projects" }, - { on = [ - "P", - "m", - ], run = "plugin projects 'merge current'", desc = "Merge current tab to other projects" }, - { on = [ - "P", - "M", - ], run = "plugin projects 'merge all'", desc = "Merge current project to other projects" }, - - ### fazif plugin ### - { on = [ - "b", - "d", - ], run = "plugin fazif faziffd", desc = "Find files/directories with fd and fzf" }, - { on = [ - "b", - "D", - ], run = "plugin fazif faziffdr", desc = "Find files/directories with fd and fzf" }, - { on = [ - "b", - "r", - ], run = "plugin fazif fazifrg", desc = "Find content in files with ripgrep and fzf" }, - { on = [ - "b", - "R", - ], run = "plugin fazif fazifrga", desc = "Find content in documents with ripgrep-all and fzf" }, - - ### Tagging plugin ### - # TOGGLE TAG(S) - { on = [ - "t", - "t", - "k", - ], run = "plugin simple-tag -- toggle-tag", desc = "Toggle a tag (press any key)" }, - { on = [ - "'", - ], run = "plugin simple-tag -- toggle-tag --keys=!", desc = "Toggle tag(s) with fixed tag key(s) = (! and 1 and q)" }, - { on = [ - "-", - ], run = "plugin simple-tag -- toggle-tag --keys=1", desc = "Toggle tag(s) with fixed tag key(s) = (! and 1 and q)" }, - { on = [ - "t", - "t", - "i", - ], run = "plugin simple-tag -- toggle-tag --input", desc = "Toggle tag(s) with value from (input box)" }, - # ADD TAG(S) - { on = [ - "t", - "a", - "k", - ], run = "plugin simple-tag -- add-tag", desc = "Add a tag (press any key)" }, - # { on = [ "t", "a", "f" ], run = "plugin simple-tag -- add-tag --keys=!1q", desc = "Add tag(s) with fixed tag keys = (! and 1 and q)" }, - { on = [ - "t", - "a", - "i", - ], run = "plugin simple-tag -- add-tag --input", desc = "Add tag(s) with value from (input box)" }, - # REMOVE/DELETE TAG(S) - { on = [ - "t", - "d", - "k", - ], run = "plugin simple-tag -- remove-tag", desc = "Remove a tag (press any key)" }, - { on = [ - "t", - "d", - "f", - ], run = "plugin simple-tag -- remove-tag --keys=!1q", desc = "Remove tag(s) with fixed tag keys = (! and 1 and q)" }, - { on = [ - "t", - "d", - "i", - ], run = "plugin simple-tag -- remove-tag --input", desc = "Remove tag(s) with value from (input box)" }, - # REPLACE ALL OLD TAG(S) WITH NEW TAG(S) - { on = [ - "t", - "r", - "k", - ], run = "plugin simple-tag -- replace-tag", desc = "Replace with a new tag (press any key)" }, - { on = [ - "t", - "r", - "f", - ], run = "plugin simple-tag -- replace-tag --keys=!1q", desc = "Replace tag(s) with fixed tag keys = (! and 1 and q)" }, - { on = [ - "t", - "r", - "i", - ], run = "plugin simple-tag -- replace-tag --input", desc = "Replace tag(s) with value from (input box)" }, - # EDIT TAG(S) - { on = [ - "t", - "e", - ], run = "plugin simple-tag -- edit-tag ", desc = "Edit tag(s) (input box)" }, - # CLEAR TAG(S) - { on = [ - "t", - "c", - ], run = "plugin simple-tag -- clear", desc = "Clear all tags from selected or hovered files" }, - # CHANGE UI - { on = [ - "t", - "u", - "s", - ], run = "plugin simple-tag -- toggle-ui", desc = "Toggle tag indicator (icon > tag key > hidden)" }, - { on = [ - "t", - "u", - "h", - ], run = "plugin simple-tag -- toggle-ui --mode=hidden", desc = "Hide all tags indicator" }, - # FILTER FILES/FOLDERS BY TAGS: - { on = [ - "t", - "f", - ], run = "plugin simple-tag -- filter", desc = "Filter files/folders by a tag (press any key)" }, - { on = [ - "t", - "F", - ], run = "plugin simple-tag -- filter --input", desc = "Filter files/folders by tag(s) (input box)" }, - { on = [ - "t", - "F", - ], run = "plugin simple-tag -- filter --input --mode=or", desc = "Filter files/folders by contain tags (input box)" }, - # VISUAL SELECT FILES/FOLDERS BY TAGS: - # Available selection actions: - # replace → Replaces the current selection list with files/folders that have the selected tag. - # unite → Combines the currently selected files/folders with those that have the selected tag. - # intersect → Keeps only the files/folders that are present in both the current selection and the tagged items. - # subtract → Deselects files/folders that have the selected tag from the current selection. - # exclude → Combines the currently selected files/folders with the tagged items, then deselects any overlapping items between the current selection and the tagged items. - # undo → Undos or redoes the last selection action. - { on = [ - "t", - "s", - "t", - ], run = "plugin simple-tag -- toggle-select", desc = "Select a selection action then select a tag key (toggle-select)" }, - { on = [ - "t", - "s", - "t", - ], run = "plugin simple-tag -- toggle-select --keys=!1q", desc = "" }, - { on = [ - "t", - "s", - "r", - ], run = "plugin simple-tag -- replace-select", desc = "replace-select" }, - { on = [ - "t", - "s", - "u", - ], run = "plugin simple-tag -- unite-select", desc = "unite-select" }, - { on = [ - "t", - "s", - "i", - ], run = "plugin simple-tag -- intersect-select", desc = "intersect-select" }, - { on = [ - "t", - "s", - "s", - ], run = "plugin simple-tag -- subtract-select", desc = "subtract-select" }, - { on = [ - "t", - "s", - "e", - ], run = "plugin simple-tag -- exclude-select", desc = "exclude-select" }, - { on = [ - "t", - "s", - "e", - ], run = "plugin simple-tag -- replace-select --keys=!1q", desc = "Replaces the current selection list with files/folders that have (! and 1 and q) tag(s)" }, - { on = [ - "t", - "s", - "R", - ], run = "plugin simple-tag -- replace-select --input", desc = "replace-select --input" }, - { on = [ - "t", - "s", - "U", - ], run = "plugin simple-tag -- unite-select --input", desc = "unite-select --input" }, - { on = [ - "t", - "s", - "I", - ], run = "plugin simple-tag -- intersect-select --input", desc = "intersect-select --input" }, - { on = [ - "t", - "s", - "S", - ], run = "plugin simple-tag -- subtract-select --input", desc = "subtract-select --input" }, - { on = [ - "t", - "s", - "E", - ], run = "plugin simple-tag -- exclude-select --input", desc = "exclude-select --input" }, - { on = [ - "t", - "s", - "R", - ], run = "plugin simple-tag -- replace-select --input --mode=or", desc = "replace-select --input --mode=or" }, - { on = [ - "t", - "s", - "R", - ], run = "plugin simple-tag -- replace-select --keys=!1q --mode=or", desc = "replace-select --keys=!1q --mode=or" }, - # Undo/Redo selection (only works after using 5 modes above) - { on = [ - "t", - "s", - "u", - ], run = "plugin simple-tag -- undo-select", desc = "Undos/Redos the last selection action" }, - - # Directory navigation - { on = [ - "k", - ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ - "j", - ], run = "arrow 1", desc = "Move cursor down" }, - { on = [ - "h", - ], run = "leave", desc = "Go back to parent directory" }, - { on = [ - "l", - ], run = "enter", desc = "Enter directory" }, - # File operations - { on = [ - "", - ], run = "open", desc = "Open selected files" }, - { on = [ - "y", - ], run = "yank", desc = "Yank selected files (copy)" }, - { on = [ - "x", - ], run = "yank --cut", desc = "Yank selected files (cut)" }, - { on = [ - "p", - ], run = "paste", desc = "Paste yanked files" }, - { on = [ - "d", - ], run = "remove", desc = "Trash selected files" }, - { on = [ - "D", - ], run = "remove --permanently", desc = "Permanently delete selected files" }, - { on = [ - "a", - ], run = "create", desc = "Create a file or directory" }, - { on = [ - "r", - ], run = "rename --cursor=before_ext", desc = "Rename selected file" }, - # Selection - { on = [ - "e", - ], run = [ - "select --state=none", - "arrow 1", - ], desc = "Toggle selection" }, - { on = [ - "v", - ], run = "visual_mode", desc = "Enter visual mode" }, - { on = [ - "V", - ], run = "visual_mode --unset", desc = "Enter visual mode (unset)" }, - # Search - { on = [ - "/", - ], run = "find --smart", desc = "Find file" }, - { on = [ - "n", - ], run = "find_arrow", desc = "Go to next found" }, - { on = [ - "N", - ], run = "find_arrow --previous", desc = "Go to previous found" }, - # Tabs - { on = [ - "T", - ], run = "tab_create --current", desc = "Create new tab" }, - { on = [ - "1", - ], run = "tab_switch 0", desc = "Switch to tab 1" }, - { on = [ - "2", - ], run = "tab_switch 1", desc = "Switch to tab 2" }, - { on = [ - "3", - ], run = "tab_switch 2", desc = "Switch to tab 3" }, -] - -[tasks] -prepend_keymap = [ - { on = [ - "", - ], run = "close", desc = "Close task manager" }, - { on = [ - "k", - ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ - "j", - ], run = "arrow 1", desc = "Move cursor down" }, -] - -[select] -prepend_keymap = [ - { on = [ - "", - ], run = "close", desc = "Cancel selection" }, - { on = [ - "", - ], run = "close --submit", desc = "Submit selection" }, - { on = [ - "k", - ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ - "j", - ], run = "arrow 1", desc = "Move cursor down" }, -] - -[input] -prepend_keymap = [ - { on = [ - "", - ], run = "close", desc = "Cancel input" }, - { on = [ - "", - ], run = "close --submit", desc = "Submit input" }, -] - -[completion] -prepend_keymap = [ - { on = [ - "", - ], run = "close --submit", desc = "Submit completion" }, - { on = [ - "k", - ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ - "j", - ], run = "arrow 1", desc = "Move cursor down" }, -] - -[help] -prepend_keymap = [ - { on = [ - "", - ], run = "escape", desc = "Clear filter or exit help" }, - { on = [ - "q", - ], run = "close", desc = "Exit help" }, - { on = [ - "k", - ], run = "arrow -1", desc = "Move cursor up" }, - { on = [ - "j", - ], run = "arrow 1", desc = "Move cursor down" }, -] diff --git a/yazi_1/.config/yazi/omp/omp.json b/yazi_1/.config/yazi/omp/omp.json deleted file mode 100644 index 11ad18c..0000000 --- a/yazi_1/.config/yazi/omp/omp.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", - "palette": { - "gb_bright_aqua": "#8ec07c", - "gb_bright_blue": "#6272a4", - "gb_bright_green": "#b8bb26", - "gb_bright_orange": "#fe8019", - "gb_bright_purple": "#d3869b", - "gb_bright_red": "#fb4934", - "gb_bright_yellow": "#fabd2f", - "gb_dark0": "#282828", - "gb_dark0_hard": "#1d2021", - "gb_dark0_soft": "#32302f", - "gb_dark1": "#3c3836", - "gb_dark2": "#504945", - "gb_dark3": "#665c54", - "gb_dark4": "#7c6f64", - "gb_dark4_256": "#7c6f64", - "gb_faded_aqua": "#427b58", - "gb_faded_blue": "#076678", - "gb_faded_green": "#79740e", - "gb_faded_orange": "#af3a03", - "gb_faded_purple": "#8f3f71", - "gb_faded_red": "#9d0006", - "gb_faded_yellow": "#b57614", - "gb_gray_244": "#928374", - "gb_gray_245": "#928374", - "gb_light0": "#fbf1c7", - "gb_light0_hard": "#f9f5d7", - "gb_light0_soft": "#f2e5bc", - "gb_light1": "#ebdbb2", - "gb_light2": "#d5c4a1", - "gb_light3": "#bdae93", - "gb_light4": "#a89984", - "gb_light4_256": "#a89984", - "gb_neutral_aqua": "#689d6a", - "gb_neutral_blue": "#458588", - "gb_neutral_green": "#98971a", - "gb_neutral_orange": "#d65d0e", - "gb_neutral_purple": "#b16286", - "gb_neutral_red": "#cc241d", - "gb_neutral_yellow": "#d79921" - }, - "var": { - "Dir": "", - "Documents": "📝", - "Downloads": "đŸ“„", - "Duration": "\u231b", - "Exit": "\u21a9\ufe0f", - "GitHub": "\ueba1", - "Home": "🏠", - "Host": " ", - "LeftDelim": "\ue0b3", - "LeftSep": "\ue0b2", - "LeftSepRound": "\ue0b6", - "Music": "đŸŽ”", - "Pictures": "đŸ–Œ\ufe0f", - "RightDelim": "\ue0b1", - "RightSep": "\ue0b0", - "RightSepRound": "\ue0b4", - "Tag": "🔖 ", - "Time": "🕓", - "root": "🔮", - "ssh": "🌐", - "user": "" - }, - "pwd": "osc7", - "blocks": [ - { - "type": "prompt", - "alignment": "left", - "segments": [ - { - "properties": { - "cache_duration": "none" - }, - "leading_diamond": "\ue0b6", - "trailing_diamond": "\ue0b0", - "template": "{{if .Root}}{{.Var.root}}{{else}}{{.Var.user}}{{end}}{{.UserName}} {{.Var.Host}}{{ .HostName }}{{ if .SSHSession }} {{.Var.ssh}}{{ end }}", - "foreground": "p:gb_dark0_hard", - "background": "p:gb_bright_purple", - "type": "session", - "style": "diamond" - }, - { - "properties": { - "cache_duration": "none", - "folder_icon": "\ueaf7", - "folder_separator_icon": " \ue0b1 ", - "home_icon": "🏠", - "mapped_locations": {}, - "max_depth": 2, - "max_width": 6, - "mixed_threshold": 6, - "style": "mixed" - }, - "leading_diamond": "\ue0b0", - "trailing_diamond": "\ue0b0", - "template": "<#f1fa8c,#427b58>{{.Var.Dir}}<#427b58,p:gb_bright_aqua>{{.Var.RightSep}} {{ .Path}}", - "foreground": "transparent", - "background": "p:gb_bright_aqua", - "type": "path", - "style": "diamond" - }, - { - "properties": { - "branch_max_length": 35, - "cache_duration": "none", - "fetch_stash_count": true, - "fetch_status": true, - "fetch_upstream_icon": true, - "status_formats": { - "Added": " %d", - "Deleted": " %d", - "Modified": " %d", - "Untracked": " %d", - "Unmerged": "ó°°§ %d" - } - }, - "leading_diamond": "\ue0b0", - "trailing_diamond": "\ue0b0", - "template": " {{ .UpstreamIcon }} {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }} -> {{.Upstream}}{{ end }}{{ if .Working.Changed }} {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }}{{ end }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uf51e {{ .StashCount }}{{ end }} ", - "foreground": "#193549", - "background": "#fffb38", - "type": "git", - "style": "diamond", - "background_templates": [ - "{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}", - "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}", - "{{ if gt .Ahead 0 }}#B388FF{{ end }}", - "{{ if gt .Behind 0 }}#B388FF{{ end }}" - ] - }, - { - "properties": { - "cache_duration": "none", - "fetch_version": true - }, - "template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ", - "foreground": "#ffffff", - "powerline_symbol": "\ue0b0", - "background": "#6CA35E", - "type": "node", - "style": "powerline" - }, - { - "properties": { - "cache_duration": "none", - "display_mode": "files", - "fetch_virtual_env": false - }, - "template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ", - "foreground": "#111111", - "powerline_symbol": "\ue0b0", - "background": "#FFDE57", - "type": "python", - "style": "powerline" - } - ] - } - ], - "version": 3 -} diff --git a/yazi_1/.config/yazi/omp/omp.toml b/yazi_1/.config/yazi/omp/omp.toml deleted file mode 100644 index c760e2b..0000000 --- a/yazi_1/.config/yazi/omp/omp.toml +++ /dev/null @@ -1,103 +0,0 @@ -"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json" -pwd = "osc7" -version = 3 - -[palette] -gb_bright_path = "#7daea3" -gb_bright_git = "#d8a657" -gb_dark0_hard = "#3e7fb0" -gb_faded_green = "#79740e" -gb_faded_red = "#ea9a97" -gb_text = "#d3869b" - -[var] -user = "" -ssh = "🌐" - -# LEFT SIDE PROMPT -[[blocks]] -type = "prompt" -alignment = "left" - -[[blocks.segments]] -template = '{{ .HostName }} ' -foreground = 'magenta' -background = 'transparent' -type = 'text' -style = 'plain' - -[[blocks.segments]] -template = '{{ .UserName }} ' -foreground = 'magenta' -background = 'transparent' -type = 'text' -style = 'plain' - -# [blocks.segments.properties] -# cache_duration = "none" - -[[blocks.segments]] -template = "{{ .Path }} " -foreground = "blue" -background = "transparent" -type = "path" -style = "plain" - -[blocks.segments.properties] -style = "full" -enable_hyperlink = true - -[[blocks.segments]] -template = ' {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} {{ if gt .Behind 0 }}⇣{{ end }}{{ if gt .Ahead 0 }}⇡{{ end }}' -foreground = "yellow" -background = "transparent" -type = "git" -style = "plain" - -[blocks.segments.properties] -fetch_status = true - -[blocks.segments.properties.status_formats] -Added = "+%d" -Deleted = "-%d" -Modified = "~%d" -Untracked = "?%d" - -# RIGHT SIDE PROMPT -[[blocks]] -type = "rprompt" -alignment = "right" - -[[blocks.segments]] -template = " {{ .Full }}" -foreground = "p:gb_faded_green" -background = "transparent" -type = "node" -style = "plain" - -[blocks.segments.properties] -display_mode = "files" - -[[blocks.segments]] -template = " {{ if .Venv }}({{ .Venv }}) {{ end }}{{ .Full }}" -foreground = "p:gb_faded_green" -background = "transparent" -type = "python" -style = "plain" - -[blocks.segments.properties] -display_mode = "always" -fetch_virtual_env = true - -# NEWLINE FOR INPUT -[[blocks]] -type = "prompt" -alignment = "left" -newline = true - -[[blocks.segments]] -template = "❯ " -foreground = "p:gb_bright_aqua" -background = "transparent" -type = "text" -style = "plain" diff --git a/yazi_1/.config/yazi/omp/omp2.toml b/yazi_1/.config/yazi/omp/omp2.toml deleted file mode 100644 index 8c18de7..0000000 --- a/yazi_1/.config/yazi/omp/omp2.toml +++ /dev/null @@ -1,157 +0,0 @@ -"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json" -pwd = "osc7" -version = 3 - -[palette] -gb_bright_aqua = "#8ec07c" -gb_bright_blue = "#83a598" -gb_bright_green = "#b8bb26" -gb_bright_orange = "#fe8019" -gb_bright_purple = "#d3869b" -gb_bright_red = "#fb4934" -gb_bright_yellow = "#fabd2f" -gb_dark0 = "#282828" -gb_dark0_hard = "#1d2021" -gb_dark0_soft = "#32302f" -gb_dark1 = "#3c3836" -gb_dark2 = "#504945" -gb_dark3 = "#665c54" -gb_dark4 = "#7c6f64" -gb_dark4_256 = "#7c6f64" -gb_faded_aqua = "#427b58" -gb_faded_blue = "#076678" -gb_faded_green = "#79740e" -gb_faded_orange = "#af3a03" -gb_faded_purple = "#8f3f71" -gb_faded_red = "#9d0006" -gb_faded_yellow = "#b57614" -gb_gray_244 = "#928374" -gb_gray_245 = "#928374" -gb_light0 = "#fbf1c7" -gb_light0_hard = "#f9f5d7" -gb_light0_soft = "#f2e5bc" -gb_light1 = "#ebdbb2" -gb_light2 = "#d5c4a1" -gb_light3 = "#bdae93" -gb_light4 = "#a89984" -gb_light4_256 = "#a89984" -gb_neutral_aqua = "#689d6a" -gb_neutral_blue = "#458588" -gb_neutral_green = "#98971a" -gb_neutral_orange = "#d65d0e" -gb_neutral_purple = "#b16286" -gb_neutral_red = "#cc241d" -gb_neutral_yellow = "#d79921" - -[var] -Dir = "📂" -Documents = "📝" -Downloads = "đŸ“„" -Duration = "⌛" -Exit = "↩" -GitHub = "" -Home = "🏠" -Host = " " -LeftDelim = "" -LeftSep = "î‚Č" -LeftSepRound = "" -Music = "đŸŽ”" -Pictures = "đŸ–Œïž" -RightDelim = "" -RightSep = "" -RightSepRound = "" -Tag = "🔖 " -Time = "🕓" -root = "🔮" -ssh = "🌐" -user = "đŸ‘€" - -[[blocks]] -type = "prompt" -alignment = "left" - -[[blocks.segments]] -leading_diamond = "" -trailing_diamond = "" -template = "{{if .Root}}{{.Var.root}}{{else}}{{.Var.user}}{{end}}{{.UserName}} {{.Var.Host}}{{ .HostName }}{{ if .SSHSession }} {{.Var.ssh}}{{ end }}" -foreground = "p:gb_dark0_hard" -background = "p:gb_bright_purple" -type = "session" -style = "diamond" - -[blocks.segments.properties] -cache_duration = "none" - -[[blocks.segments]] -leading_diamond = "" -trailing_diamond = "" -template = "<#fabd2f,#427b58>{{.Var.Dir}}<#427b58,p:gb_bright_aqua>{{.Var.RightSep}} {{ .Path}}" -foreground = "transparent" -background = "p:gb_bright_aqua" -type = "path" -style = "diamond" - -[blocks.segments.properties] -cache_duration = "none" -folder_icon = "î«·" -folder_separator_icon = "  " -home_icon = "🏠" -mapped_locations = {} -max_depth = 2 -max_width = 6 -mixed_threshold = 6 -style = "mixed" - -[[blocks.segments]] -leading_diamond = "" -trailing_diamond = "" -template = " {{ .UpstreamIcon }} {{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }} -> {{.Upstream}}{{ end }}{{ if .Working.Changed }} {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }}{{ end }}{{ if .Staging.Changed }} {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }}  {{ .StashCount }}{{ end }} " -foreground = "#193549" -background = "#fffb38" -type = "git" -style = "diamond" -background_templates = [ - "{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}", - "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}", - "{{ if gt .Ahead 0 }}#B388FF{{ end }}", - "{{ if gt .Behind 0 }}#B388FF{{ end }}", -] - -[blocks.segments.properties] -branch_max_length = 35 -cache_duration = "none" -fetch_stash_count = true -fetch_status = true -fetch_upstream_icon = true - -[blocks.segments.properties.status_formats] -Added = " %d" -Deleted = " %d" -Modified = " %d" -Untracked = " %d" -Unmerged = "ó°°§ %d" - -[[blocks.segments]] -template = "  {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} " -foreground = "#ffffff" -powerline_symbol = "" -background = "#6CA35E" -type = "node" -style = "powerline" - -[blocks.segments.properties] -cache_duration = "none" -fetch_version = true - -[[blocks.segments]] -template = "  {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} " -foreground = "#111111" -powerline_symbol = "" -background = "#FFDE57" -type = "python" -style = "powerline" - -[blocks.segments.properties] -cache_duration = "none" -display_mode = "files" -fetch_virtual_env = false diff --git a/yazi_1/.config/yazi/omp/omp_rose-pine.toml b/yazi_1/.config/yazi/omp/omp_rose-pine.toml deleted file mode 100644 index e11f934..0000000 --- a/yazi_1/.config/yazi/omp/omp_rose-pine.toml +++ /dev/null @@ -1,103 +0,0 @@ -"$schema" = "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json" -pwd = "osc7" -version = 3 - -[palette] -gb_bright_path = "#9ccdf8" -gb_bright_git = "#f6c177" -gb_dark0_hard = "#3e7fb0" -gb_faded_green = "#79740e" -gb_faded_red = "#ea9a97" -gb_text = "#c4a7e7" - -[var] -user = "" -ssh = "🌐" - -# LEFT SIDE PROMPT -[[blocks]] -type = "prompt" -alignment = "left" - -[[blocks.segments]] -template = '{{ .HostName }} ' -foreground = 'p:gb_text' -background = 'transparent' -type = 'text' -style = 'plain' - -[[blocks.segments]] -template = '{{ .UserName }} ' -foreground = 'p:gb_text' -background = 'transparent' -type = 'text' -style = 'plain' - -# [blocks.segments.properties] -# cache_duration = "none" - -[[blocks.segments]] -template = "{{ .Path }} " -foreground = "p:gb_bright_path" -background = "transparent" -type = "path" -style = "plain" - -[blocks.segments.properties] -style = "full" -enable_hyperlink = true - -[[blocks.segments]] -template = ' {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} {{ if gt .Behind 0 }}⇣{{ end }}{{ if gt .Ahead 0 }}⇡{{ end }}' -foreground = "p:gb_bright_git" -background = "transparent" -type = "git" -style = "plain" - -[blocks.segments.properties] -fetch_status = true - -[blocks.segments.properties.status_formats] -Added = "+%d" -Deleted = "-%d" -Modified = "~%d" -Untracked = "?%d" - -# RIGHT SIDE PROMPT -[[blocks]] -type = "rprompt" -alignment = "right" - -[[blocks.segments]] -template = " {{ .Full }}" -foreground = "p:gb_faded_green" -background = "transparent" -type = "node" -style = "plain" - -[blocks.segments.properties] -display_mode = "files" - -[[blocks.segments]] -template = " {{ if .Venv }}({{ .Venv }}) {{ end }}{{ .Full }}" -foreground = "p:gb_faded_green" -background = "transparent" -type = "python" -style = "plain" - -[blocks.segments.properties] -display_mode = "always" -fetch_virtual_env = true - -# NEWLINE FOR INPUT -[[blocks]] -type = "prompt" -alignment = "left" -newline = true - -[[blocks.segments]] -template = "❯ " -foreground = "p:gb_bright_aqua" -background = "transparent" -type = "text" -style = "plain" diff --git a/yazi_1/.config/yazi/package.toml b/yazi_1/.config/yazi/package.toml deleted file mode 100644 index 9026e65..0000000 --- a/yazi_1/.config/yazi/package.toml +++ /dev/null @@ -1,174 +0,0 @@ -[[plugin.deps]] -use = "yazi-rs/plugins:smart-enter" -rev = "4e55902" -hash = "56fdabc96fc1f4d53c96eb884b02a5be" - -[[plugin.deps]] -use = "yazi-rs/plugins:git" -rev = "4e55902" -hash = "36a484acf6a0a0219c543ccb4cee218f" - -[[plugin.deps]] -use = "yazi-rs/plugins:mount" -rev = "4e55902" -hash = "e2d4bfccf31e5ab05f46fee4797c5215" - -[[plugin.deps]] -use = "yazi-rs/plugins:mime-ext" -rev = "4e55902" -hash = "48a77ab785d1ee73bc2d7bbe2a4c2090" - -[[plugin.deps]] -use = "ndtoan96/ouch" -rev = "cfb9140" -hash = "b5067143415bd2d46c0dfa57319ddcef" - -[[plugin.deps]] -use = "yazi-rs/plugins:piper" -rev = "4e55902" -hash = "2dd68af59418b631b9703a03f606b31f" - -[[plugin.deps]] -use = "boydaihungst/mediainfo" -rev = "90a1652" -hash = "7a83bfab51d1d2ba6558cc56bd52539a" - -[[plugin.deps]] -use = "AnirudhG07/rich-preview" -rev = "573b275" -hash = "c3e2871c9ef244fd181f203791f9b0d2" - -[[plugin.deps]] -use = "stelcodes/bunny" -rev = "7137a44" -hash = "58bfa473bcac8574400e573787954512" - -[[plugin.deps]] -use = "Lil-Dank/lazygit" -rev = "0e56060" -hash = "ab2e66065a94cca4886b303518e44bd8" - -[[plugin.deps]] -use = "MasouShizuka/projects" -rev = "eed0657" -hash = "ca79de2b3bb2247906e01b2261e5d2bb" - -[[plugin.deps]] -use = "XYenon/yafg" -rev = "6034c67" -hash = "11543279fd83ad4cacdfb07d67016928" - -[[plugin.deps]] -use = "Shallow-Seek/fazif" -rev = "6e10488" -hash = "c549ff30fb1d1d97c734010fe82f6295" - -[[plugin.deps]] -use = "GianniBYoung/rsync" -rev = "14d2828" -hash = "7394430ba473dce1023721622438bf3d" - -[[plugin.deps]] -use = "llanosrocas/yaziline" -rev = "6266926" -hash = "9917ab5cb9bdbab7ca7f2501f84f0f11" - -[[plugin.deps]] -use = "boydaihungst/file-extra-metadata" -rev = "4fbb106" -hash = "8765a20c837f4be5718f89ab1cf33b4" - -[[plugin.deps]] -use = "yazi-rs/plugins:full-border" -rev = "68f7d48" -hash = "3996fc74044bc44144b323686f887e1" - -[[plugin.deps]] -use = "pirafrank/what-size" -rev = "179ebf6" -hash = "57056b9728006881d580ccabe8154a9c" - -[[plugin.deps]] -use = "yazi-rs/plugins:toggle-pane" -rev = "57f1863" -hash = "8a7c58225816a163a6e8730c0adafbc8" - -[[plugin.deps]] -use = "AminurAlam/yazi-plugins:fchar" -rev = "658a099" -hash = "b484ff674a30268991b67f819f4625da" - -[[plugin.deps]] -use = "mshnwq/dupes" -rev = "18a9395" -hash = "730ddf5e1179f34ccb81f8d5ed564823" - -[[plugin.deps]] -use = "uhs-robert/recycle-bin" -rev = "69d7d4c" -hash = "38dac2fc8f4b50bbdaa46e699720a54a" - -[[plugin.deps]] -use = "Rolv-Apneseth/bypass" -rev = "c1e5fcf" -hash = "208e77480824f62558a5b037c8569d61" - -[[plugin.deps]] -use = "Ape/open-with-cmd" -rev = "e3d430f" -hash = "d29c1ffa99099181faf8c01d1f59aa4c" - -[[plugin.deps]] -use = "yazi-rs/plugins:smart-paste" -rev = "56971d0" -hash = "75fd60b2df7115e0a6ca31a6a804d320" - -[[plugin.deps]] -use = "larry-oates/open-git-remote" -rev = "95b3043" -hash = "8d17dcc063217b558a08ed8bb5e9e8ad" - -[[plugin.deps]] -use = "yazi-rs/plugins:vcs-files" -rev = "56971d0" -hash = "5cfd9b2bd3f8ec4e3245e3426a967f82" - -[[flavor.deps]] -use = "yazi-rs/flavors:catppuccin-mocha" -rev = "4a1802a" -hash = "b951d27afe197d154f6da9683b46c5f8" - -[[flavor.deps]] -use = "Mintass/rose-pine-moon" -rev = "94385fe" -hash = "edbe0dfb5db8ff37281dba62adc7e750" - -[[flavor.deps]] -use = "Chromium-3-Oxide/everforest-medium" -rev = "0158f0f" -hash = "a7c36abf0b13289aceb1c20a17c6a63e" - -[[flavor.deps]] -use = "bennyyip/gruvbox-dark" -rev = "619fdc5" -hash = "d4c7003ec6dc4efd5d3a050d5c2f2575" - -[[flavor.deps]] -use = "BennyOe/tokyo-night" -rev = "8e6296f" -hash = "d9da921c3bd37ba32ee27a8a7a40461f" - -[[flavor.deps]] -use = "dangooddd/kanagawa" -rev = "04985d1" -hash = "c69a63981e254a3a06a11c2bf0e6af1d" - -[[flavor.deps]] -use = "matt-dong-123/gruvbox-material" -rev = "6c36491" -hash = "564f2335540ee2c440c3b671bc28ac60" - -[[flavor.deps]] -use = "malick-tammal/monokai" -rev = "e59f6cb" -hash = "dcb449d46e30dc020e4b7b59202d2448" diff --git a/yazi_1/.config/yazi/plugins/bunny.yazi/LICENSE b/yazi_1/.config/yazi/plugins/bunny.yazi/LICENSE deleted file mode 100644 index e5d666c..0000000 --- a/yazi_1/.config/yazi/plugins/bunny.yazi/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ - The MIT License (MIT) - -Copyright © 2024 Stel Clementine - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/bunny.yazi/README.md b/yazi_1/.config/yazi/plugins/bunny.yazi/README.md deleted file mode 100644 index f0d1b5d..0000000 --- a/yazi_1/.config/yazi/plugins/bunny.yazi/README.md +++ /dev/null @@ -1,102 +0,0 @@ -# bunny.yazi 🐰 - -*đŸ©· Hop around your filesystem đŸ©·* - -This is a bookmark plugin for [yazi](https://github.com/sxyazi/yazi) which augments the builtin bookmarking abilities into a single menu of `cd` powers designed with user experience (and cuteness) in mind. Bookmarks are referred to as *hops* because users should always feel adorable while using their terminal. - -## Features - -- Create persistent hops in your `init.lua` config file -- Create ephemeral hops while using yazi -- Hop to any directory open in another tab -- Hop back to previous directory (history is associated with tab number) -- Hop by fuzzy searching available hops with [fzf](https://github.com/junegunn/fzf) or similar program -- Single menu for all functionality, therefore only one keymap is required in your `keymap.toml` file -- Hands off: no reads or writes to your filesystem, all state is kept in memory - -bunny.yazi menu open in a terminal - -## Installation - -### With `git` - -```sh -git clone https://github.com/stelcodes/bunny.yazi ~/.config/yazi/plugins/bunny.yazi -``` - -### With `yapack` - -```sh -ya pack -a stelcodes/bunny -``` - -### With Nix (Home Manager + flakes) - -`flake.nix`: -```nix -inputs = { - bunny-yazi = { - url = "github:stelcodes/bunny.yazi"; - flake = false; - }; -}; -``` - -Home Manager config: -```nix -programs.yazi = { - plugins.bunny = "${inputs.bunny-yazi}"; - initLua = '' - require("bunny"):setup({ ... }) - ''; - keymap.mgr.prepend_keymap = [ - { on = ";"; run = "plugin bunny"; desc = "Start bunny.yazi"; } - ]; -}; -``` - -## Configuration -`~/.config/yazi/init.lua`: -```lua -require("bunny"):setup({ - hops = { - { key = "/", path = "/", }, - { key = "t", path = "/tmp", }, - { key = "n", path = "/nix/store", desc = "Nix store" }, - { key = "~", path = "~", desc = "Home" }, - { key = "m", path = "~/Music", desc = "Music" }, - { key = "d", path = "~/Desktop", desc = "Desktop" }, - { key = "D", path = "~/Documents", desc = "Documents" }, - { key = "c", path = "~/.config", desc = "Config files" }, - { key = { "l", "s" }, path = "~/.local/share", desc = "Local share" }, - { key = { "l", "b" }, path = "~/.local/bin", desc = "Local bin" }, - { key = { "l", "t" }, path = "~/.local/state", desc = "Local state" }, - -- key and path attributes are required, desc is optional - }, - desc_strategy = "path", -- If desc isn't present, use "path" or "filename", default is "path" - ephemeral = true, -- Enable ephemeral hops, default is true - tabs = true, -- Enable tab hops, default is true - notify = false, -- Notify after hopping, default is false - fuzzy_cmd = "fzf", -- Fuzzy searching command, default is "fzf" -}) -``` - -`~/.config/yazi/keymap.toml`: -```toml -[[mgr.prepend_keymap]] -desc = "Start bunny.yazi" -on = ";" -run = "plugin bunny" - -# Optionally, add another keymap to immediately fuzzy search bookmarks -[[mgr.prepend_keymap]] -desc = "Start bunny.yazi fuzzy search" -on = "'" -run = "plugin bunny fuzzy" -``` - -## Inspiration - -[yamb.yazi](https://github.com/h-hg/yamb.yazi) - -[nnn bookmarks](https://github.com/jarun/nnn/wiki/Basic-use-cases#add-bookmarks) diff --git a/yazi_1/.config/yazi/plugins/bunny.yazi/main.lua b/yazi_1/.config/yazi/plugins/bunny.yazi/main.lua deleted file mode 100644 index 9fe49dd..0000000 --- a/yazi_1/.config/yazi/plugins/bunny.yazi/main.lua +++ /dev/null @@ -1,385 +0,0 @@ ---- @since 25.5.28 -local function debug(...) - local function toReadableString(val) - if type(val) == "table" then - local str = "{ " - for k, v in pairs(val) do - str = str .. "[" .. tostring(k) .. "] = " .. toReadableString(v) .. ", " - end - return str .. "}" - elseif type(val) == "Url" then - return "Url:" .. tostring(val) - else - return tostring(val) - end - end - local args = { ... } - local processed_args = {} - for _, arg in pairs(args) do - table.insert(processed_args, toReadableString(arg)) - end - ya.dbg("BUNNY.YAZI", table.unpack(processed_args)) -end -local function fail(s, ...) ya.notify { title = "bunny.yazi", content = string.format(s, ...), timeout = 4, level = "error" } end -local function info(s, ...) ya.notify { title = "bunny.yazi", content = string.format(s, ...), timeout = 2, level = "info" } end - -local get_state = ya.sync(function(state, attr) - return state[attr] -end) - -local set_state = ya.sync(function(state, attr, value) - state[attr] = value -end) - -local get_cwd = ya.sync(function(state) - return tostring(cx.active.current.cwd) -- Url objects are evil >.<" -end) - -local get_current_tab_idx = ya.sync(function(state) - return cx.tabs.idx -end) - -local get_tabs_as_paths = ya.sync(function(state) - local tabs = cx.tabs - local active_tab_idx = tabs.idx - local result = {} - for idx = 1, #tabs, 1 do - if idx ~= active_tab_idx and tabs[idx] then - result[idx] = tostring(tabs[idx].current.cwd) - end - end - return result -end) - -local some = function(...) - for _, v in ipairs({ ... }) do - if v ~= nil then - return v - end - end -end - -local function filename(pathstr) - if pathstr == "/" then return pathstr end - local url_name = Url(pathstr):name() - if url_name then - return tostring(url_name) - else - return pathstr - end -end - -local function path_to_desc(path, strategy) - if strategy == "filename" then - return filename(path) - end - local home = os.getenv("HOME") - if home and home ~= "" then - local startPos, endPos = string.find(path, home) - -- Only substitute if the match is from the start of path, very important - if startPos == 1 then - return "~" .. path:sub(endPos + 1) - end - end - return tostring(path) -end - -local function sort_hops(hops) - local function convert_key(key) - local t = type(key) - if t == "table" then - -- If table, sort by first key string - return key[1] - elseif t == "string" and string.lower(key) ~= key then - -- If uppercase letter (signifying an ephemeral hop), prepend "z" - -- so it gets sorted after lowercase persistent hops - return "z" .. key - end - return key - end - table.sort(hops, function(x, y) - return convert_key(x.key) < convert_key(y.key) - end) - return hops -end - -local create_special_hops = function(config) - local hops = {} - local desc_strategy, tabs, ephemeral = config.desc_strategy, config.tabs, config.ephemeral - if ephemeral then - table.insert(hops, { key = "", desc = "Create hop", path = "__MARK__" }) - end - table.insert(hops, { key = "", desc = "Fuzzy search", path = "__FUZZY__" }) - local tabhist = get_state("tabhist") - local tab = get_current_tab_idx() - if tabhist[tab] and tabhist[tab][2] then - local previous_dir = tabhist[tab][2] - table.insert(hops, { - key = "", - path = previous_dir, - desc = path_to_desc(previous_dir, desc_strategy) - }) - end - if tabs then - for idx, tab_path in pairs(get_tabs_as_paths()) do - table.insert(hops, { - key = tostring(idx), - path = tab_path, - desc = path_to_desc(tab_path, desc_strategy) - }) - end - end - return hops -end - -local function validate_options(options) - local function validate_key(key) - local kt = type(key) - if not key then - return false, "key is missing" - elseif kt == "string" then - if utf8.len(key) ~= 1 then - return false, "key must be single character" - end - elseif kt == "table" then - if #key == 0 then - return false, "key cannot be empty table" - end - for _, char in pairs(key) do - if utf8.len(char) ~= 1 then - return false, "key list must contain single characters" - end - end - else - return false, "key must be string or table" - end - return true, "" - end - if type(options) ~= "table" then - return "Invalid config" - end - local hops, desc_strategy, tabs, ephemeral, fuzzy_cmd, notify = - options.hops, options.desc_strategy, options.tabs, - options.ephemeral, options.fuzzy_cmd, options.notify - -- Validate hops - if type(hops) == "table" then - local used_keys = {} - for idx, hop in pairs(hops) do - hop.desc = hop.desc or hop.tag or nil -- used to be tag, allow for backwards compat - local key_is_validated, key_err = validate_key(hop.key) - local err = 'Invalid "hops" config value: #' .. idx .. " " - if not key_is_validated then - return err .. key_err - elseif not hop.path then - return err .. 'path is missing' - elseif type(hop.path) ~= "string" or string.len(hop.path) == 0 then - return err .. 'path must be non-empty string' - elseif hop.desc and (type(hop.desc) ~= "string" or string.len(hop.path) == 0) then - return err .. 'desc must be non-empty string' - end - -- Check for duplicate keys - if used_keys[hop.key] then - return err .. 'needs unique key' - end - -- Insert hop keys as table keys to easily check for set membership - used_keys[hop.key] = true - end - else - return 'Invalid "hops" config value' - end - -- Validate other options - if desc_strategy ~= nil and desc_strategy ~= "path" and desc_strategy ~= "filename" then - return 'Invalid "desc_strategy" config value' - elseif tabs ~= nil and type(notify) ~= "boolean" then - return 'Invalid "tabs" config value' - elseif ephemeral ~= nil and type(notify) ~= "boolean" then - return 'Invalid "ephemeral" config value' - elseif fuzzy_cmd ~= nil and type(fuzzy_cmd) ~= "string" then - return 'Invalid "fuzzy_cmd" config value' - elseif notify ~= nil and type(notify) ~= "boolean" then - return 'Invalid "notify" config value' - end -end - --- https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/fzf.lua --- https://github.com/sxyazi/yazi/blob/main/yazi-plugin/src/process/child.rs --- Returns nil if fzf command failed or user exited with escape key -local select_fuzzy = function(hops, config) - local permit = ui.hide() - local child, spawn_err = - Command(config.fuzzy_cmd):stdin(Command.PIPED):stdout(Command.PIPED):stderr(Command.INHERIT):spawn() - if not child then - fail("Command `%s` failed with code %s. Do you have it installed?", config.fuzzy_cmd, spawn_err.code) - return - end - local fuzzy_entries = {} - for _, hop in pairs(hops) do - local existing_desc = fuzzy_entries[hop.path] - if not existing_desc or existing_desc == "" then - local fuzzy_desc = hop.desc - -- Avoid repeating path in description - if fuzzy_desc == hop.path then - fuzzy_desc = "" - end - fuzzy_entries[hop.path] = fuzzy_desc - end - end - -- Build fzf input string - local input_lines = {} - for entry_path, entry_desc in pairs(fuzzy_entries) do - local line = entry_desc .. string.rep(" ", 23 - #entry_desc) .. "\t" .. entry_path - table.insert(input_lines, line) - end - child:write_all(table.concat(input_lines, "\n")) - child:flush() - local output, output_err = child:wait_with_output() - permit:drop() - if not output.status.success then - if output.status.code ~= 130 then -- user pressed escape to quit - fail("Command `%s` failed with code %s", config.fuzzy_cmd, output_err.code) - end - return - end - -- Parse fzf output, remove right padded spaces from desc - local desc, path = string.match(output.stdout, "^(.-) *\t(.-)\n$") - if not desc or not path or path == "" then - fail("Failed to parse fuzzy searcher result") - return - end - if desc == "" then - desc = path_to_desc(path, config.desc_strategy) - end - return { desc = desc, path = path } -end - -local cd = function(selected_hop, config) - local _, dir_list_err = fs.read_dir(Url(selected_hop.path), { limit = 1, resolve = true }) - if dir_list_err then - fail("Invalid directory " .. path_to_desc(selected_hop.path)) - return - end - -- Assuming that if I can fs.read_dir, then this will also succeed - ya.emit("cd", { selected_hop.path }) - if config.notify then - info('Hopped to ' .. selected_hop.desc) - end -end - -local attempt_hop = function(hops, config) - local cands = {} - for _, hop in pairs(create_special_hops(config)) do - table.insert(cands, { desc = hop.desc, on = hop.key, path = hop.path }) - end - for _, hop in pairs(hops) do - table.insert(cands, { desc = hop.desc, on = hop.key, path = hop.path }) - end - local hops_idx = ya.which { cands = cands } - if not hops_idx then return end - local selected_hop = cands[hops_idx] - -- Handle special hops - if selected_hop.path == "__MARK__" then - local mark_cands = {}; - -- Ideally any unicode character would be supported, but yazi.which - -- requies a concrete list of candidates - local candidate_chars = { - 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', - 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', - 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', - 'W', 'X', 'Y', 'Z', '`', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', - '-', '_', '=', '+', '[', '{', ']', '}', '\\', '|', ';', ':', "'", '"', ',', '<', - '.', '>', '/', '?', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' - } - for _, char in pairs(candidate_chars) do - table.insert(mark_cands, { on = char }) - end - info("Press a key to create new hop") - local char_idx = ya.which { cands = mark_cands, silent = true } - if char_idx ~= nil then - local selected_char = mark_cands[char_idx].on - local cwd = get_cwd() - table.insert(hops, { key = selected_char, path = cwd, desc = path_to_desc(cwd, config.desc_strategy) }) - set_state("hops", sort_hops(hops)) - end - return - elseif selected_hop.path == "__FUZZY__" then - local fuzzy_hop = select_fuzzy(hops, config) - if not fuzzy_hop then return end - selected_hop = fuzzy_hop - end - cd(selected_hop, config) -end - -local function init() - local options = get_state("options") - local err = validate_options(options) - if err then - set_state("init_error", err) - fail(err) - return - end - -- Set default config values - local desc_strategy = options.desc_strategy or "path" - set_state("config", { - desc_strategy = desc_strategy, - fuzzy_cmd = some(options.fuzzy_cmd, "fzf"), - notify = some(options.notify, false), - ephemeral = some(options.ephemeral, true), - tabs = some(options.tabs, true), - }) - -- Set hops after ensuring they all have a description - local hops = {} - for _, hop in pairs(options.hops) do - hop.desc = hop.desc or path_to_desc(hop.path, desc_strategy) - -- Manually replace ~ from users so we can make a valid Url later to check if dir exists - if string.sub(hop.path, 1, 1) == "~" then - hop.path = os.getenv("HOME") .. hop.path:sub(2) - end - table.insert(hops, hop) - end - set_state("hops", sort_hops(hops)) - set_state("init", true) -end - -return { - setup = function(state, options) - state.options = options - ps.sub("cd", function(body) - -- Note: This callback is sync and triggered at startup! - local tab = body.tab -- type number - -- Very important to turn this into a string because Url has ownership issues - -- when passed to standard utility functions >.<' - -- https://github.com/sxyazi/yazi/issues/2159 - local cwd = tostring(cx.active.current.cwd) - -- Upon startup this will be nil so initialize if necessary - local tabhist = state.tabhist or {} - -- tabhist structure:{ = { , }, ... } - if not tabhist[tab] then - -- If fresh tab, initialize tab history table - tabhist[tab] = { cwd } - else - -- Otherwise, shift history table to the right and add cwd to the front - tabhist[tab] = { cwd, tabhist[tab][1] } - end - state.tabhist = tabhist - end) - end, - entry = function(self, job) - if not get_state("init") then - init() - end - local init_error = get_state("init_error") - if init_error then - fail(init_error) - return - end - local hops, config = get_state("hops"), get_state("config") - if job.args[1] == "fuzzy" then - local fuzzy_hop = select_fuzzy(hops, config) - if fuzzy_hop then - cd(fuzzy_hop, config) - end - else - attempt_hop(hops, config) - end - end, -} diff --git a/yazi_1/.config/yazi/plugins/bypass.yazi/LICENSE b/yazi_1/.config/yazi/plugins/bypass.yazi/LICENSE deleted file mode 100644 index c03ce66..0000000 --- a/yazi_1/.config/yazi/plugins/bypass.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Rolv Apneseth - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/bypass.yazi/README.md b/yazi_1/.config/yazi/plugins/bypass.yazi/README.md deleted file mode 100644 index 9f10d04..0000000 --- a/yazi_1/.config/yazi/plugins/bypass.yazi/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# bypass.yazi - -[Yazi](https://github.com/sxyazi/yazi) plugin for bidirectional skipping of directories which only have a single subdirectory - - - -## Requirements - -- [Yazi](https://github.com/sxyazi/yazi) v25.3.2+ - -## Installation - -```bash -ya pkg add Rolv-Apneseth/bypass -``` - -### Manual - -```sh -# Linux / MacOS -git clone https://github.com/Rolv-Apneseth/bypass.yazi.git ~/.config/yazi/plugins/bypass.yazi -# Windows -git clone https://github.com/Rolv-Apneseth/bypass.yazi.git %AppData%\yazi\config\plugins\bypass.yazi -``` - -## Usage - -Add this to your `keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = [ "L" ] -run = "plugin bypass" -desc = "Recursively enter child directory, skipping children with only a single subdirectory" -[[mgr.prepend_keymap]] -on = [ "H" ] -run = "plugin bypass reverse" -desc = "Recursively enter parent directory, skipping parents with only a single subdirectory" -``` - -And that's it. You can bind any key you like, including overriding the default `enter` and `leave` bindings by setting them to `l` and `h` respectively. - -Note that if you're using the [smart enter tip](https://yazi-rs.github.io/docs/tips#smart-enter) from the documentation, this plugin can replace that entirely by using this keybind instead: - -```toml -[[mgr.prepend_keymap]] -on = [ "l" ] -run = "plugin bypass smart-enter" -desc = "Open a file, or recursively enter child directory, skipping children with only a single subdirectory" -``` diff --git a/yazi_1/.config/yazi/plugins/bypass.yazi/main.lua b/yazi_1/.config/yazi/plugins/bypass.yazi/main.lua deleted file mode 100644 index 7190f25..0000000 --- a/yazi_1/.config/yazi/plugins/bypass.yazi/main.lua +++ /dev/null @@ -1,106 +0,0 @@ ----@since 25.3.2 - --- For development ---[[ local function notify(message) ]] ---[[ ya.notify({ title = "Bypass", content = message, timeout = 5 }) ]] ---[[ end ]] - --- `ya.emit` as of 25.5.28 -local emit = ya.emit or ya.manager_emit - ----Returns the loading state of the current directory ----@type fun(): boolean -local is_directory_loading = ya.sync(function(_) - -- Try to use the v25.4.8 interface - local ok, res = pcall(cx.active.current.stage) - if ok then - return not res - -- Fallback to the v25.3.2 interface - else - return cx.active.current.stage.is_loading - end -end) - ----Enter hovered item if it is a directory ----@type fun(use_smart_enter: boolean): boolean -local initial = ya.sync(function(_, use_smart_enter) - local hovered = cx.active.current.hovered - if hovered == nil then - return false - end - - if not hovered.cha.is_dir then - -- Open file if using "smart enter" - if use_smart_enter then - emit("escape", { visual = true, select = true }) - emit("open", { hovered = true }) - end - return false - end - - emit("escape", { visual = true, select = true }) - emit("enter", { hovered = true }) - - return true -end) - ----Enter hovered item if it is a directory and is the only item in the parent ----@type fun(): boolean -local bypass = ya.sync(function(_) - local hovered = cx.active.current.hovered - - if hovered == nil or not hovered.cha.is_dir or #cx.active.current.files > 1 then - return false - end - - emit("enter", { hovered = true }) - - return true -end) - ----Leave the CWD, if the CWD has a parent ----@type fun(): boolean -local initial_rev = ya.sync(function(_) - if cx.active.parent == nil then - return false - end - - emit("escape", { visual = true, select = true }) - emit("leave", {}) - - return true -end) - ----Leave the CWD, if the CWD has a parent and contains only one item ----@type fun(): boolean -local bypass_rev = ya.sync(function(_) - if cx.active.parent == nil or #cx.active.current.files > 1 then - return false - end - - emit("leave", {}) - - return true -end) - -return { - entry = function(_, job) - -- old version of Yazi will pass args directly, new version passes job. Below code ensures we derive args in both 0.3 and 0.4 Yazi API versions. - local args = job.args or job - local use_smart_enter = args and args[1] == "smart-enter" - local is_reverse = args and args[1] == "reverse" - - -- Initial run, should behave like a regular enter/smart-enter/leave - local run = is_reverse and initial_rev() or initial(use_smart_enter) - - while run do - -- Wait for directory to have loaded - while is_directory_loading() do - ya.sleep(0.002) - end - - -- Conditional enter/smart-enter/leave - run = is_reverse and bypass_rev() or bypass() - end - end, -} diff --git a/yazi_1/.config/yazi/plugins/dupes.yazi/LICENSE b/yazi_1/.config/yazi/plugins/dupes.yazi/LICENSE deleted file mode 100644 index e0f91df..0000000 --- a/yazi_1/.config/yazi/plugins/dupes.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Mshnwq - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/dupes.yazi/README.md b/yazi_1/.config/yazi/plugins/dupes.yazi/README.md deleted file mode 100644 index b2cc8a2..0000000 --- a/yazi_1/.config/yazi/plugins/dupes.yazi/README.md +++ /dev/null @@ -1,221 +0,0 @@ -# Dupes Plugin for Yazi - -Duplicate files plugin for [Yazi](https://github.com/sxyazi/yazi) file manager, leveraging [jdupes](https://codeberg.org/jbruchon/jdupes) for fast and efficient duplicate detection. - -> [!NOTE] -> The latest release of Yazi is required at the moment. - -https://github.com/user-attachments/assets/1d87bb52-d326-4720-834c-baac74008d7d - -## Features - -- 🔍 **Fast Duplicate Detection** - Uses jdupes for high-performance scanning -- đŸ‘ïž **Visual Preview** - See duplicates directly in Yazi with deletion markers -- đŸ§Ș **Dry Run Mode** - Preview what will be deleted before applying changes -- ⚙ **Profile System** - Define custom scanning or override profiles for different use cases -- đŸ’Ÿ **Export Results** - Save scan results to JSON or text files -- 🔒 **Safe by Default** - Confirmation required for destructive operations - -## Requirements - -- [Yazi](https://github.com/sxyazi/yazi) file manager (v25.5.31+) -- [jdupes](https://codeberg.org/jbruchon/jdupes) command-line tool - -## Installation - -**Using yazi package manager:** -```sh -ya pkg add mshnwq/dupes -``` - -**Using nix home-manager (nixpkgs): (recommended)** -```nix -{ pkgs, ... }: { - programs.yazi = { - enable = true; - plugins = { - # jdupes is self contained within - dupes = pkgs.yaziPlugins.dupes - }; - }; -} -``` - -**Using nix home-manager (github):** -```nix -{ pkgs, ... }: { - home.packages = with pkgs; [ jdupes ]; - programs.yazi = { - enable = true; - plugins = { - dupes = pkgs.fetchFromGitHub { - owner = "mshnwq"; - repo = "dupes.yazi"; - rev = "4666b6f299c2257c011f622319ae97fab8adbabe"; - hash = "sha256-v9xuSY/i/trIHHbOPbijd0AmcUb2vufNL9BSjBE6+Vo="; - }; - }; - }; -} -``` - -**Manual installation:** -```sh -git clone https://github.com/mshnwq/dupes.yazi.git ~/.config/yazi/plugins/dupes.yazi -``` - -## Usage - -Configuration in `~/.config/yazi/init.lua`: -```lua -require("dupes"):setup { - -- Global settings - save_op = false, -- Save results to file by default - -- auto_confirm = true, -- Skip confirmation for apply (use with caution!) - - profiles = { - -- Interactive mode: recursively scan and display duplicates - interactive = { - args = { "-r" }, - }, - -- Apply mode: recursively scan and DELETE duplicates - apply = { - args = { "-r", "-N", "-d" }, - save_op = true, -- Save results before deletion - }, - -- Custom profile example (uncomment to use) - -- custom = { - -- args = { "-r", "-s", }, -- Your custom jdupes flags - -- }, - }, -} -``` - -Keybindings in `~/.config/yazi/keymap.toml`: -```toml -[[manager.prepend_keymap]] -on = ["", "i"] -run = "plugin dupes interactive" -desc = "Run dupes interactive" - -[[manager.prepend_keymap]] -on = ["", "o"] -run = "plugin dupes override" -desc = "Run dupes override" - -[[manager.prepend_keymap]] -on = ["", "d"] -run = "plugin dupes dry" -desc = "Run dupes dry" - -[[manager.prepend_keymap]] -on = ["", "a"] -run = "plugin dupes apply" -desc = "Run dupes apply" - -# [[mgr.prepend_keymap]] -# on = ["", "c"] -# run = "plugin dupes custom" -# desc = "Run dupes custom" -``` - -### Profiles - -#### 🔍 Interactive Mode -Scans for duplicates and displays them in Yazi. Safe to use - no files are deleted. - -```lua -interactive = { - args = { "-r" }, -- Recursive scan -} -``` -#### đŸ§Ș Dry Run Mode (inherits apply mode) -Shows what **would** be deleted using the same settings as apply mode. Files marked 'X' will be deleted. The first file in each duplicate set is kept. - -- Normal files: displayed normally (will be kept) -- Files marked 'X': will be deleted - -#### ⚠ Apply Mode -**DESTRUCTIVE OPERATION** - Permanently deletes duplicate files. - -```lua -apply = { - args = { "-r", "-N", "-d" }, - save_op = true, -- Saves results to dupes.json -} -``` - -#### đŸ› ïž Override Mode -Opens an input dialog where you can enter custom jdupes arguments for one-time scans. - -**Example inputs:** -- `-r -s` - Recursive, follow symlinks - -## Configuration Options - -### Global Settings - -```lua -require("dupes"):setup { - save_op = false, -- Default: don't save results to file - auto_confirm = false, -- Default: prompt before deletion - profiles = { - -- Your profiles here - }, -} -``` - -### Profile Settings - -Each profile can have: - -```lua -profile_name = { - args = { "-r", "-N" }, -- jdupes command arguments - save_op = true, -- Override global save_op for this profile -} -``` - -### Common jdupes Flags - -| Flag | Description | -|------|-------------| -| `-r` | Recursive search in subdirectories | -| `-d` | **DELETE duplicates (DESTRUCTIVE!)** | -| `-j` | JSON output (added by plugin) | -| `-s` | Follows symbolic links | - -See `jdupes --help` for complete flag list. - -## Custom Examples - -### Example: Find duplicates in current directory only -```lua -shallow = { - args = {}, -- No -r flag, current directory only -} -``` - -## Output Files - -When `save_op = true`, results are saved to: - -- **dupes.json** - JSON format -- **dupes.txt** - Text format (when destructive) - -Files are saved in the current working directory. - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. - -## Credits - -- [Yazi](https://github.com/sxyazi/yazi) file manager -- [jdupes](https://codeberg.org/jbruchon/jdupes) for duplicate detection -- [boydaihungst](https://github.com/boydaihungst) for help on Yazi's [Discord](https://discord.gg/qfADduSdJu) channel - -## See Also - -- [jdupes Documentation](https://codeberg.org/jbruchon/jdupes) -- [Yazi Plugins](https://yazi-rs.github.io/docs/plugins/overview) diff --git a/yazi_1/.config/yazi/plugins/dupes.yazi/main.lua b/yazi_1/.config/yazi/plugins/dupes.yazi/main.lua deleted file mode 100644 index f3f9aa2..0000000 --- a/yazi_1/.config/yazi/plugins/dupes.yazi/main.lua +++ /dev/null @@ -1,600 +0,0 @@ ---- Dupes Plugin: Dynamic jdupes runner for Yazi file manager ---- @since 25.5.31 ---- @description Finds and manages duplicate files using jdupes - -local M = {} - --- ============================================================================ --- STATE MANAGEMENT --- ============================================================================ - ---- Thread-safe state setter ---- @param state table The global state object ---- @param key string State key to set ---- @param value any Value to store -local set_state = ya.sync(function(state, key, value) state[key] = value end) - ---- Thread-safe state getter ---- @param state table The global state object ---- @param key string State key to retrieve ---- @return any The stored value -local get_state = ya.sync(function(state, key) return state[key] end) - ---- Get current working directory from Yazi context ---- @return string Current working directory path -local get_cwd = ya.sync(function() return cx.active.current.cwd end) - --- ============================================================================ --- DISPLAY FUNCTIONS --- ============================================================================ - ---- Display duplicate files in Yazi's file list ---- @param _cwd string Current working directory ---- @param data table Parsed JSON data from jdupes output ---- @param style boolean If true, shows dry-run preview with deletion markers -local function display_dupes(_cwd, data, style) - -- Validate input data structure - if not data or not data.matchSets then - ya.dbg("Invalid or missing matchSets in JSON data") - ya.notify { - title = "Dupes Plugin", - content = "Invalid JSON data: no matchSets", - level = "error", - timeout = 5, - } - return - end - - ya.dbg(string.format("Entering display_dupes, cwd: %s", _cwd)) - - -- Create unique ID for this file operation - local id = ya.id("ft") - - -- Set search context title based on mode - local cwd - if style then - cwd = _cwd:into_search("Duplicate files Dry Run Preview 'X means will be deleted'") - else - cwd = _cwd:into_search("Duplicate files") - end - - -- Navigate to the search view - ya.emit("cd", { Url(cwd) }) - - -- Initialize empty file list - ya.emit("update_files", { - op = fs.op("part", { id = id, url = Url(cwd), files = {} }), - }) - - -- Build file list from duplicate sets - local files = {} - for i, matchSet in ipairs(data.matchSets) do - local dupe_set = string.format("dup-set-%02d", i) - ya.dbg(string.format("Processing group: %s", dupe_set)) - - -- Process each file in the duplicate set - for j, fileObj in ipairs(matchSet.fileList) do - local url = Url(cwd):join(fileObj.filePath) - local cha = fs.cha(url, true) - - local file - if style then - -- In dry-run mode, mark files for deletion (except first one) - if j == 1 then - -- First file in set: keep it (normal display) - file = File { url = url, cha = cha } - else - -- Subsequent files: mark as dummy (will be deleted) - local dcha = Cha { - kind = 16, - is_dummy = true, - len = cha.len, - gid = cha.gid, - uid = cha.uid, - atime = cha.atime, - btime = cha.btime, - mtime = cha.mtime, - perm = cha.perm, - } - file = File { url = url, cha = dcha } - end - else - -- Normal mode: display all files equally - file = File { url = url, cha = cha } - end - - table.insert(files, file) - ya.dbg(string.format("[Dupes] Added file %s", file.url)) - end - end - - -- Update the file list in Yazi - ya.emit("update_files", { - op = fs.op("part", { id = id, url = Url(cwd), files = files }), - }) - - -- NOTE: Finalization with 'done' operation breaks file ordering - -- Keeping these commented for future investigation - -- ya.emit("update_files", { - -- op = fs.op("done", { - -- id = id, - -- url = Url(cwd), - -- cha = Cha({ kind = 16, mode = tonumber("100644", 8) }) - -- }) - -- }) - - -- Show notification with results - local mode_text = style and " (DRY RUN)" or "" - ya.notify { - title = "Dupes Plugin", - content = string.format("Found %d files%s", #files, mode_text), - level = "info", - timeout = 3, - } -end - --- ============================================================================ --- FILE SAVING FUNCTIONS --- ============================================================================ - ---- Save jdupes output to file (JSON or plain text) ---- @param cwd string Directory to save the file in ---- @param stdout string Raw output from jdupes ---- @param format string Output format: "json" or "txt" ---- @return boolean success True if file was saved successfully -local function save_output(cwd, stdout, format) - -- Validate format - format = format or "json" - if format ~= "json" and format ~= "txt" then - ya.err(string.format("Invalid format '%s', defaulting to 'json'", format)) - format = "json" - end - - -- Construct file path - local file_path = string.format("%s/dupes.%s", cwd, format) - - -- Attempt to write file - local file, err = io.open(file_path, "w") - if not file then - ya.err(string.format("Failed to write dupes.%s to %s: %s", format, file_path, err or "unknown error")) - ya.notify { - title = "Dupes Plugin", - content = string.format("Failed to save file: %s", err or "unknown error"), - level = "error", - timeout = 5, - } - return false - end - - -- Write content and close - file:write(stdout) - file:close() - - -- Success notification - ya.notify { - title = "Dupes Plugin", - content = string.format("Saved dupes.%s to %s", format, file_path), - level = "info", - timeout = 3, - } - - return true -end - --- ============================================================================ --- COMMAND BUILDING AND VALIDATION --- ============================================================================ - ---- Build final command arguments with proper flag handling ---- @param args table User-provided arguments ---- @param no_json boolean Whether to exclude JSON flag ---- @return table Final argument list -local function build_command_args(args, no_json) - -- Check if JSON flag already exists - local has_j_flag = false - for _, arg in ipairs(args) do - if arg:match("^%-[^-]*j") or arg == "-j" then - has_j_flag = true - break - end - end - - -- Build final argument list - local final_args = {} - - -- Add JSON flag if needed and not disabled - if not has_j_flag and not no_json then - table.insert(final_args, "-j") - end - - -- Add all user arguments - for _, arg in ipairs(args) do - table.insert(final_args, arg) - end - - return final_args -end - ---- Execute shell command with proper error handling ---- @param cmdline string Base command (e.g., "jdupes") ---- @param args table Command arguments ---- @return table Command result with status, stdout, stderr -local function execute_command(cmdline, args) - local argstr = table.concat(args, " ") - local full_cmd = string.format("%s . %s 2>&1", cmdline, argstr) - - ya.dbg(string.format("Executing: %s", full_cmd)) - - local cmd = Command(get_state("shell")):arg({ "-c", full_cmd }):stdout(Command.PIPED):stderr(Command.PIPED):output() - - -- Log execution results - ya.dbg(string.format("Exit code: %s", tostring(cmd.status.code))) - - if cmd.stdout and #cmd.stdout > 0 then - ya.dbg(string.format("STDOUT length: %d bytes", #cmd.stdout)) - end - - if cmd.stderr and #cmd.stderr > 0 then - ya.err(string.format("STDERR:\n%s", cmd.stderr)) - end - - return cmd -end - --- ============================================================================ --- CORE EXECUTION FUNCTION --- ============================================================================ - ---- Execute jdupes with given profile configuration ---- @param profile_name string Name of the profile being run ---- @param conf table Configuration with cmdline and args ---- @param save_to_file boolean Whether to save output to file ---- @param no_display boolean Whether to skip displaying results in Yazi ---- @param no_json boolean Whether to output plain text instead of JSON -local function run_dupes(profile_name, conf, save_to_file, no_display, no_json) - -- Validate configuration - if not conf then - ya.err(string.format("ERROR: Profile '%s' configuration is nil!", profile_name)) - return - end - - if not conf.cmdline then - ya.err(string.format("ERROR: Profile '%s' missing cmdline", profile_name)) - return - end - - -- Extract configuration with defaults - local cmdline = conf.cmdline - local args = conf.args or {} - save_to_file = save_to_file or false - no_display = no_display or false - no_json = no_json or false - - -- Build command arguments - local final_args = build_command_args(args, no_json) - - -- Execute command - local cwd = get_cwd() - local cmd = execute_command(cmdline, final_args) - - -- Handle command results - if cmd.status.success then - -- Save output to file if requested - if save_to_file then - local format = no_json and "txt" or "json" - save_output(cwd, cmd.stdout, format) - end - - -- Display results in Yazi unless suppressed - if not no_display and not no_json then - local parsed_data = ya.json_decode(cmd.stdout) - if parsed_data then - local is_dry_run = (profile_name == "dry") - display_dupes(cwd, parsed_data, is_dry_run) - else - ya.err("Failed to parse JSON output from jdupes") - ya.notify { - title = "Dupes Plugin", - content = "Failed to parse command output", - level = "error", - timeout = 5, - } - return - end - end - - -- Success notification - ya.notify { - title = "Dupes Plugin", - content = string.format("Profile '%s' completed successfully", profile_name), - level = "info", - timeout = 3, - } - else - -- Error notification with details - local error_msg = cmd.stderr or "(no error details available)" - ya.notify { - title = "Dupes Plugin", - content = string.format("Command failed:\n%s", error_msg), - level = "error", - timeout = 5, - } - end -end - --- ============================================================================ --- PROFILE HANDLING --- ============================================================================ - ---- Create dry-run configuration from apply profile ---- @param apply_conf table Apply profile configuration ---- @return table Dry-run configuration -local function create_dry_config(apply_conf) - local dry_args = {} - - -- Copy all arguments except destructive ones - for _, arg in ipairs(apply_conf.args) do - if arg ~= "-d" and arg ~= "--delete" then - table.insert(dry_args, arg) - else - ya.dbg(string.format("Excluded destructive flag: %s", arg)) - end - end - - return { - cmdline = apply_conf.cmdline, - args = dry_args, - } -end - ---- Parse custom arguments from user input ---- @param input string Space-separated argument string ---- @return table Parsed arguments -local function parse_custom_args(input) - local args = {} - for arg in input:gmatch("%S+") do - table.insert(args, arg) - end - return args -end - --- ============================================================================ --- UTILITY FUNCTIONS --- ============================================================================ - ---- Recursively dump table contents for debugging ---- @param tbl table Table to dump ---- @param indent number Current indentation level ---- @return table Array of formatted lines -local function dump_table(tbl, indent) - indent = indent or 0 - local lines = {} - local prefix = string.rep(" ", indent) - - for k, v in pairs(tbl or {}) do - if type(v) == "table" then - table.insert(lines, string.format("%s%s = {", prefix, tostring(k))) - for _, line in ipairs(dump_table(v, indent + 1)) do - table.insert(lines, line) - end - table.insert(lines, string.format("%s},", prefix)) - else - table.insert(lines, string.format("%s%s = %q,", prefix, tostring(k), tostring(v))) - end - end - - return lines -end - ---- Count table entries ---- @param tbl table Table to count ---- @return number Number of entries -local function count_table(tbl) - local count = 0 - for _ in pairs(tbl or {}) do - count = count + 1 - end - return count -end - --- ============================================================================ --- PLUGIN LIFECYCLE FUNCTIONS --- ============================================================================ - ---- Initialize the plugin with user configuration ---- Called from yazi/init.lua ---- @param opts table Configuration options -function M:setup(opts) - opts = opts or {} - - -- Set global options with defaults - set_state("save_op", opts.save_op or false) - set_state("auto_confirm", opts.auto_confirm or false) - set_state("cmdline", "jdupes") - set_state("shell", "bash") - - ya.dbg("Dupes Plugin Setup: Starting profile processing") - - -- Process and store user-defined profiles - local profiles = {} - if opts.profiles then - for profile_name, profile_conf in pairs(opts.profiles) do - -- Validate profile configuration - if not profile_conf then - ya.err(string.format("Profile '%s' has nil configuration, skipping", profile_name)) - else - local profile = { - cmdline = profile_conf.cmdline or get_state("cmdline"), - args = profile_conf.args or {}, - -- Profile-specific save_op overrides global setting - save_op = profile_conf.save_op ~= nil and profile_conf.save_op or get_state("save_op"), - } - profiles[profile_name] = profile - - -- Log detailed profile configuration - local profile_lines = dump_table(profile) - ya.dbg(string.format("Setup profile '%s':\n%s", tostring(profile_name), table.concat(profile_lines, "\n"))) - end - end - else - ya.dbg("Dupes Plugin Setup: No profiles provided in opts.profiles") - end - - set_state("profiles", profiles) - - -- Log summary - local profile_count = count_table(profiles) - ya.dbg(string.format("Dupes Plugin Setup: Complete with %d profiles", profile_count)) - - -- Register custom linemode to show deletion markers - -- Priority 1500 ensures it runs before most other linemodes - Linemode:children_add(function(self) - if not self._file.cha.is_dummy then - -- Normal file: no marker - return "" - elseif self._file.is_hovered then - -- Hovered dummy file: show black background 'X' - return ui.Line { " ", ui.Span("X"):style(ui.Style():bg("black")) } - else - -- Non-hovered dummy file: show red 'X' - return ui.Line({ " ", "X" }):style(ui.Style():fg("red")) - end - end, 1500) -end - ---- Main entry point when plugin is invoked ---- @param job string|table Profile name or job configuration -function M:entry(job) - -- Exit visual mode if active - ya.mgr_emit("escape", { visual = true }) - - -- Parse profile name from job argument - local profile_name = "interactive" -- default profile - if type(job) == "string" then - profile_name = job - elseif type(job) == "table" then - profile_name = (type(job.args) == "table" and job.args[1]) - or (type(job.args) == "string" and job.args) - or "interactive" - end - - ya.dbg(string.format("== Invoked profile: %s ==", profile_name)) - - -- ======================================================================== - -- SPECIAL PROFILE: override - -- Allows user to input custom jdupes arguments interactively - -- ======================================================================== - if profile_name == "override" then - ya.dbg("INFO: Waiting for custom input") - - local ov_args, ok = ya.input { - title = "Dupes Override - Enter custom args", - value = "-j", - position = { "top-center", y = 3, w = 45 }, - } - - if ok ~= 1 then - ya.dbg("Override cancelled by user") - return - end - - -- Parse and execute custom arguments - local p_args = parse_custom_args(ov_args) - run_dupes("override", { - cmdline = get_state("cmdline"), - args = p_args, - }, get_state("save_op")) - return - end - - -- ======================================================================== - -- SPECIAL PROFILE: dry - -- Inherits 'apply' profile but removes destructive flags for preview - -- ======================================================================== - if profile_name == "dry" then - local profiles = get_state("profiles") - local apply_conf = profiles["apply"] - - if not apply_conf then - ya.notify { - title = "Dupes Plugin", - content = "Cannot run dry: 'apply' profile missing.", - level = "error", - timeout = 4, - } - return - end - - -- Create dry-run configuration - local dry_conf = create_dry_config(apply_conf) - dry_conf.save_op = apply_conf.save_op - - run_dupes("dry", dry_conf, dry_conf.save_op) - return - end - - -- ======================================================================== - -- REGULAR PROFILE EXECUTION - -- ======================================================================== - local profiles = get_state("profiles") - local conf = profiles[profile_name] - - if not conf then - ya.err(string.format("ERROR: Profile '%s' not found", profile_name)) - ya.notify { - title = "Dupes Plugin", - content = string.format("Profile not found: %s", profile_name), - level = "error", - timeout = 3, - } - return - end - - -- ======================================================================== - -- SPECIAL PROFILE: apply - -- Destructive operation - requires confirmation and runs dry preview first - -- ======================================================================== - if profile_name == "apply" then - -- Check for auto-confirm or prompt user - local apply_confirm = get_state("auto_confirm") - or ya.confirm { - pos = { "center", y = -8, w = 36, h = 8 }, - title = "Confirm Deduplication operation?", - content = ui.Text { - ui.Line(""), - ui.Line("This will DELETE duplicate files!"):style(ui.Style():fg("red")), - ui.Line("If unsure, try dry run first"):style(th.confirm.content), - ui.Line(""), - }, - } - - if not apply_confirm then - ya.dbg("Apply cancelled by user") - ya.notify { - title = "Dupes Plugin", - content = "Operation cancelled", - level = "info", - timeout = 3, - } - return - end - - ya.dbg("Apply confirmed by user") - - -- First, run silent dry-run preview for logging - local dry_conf = create_dry_config(conf) - run_dupes("dry", dry_conf, conf.save_op, true) -- no_display = true - - -- Then execute actual deletion - run_dupes(profile_name, conf, conf.save_op, true, true) -- no_display, no_json - return - end - - -- ======================================================================== - -- STANDARD PROFILE EXECUTION - -- For 'interactive' and other custom profiles - -- ======================================================================== - run_dupes(profile_name, conf, conf.save_op) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/fazif.yazi/LICENSE b/yazi_1/.config/yazi/plugins/fazif.yazi/LICENSE deleted file mode 100644 index 8bbeb30..0000000 --- a/yazi_1/.config/yazi/plugins/fazif.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Shallow-Seek - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/yazi_1/.config/yazi/plugins/fazif.yazi/README.md b/yazi_1/.config/yazi/plugins/fazif.yazi/README.md deleted file mode 100644 index 181ee13..0000000 --- a/yazi_1/.config/yazi/plugins/fazif.yazi/README.md +++ /dev/null @@ -1,183 +0,0 @@ -fazif allows you to search over selected items in Yazi with your configuration of search and fuzzy filter command. - -You can config search command ([fd](https://github.com/sharkdp/fd), [rg](https://github.com/BurntSushi/ripgrep), [rga](https://github.com/phiresky/ripgrep-all), [ag](https://github.com/ggreer/the_silver_searcher), [astgrep](https://github.com/ast-grep/ast-grep) ...), fuzzy filter command ([fzf](https://github.com/junegunn/fzf), [fzy](https://github.com/jhawthorn/fzy), [zf](https://github.com/natecraddock/zf), [skim](https://github.com/lotabout/skim)), and options in a script and spawn all your scripts easily into yazi. Here are some use cases. - -1. Search within the current working directory when none are selected. - -For example, a simple directory jumper. Simply create a file in `~/.config/yazi/plugins/fazif.yazi` with one of the following, make it executable, and set a keybinding. - -``` -#!/usr/bin/env zsh -fd -H -t d|fzf -``` - -or - -``` -#!/usr/bin/env zsh -fd -H -t d|zf -``` - -or jump to a dir. outside CWD by applying your query to a upper dir. with a shortcut key. - -``` -#!/usr/bin/env zsh -fd -H -t d|fzf \ ---bind 'ctrl-e:transform:echo "change-prompt(Home_Dir> )+reload(fd . ~ --hidden --type d)"' \ -``` - -2. Search within selected files and directories - -Example 1: to jump to some dir. in the selected folders, simply create a file in `~/.config/yazi/plugins/fazif.yazi` with one of the following, make it executable, and set a keybinding. - - -``` -#!/usr/bin/env zsh -fd -H -t d "$@"|fzf -``` - -or - -``` -#!/usr/bin/env zsh -fd -H -t d "$@"|zf -``` - -Example 2: use `fazifrga` script to search for a pattern in selected PDFs and preview the matching pages that have the pattern with fzf. - -3. Reveal the selected file or enter the selected directory in a new yazi tab; if multiple items are selected in fzf (using the `-multi` option in fzf), then show the selected items in the search result view. - -For example, find relevant books using `faziffd` and reveal them in yazi's search result view, then use `fazifrga` to search for a pattern in these books. - -4. show recent modified files. -``` -#!/usr/bin/env zsh -fd -H -t f --changed-within 1d|fzf -``` -## How It Works - -This plugin acts as a bridge between Yazi and standalone scripts. The main.lua file serves as a generic wrapper that: -1. Passes the current working directory and selected files/directories from Yazi (`"$@"` in the script) to the script -2. Executes the specified script (passed as an argument in the keymap) -3. Send results in Yazi search pane if multiple selected or reveal/enter the selected item in a yazi new tab - -## Installation - -1. Install via ya: - -```bash -ya pkg -a Shallow-Seek/fazif -``` - -or - -```bash -git clone https://github.com/Shallow-Seek/fazif.yazi.git ~/.config/yazi/plugins/fazif.yazi -``` - -2. The 3 default scripts `faziffd`, `fazifrg`, and `fazifrga` provided are examples with features shown in the next section. The plugin still works with your scripts without them. - -Simple put your script in `~/.config/yazi/plugins/fazif.yazi` and set a keybinding to use them. To make your script search on selected items, just add `"$@"` to the search command. Check `faziffd` to see that. - -Also you need change your `rg` or `rga`'s delimiter to `U+00A0` by adding the option `--field-match-separator $'\u00a0'` -to your `rg` or `rga` commmand and `--delimiter $'\u00a0'` option to `fzf`. See the default `fazifrg` as an example. - -but you can modify the following line in `main.lua` to use your prefered delimiter. - -```lua -local file = line:find("\xC2\xA0") and line:sub(1, line:find("\xC2\xA0") - 1) or line -``` - -> UTF-8 encoding of `U+00A0` is `\xC2\xA0` - -Make sure your scripts are executable: - -```bash -chmod +x ~/.config/yazi/plugins/fazif.yazi/faziffd -chmod +x ~/.config/yazi/plugins/fazif.yazi/fazifrg -chmod +x ~/.config/yazi/plugins/fazif.yazi/fazifrga -chmod +x ~/.config/yazi/plugins/fazif.yazi/yourscript1 -... -``` -You may need to update the shebang (`#!`) in the example scripts. - -## Add Keymaps to Your Script - -The plugin can be configured to run any of your scripts by passing the script name as an argument. Add the following to your `~/.config/yazi/keymap.toml` to bind each script to a key combination: - -### Setting up all scripts: - -```toml -# File/Directory finder using fd + fzf -[[mgr.prepend_keymap]] -on = [ "b", "d" ] -run = "plugin fazif faziffd" -desc = "Find files/directories with fd and fzf" - -# Content finder using ripgrep + fzf -[[mgr.prepend_keymap]] -on = [ "b", "r" ] -run = "plugin fazif fazifrg" -desc = "Find content in files with ripgrep and fzf" - -# Document content finder using ripgrep-all + fzf -[[mgr.prepend_keymap]] -on = [ "b", "a" ] -run = "plugin fazif fazifrga" -desc = "Find content in documents with ripgrep-all and fzf" -... -``` - -That's it. is not the default `:`, you will need to change the delimiter in main.lua. - ---- -## Example scripts -Read this section if you use the default scripts `faziffd`, `fazifrg`, and `fazifrga`. - -### Features - -1. **faziffd** - File/directory jumper using `fd`. Txt preview with `bat` and Directory preview with `eza` -2. **fazifrg** - `ripgrep` on selected. Preview shows file content with `bat` when started with no input. With any input, `rg` kicks in, and the preview highlights the matching line. -3. **fazifrga** - `ripgrep-all` search in selected PDFs and DjVu. Preview shows the first page of a document when started with no input. With any input, `rga` kicks in, and the preview shows the matching page in the document. - -The 3 scripts use the following tools: - -- [fzf](https://github.com/junegunn/fzf) -- [fd](https://github.com/sharkdp/fd) - Used by `faziffd` -- [ripgrep](https://github.com/BurntSushi/ripgrep) - Used by `fazifrg` -- [ripgrep-all](https://github.com/phiresky/ripgrep-all) - Used by `fazifrga` -- [rga djvu adaptor](https://github.com/phiresky/ripgrep-all/discussions/166) - Used by `fazifrga` to search in djvu -- Additional tools for document previews: - - [kitty](https://sw.kovidgoyal.net/kitty/) Image preview uses kitty icat. You can also use other terminals that support image or use ueberzugpp. - - [bat](https://github.com/sharkdp/bat) - Used by `faziffd`, `fazifrg` - - [eza](https://github.com/eza-community/eza) - Used by `faziffd` - - `pdftoppm` from [poppler-utils](https://github.com/freedesktop/poppler) - Used by `faziffd`, `fazifrga` for pdf prevew. - - `ddjvu` from [djvulibre](https://github.com/DjVuLibre/djvulibre) - Used by `faziffd`, `fazifrga` for djvu preview. - - [libreoffice](https://github.com/LibreOffice/core) for office documents - Used by `faziffd` for office file preview. - -### Usage - -#### faziffd - File/Directory jumper - -- `Ctrl-w`: Search files in the home directory -- `Ctrl-e`: Search directories in the home directory -- `Alt-c`: Search directories in the current working directory -- `Ctrl-t`: Search files in the current working directory -- `Ctrl-f`: Search directories from the root -- `Ctrl-p`: Toggle the preview window/position -- `Ctrl-x`: Open in Yazi (new instance)(if `setsid` is not available, use `nohup`) - - -#### fazifrg, fazifrga - -- `Ctrl-y`: Switch between rga search mode and fzf filtering mode -- `Ctrl-p`: Toggle the preview window/position -- `Ctrl-o`: `fazifrg` open file in Neovim at the matched line. `fazifrga` open document in Zathura at the matched page and highlight the query. - -## License - -This plugin is released under the MIT License. - -## Acknowledgement -Plugin is based on the default [Yazi](https://github.com/sxyazi/yazi) fzf plugin and vcs-files plugin. Fzf scripts grow out of [fzf](https://github.com/junegunn/fzf)'s wiki and examples. - diff --git a/yazi_1/.config/yazi/plugins/fazif.yazi/faziffd b/yazi_1/.config/yazi/plugins/fazif.yazi/faziffd deleted file mode 100755 index 4b54d74..0000000 --- a/yazi_1/.config/yazi/plugins/fazif.yazi/faziffd +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env zsh - -fd . -H "$@" |fzf \ ---info=inline \ ---multi \ ---layout=reverse \ ---prompt='ctl-wetcrfp_CWD> ' \ ---bind 'ctrl-w:transform:echo "change-prompt(ctl-wetcrfp_Home_File> )+reload(fd . ~ --hidden --type f)"' \ ---bind 'ctrl-e:transform:echo "change-prompt(ctl-wetcrfp_Home_Dir> )+reload(fd . ~ --hidden --type d)"' \ ---bind 'alt-c:transform:echo "change-prompt(ctl-wetcrfp_CWD_Dir> )+reload(fd --hidden --type d)"' \ ---bind 'ctrl-t:transform:echo "change-prompt(ctl-wetcrfp_CWD_File> )+reload(fd --hidden --type f)"' \ ---bind 'ctrl-f:transform:echo "change-prompt(ctl-wetcrfp_root_Dir> )+reload(fd . / --hidden --type d)"' \ ---bind 'ctrl-r:transform:echo "change-prompt(ctl-wetcrfp_Root_File> )+reload(fd . / --hidden --type f)"' \ ---bind 'focus:transform-preview-label:echo {}' \ ---bind 'ctrl-p:change-preview-window(right|down|hidden)' \ ---bind 'focus:transform-preview-label:echo {}' \ ---bind 'ctrl-o:execute-silent(xdg-open-nvim {} &)' \ ---preview-window 'hidden' \ ---preview ' - printf "\033_Ga=d,q=1\033\\" - [ -d {} ] && eza -aTL 2 --group-directories-first --color=always --icons=always {} || - tmp="/tmp/fzf_preview" - case $(basename {}) in - *.pdf) - pdftoppm -q -f 1 -l 1 -jpeg -jpegopt quality=60 -scale-to-x 1000 -scale-to-y -1 -singlefile {} $tmp && \ - kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 $tmp.jpg - ;; - *.doc|*.docx|*.xls|*.xlsx|*.ppt|*.pptx|*.odt|*.ods|*.odp) - libreoffice --convert-to jpg --outdir /tmp {} >/dev/null 2>&1 - mv "/tmp/${$(basename {})%.*}.jpg" $tmp - kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 $tmp - ;; - *.djvu) - ddjvu -format=ppm -page=1 -size 1000x-1 -aspect=yes {} $tmp 2>/dev/null && \ - kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 $tmp - ;; - *) - if file --mime-type {} | grep -qP "image/(?!vnd\.djvu)"; then - kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {} - else - bat -p {} --color=always 2>/dev/null - fi - ;; - esac -' - diff --git a/yazi_1/.config/yazi/plugins/fazif.yazi/faziffdr b/yazi_1/.config/yazi/plugins/fazif.yazi/faziffdr deleted file mode 100755 index e5f93fe..0000000 --- a/yazi_1/.config/yazi/plugins/fazif.yazi/faziffdr +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env sh -FD_COMMAND5="fd --changed-within 5d" -FD_COMMAND1="fd --changed-within 1d" - - -$FD_COMMAND5 -t f . "$@" |fzf \ - --info=inline \ - --multi \ - --layout=reverse \ - --prompt='ctl-wetcrfp_CWD5d> ' \ - --bind "ctrl-w:transform:echo 'change-prompt(ctl-wetcrfp_HOME5d> )+reload($FD_COMMAND5 -t f . ~ )'" \ - --bind "ctrl-e:transform:echo 'change-prompt(ctl-wetcrfp_HOME1d)+reload($FD_COMMAND1 -t f . ~)'" \ - --bind "ctrl-t:transform:echo 'change-prompt(ctl-wetcrfp_CWD5d> )+reload($FD_COMMAND5 -t f)'" \ - --bind "alt-c:transform:echo 'change-prompt(ctl-wetcrfp_CWD1d> )+reload($FD_COMMAND1 -t f)'" \ - --bind "ctrl-r:transform:echo 'change-prompt(ctl-wetcrfp_HOMEA> )+reload($FD_COMMAND5 . ~)'" \ - --bind "ctrl-f:transform:echo 'change-prompt(ctl-wetcrfp_HOMEA_WithH> )+reload($FD_COMMAND1 -H . ~)'" \ - --bind 'focus:transform-preview-label:echo {}' \ - --bind 'ctrl-p:change-preview-window(right|down|hidden)' \ - --bind 'focus:transform-preview-label:echo {}' \ - --bind 'ctrl-x:execute-silent(setsid kitty nnn {} &)' \ - --bind 'ctrl-a:execute-silent(setsid kitty yazi {} &)' \ - --bind 'ctrl-s:execute-silent(setsid thunar {} &)' \ - --preview-window 'hidden' \ ---preview ' - printf "\033_Ga=d,q=1\033\\" - [ -d {} ] && eza -aTL 2 --group-directories-first --color=always --icons=always {} || - tmp="/tmp/fzf_preview" - case $(basename {}) in - *.pdf) - pdftoppm -q -f 1 -l 1 -jpeg -jpegopt quality=60 -scale-to-x 1000 -scale-to-y -1 -singlefile {} $tmp && \ - kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 $tmp.jpg - ;; - *.doc|*.docx|*.xls|*.xlsx|*.ppt|*.pptx|*.odt|*.ods|*.odp) - libreoffice --convert-to jpg --outdir /tmp {} >/dev/null 2>&1 - mv "/tmp/${$(basename {})%.*}.jpg" $tmp - kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 $tmp - ;; - *.djvu) - ddjvu -format=ppm -page=1 -size 1000x-1 -aspect=yes {} $tmp 2>/dev/null && \ - kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 $tmp - ;; - *) - if file --mime-type {} | grep -qP "image/(?!vnd\.djvu)"; then - kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 {} - else - bat -p {} --color=always 2>/dev/null - fi - ;; - esac -' diff --git a/yazi_1/.config/yazi/plugins/fazif.yazi/fazifrg b/yazi_1/.config/yazi/plugins/fazif.yazi/fazifrg deleted file mode 100755 index 244efeb..0000000 --- a/yazi_1/.config/yazi/plugins/fazif.yazi/fazifrg +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env zsh -rm -f /tmp/rg-fzf-{r,f} 2>/dev/null -RG_PREFIX="rg --with-filename --column --line-number --color=always --smart-case --field-match-separator $'\u00a0'" - -FILES_TO_ADD="" -for item in "$@"; do - if [ -f "$item" ]; then - FILES_TO_ADD="$FILES_TO_ADD$item"$'\n' - fi -done - -(fd . -H -t f "$@" 2>/dev/null & printf "%s" "$FILES_TO_ADD") | fzf \ - --ansi \ - --delimiter $'\u00a0' \ - --disabled \ - --prompt '1. ripgrep> ' \ - --header 'CTRL-Y: Switch between ripgrep/fzf' \ - --bind "change:reload:sleep 0.1; $RG_PREFIX {q} $([ $# -gt 0 ] && printf "%q " "$@") || true" \ ---bind 'ctrl-y:transform:[[ ! $FZF_PROMPT =~ ripgrep ]] && - echo "rebind(change)+change-prompt(1. ripgrep> )+disable-search+transform-query:echo \{q} > /tmp/rg-fzf-f; cat /tmp/rg-fzf-r" || - echo "unbind(change)+change-prompt(2. fzf> )+enable-search+transform-query:echo \{q} > /tmp/rg-fzf-r; cat /tmp/rg-fzf-f"' \ - --color "hl:-1:underline,hl+:-1:underline:reverse" \ - --preview '[ -n "{2}" ] && bat --color=always {1} --style=numbers --highlight-line {2} || bat --color=always {} --style=numbers' \ - --preview-window 'down,60%,+{2}+3/3,~3' \ - --bind 'ctrl-p:change-preview-window(right,60%|hidden|down,60%)' \ - --bind 'focus:transform-preview-label:echo $(basename {1})' \ - --bind 'ctrl-o:execute(kitty -1 sh -c "nvim {1} +{2}" & )' \ - --bind 'ctrl-x:execute-silent(setsid kitty -1 nnn {1} &)' \ - --bind 'ctrl-a:execute-silent(setsid kitty -1 yazi {1} &)' \ - --bind 'ctrl-s:execute-silent(setsid thunar {1} &)' \ - --color 'label:117:bold' - diff --git a/yazi_1/.config/yazi/plugins/fazif.yazi/fazifrga b/yazi_1/.config/yazi/plugins/fazif.yazi/fazifrga deleted file mode 100755 index f583398..0000000 --- a/yazi_1/.config/yazi/plugins/fazif.yazi/fazifrga +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env zsh -rm -f /tmp/rg-fzf-{r,f} 2>/dev/null -RG_PREFIX="rga --glob='*.pdf' --glob='*.djvu' --glob='*.djv' --with-filename --color=always --no-heading --smart-case --field-match-separator $'\u00a0'" - -FILES_TO_ADD="" -for item in "$@"; do - if [ -f "$item" ]; then - FILES_TO_ADD="$FILES_TO_ADD$item"$'\n' - fi -done - -(fd . -e pdf -e djvu -e djv "$@" 2>/dev/null & printf "%s" "$FILES_TO_ADD") | fzf \ - --ansi \ - --delimiter $'\u00a0' \ - --disabled \ - --with-nth 2,1 \ - --prompt="rga> " \ - --color "hl:-1:underline,hl+:-1:underline:reverse" \ - --bind "change:reload:sleep 0.1; $RG_PREFIX {q} $([ $# -gt 0 ] && printf "%q " "$@") || true" \ - --bind 'focus:transform-preview-label:echo $(basename {1})' \ - --bind 'ctrl-p:change-preview-window(right,50%|hidden,50%|down)' \ - --bind 'ctrl-x:execute-silent(setsid kitty -1 nnn {1} &)' \ - --bind 'ctrl-a:execute-silent(setsid kitty -1 yazi {1} &)' \ - --bind 'ctrl-s:execute-silent(setsid thunar {1} &)' \ - --preview-window 'down' \ ---bind 'ctrl-y:transform:[[ ! $FZF_PROMPT =~ rga ]] && - echo "rebind(change)+change-prompt(rga> )+disable-search+transform-query:echo \{q} > /tmp/rg-fzf-f; cat /tmp/rg-fzf-r" || - echo "unbind(change)+change-prompt(fzf> )+enable-search+transform-query:echo \{q} > /tmp/rg-fzf-r; cat /tmp/rg-fzf-f"' \ ---bind 'ctrl-o:execute( - page_info={2} - pagenumber=${page_info#Page } - pagenumber=${pagenumber%%: *} - context=${page_info#*: } - setsid zathura --page=$pagenumber --find=$context {1} &)' \ ---preview ' - printf "\033_Ga=d,q=1\033\\" - [ -n {2} ] && pagenumber=$(echo {2} | cut -d: -f1 | sed "s/Page\ //") || pagenumber=1 - tmp="/tmp/fzf_preview" - case {1} in - *.pdf) - pdftoppm -q -f $pagenumber -l $pagenumber -jpeg -jpegopt quality=60 -scale-to-x 800 -scale-to-y -1 -singlefile {1} $tmp \ - && kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 $tmp.jpg - ;; - *.djvu) - ddjvu -format=ppm -page=$pagenumber -size=800x-1 -aspect=yes {1} $tmp 2>/dev/null \ - && kitty icat --transfer-mode=memory --stdin=no --place=${FZF_PREVIEW_COLUMNS}x${FZF_PREVIEW_LINES}@0x0 $tmp - ;; - esac - ' \ - # --bind "start:reload:$RG_PREFIX {q} || true" \ diff --git a/yazi_1/.config/yazi/plugins/fazif.yazi/main.lua b/yazi_1/.config/yazi/plugins/fazif.yazi/main.lua deleted file mode 100644 index f577f80..0000000 --- a/yazi_1/.config/yazi/plugins/fazif.yazi/main.lua +++ /dev/null @@ -1,107 +0,0 @@ -local state = ya.sync(function() - local selected = {} - for _, url in pairs(cx.active.selected) do - selected[#selected + 1] = url - end - return cx.active.current.cwd, selected -end) - -local function split_urls(cwd, output) - if not output or output == "" then return {} end - - local t = {} - for line in output:gmatch("[^\r\n]+") do - if line ~= "" then - -- Get everything before first colon, or entire line if no colon - local file = line:find("\xC2\xA0") and line:sub(1, line:find("\xC2\xA0") - 1) or line - - if file and file ~= "" then - local u = Url(file) - if u.is_absolute then - t[#t + 1] = u - else - t[#t + 1] = cwd:join(u) - end - end - end - end - return t -end - -local function run_with(cwd, selected, script_name) - local script_path = os.getenv("HOME") .. "/.config/yazi/plugins/fazif.yazi/" .. script_name - - local sepaths = {} - if #selected > 0 then - for _, u in ipairs(selected) do - table.insert(sepaths, tostring(u)) - end - end - - local child - if #selected == 0 then - child = Command(script_path):cwd(tostring(cwd)):stdin(Command.INHERIT):stdout(Command.PIPED):spawn() - else - child = Command(script_path):arg(sepaths):stdout(Command.PIPED):spawn() - end - - if not child then - return nil, "Failed to start script" - end - - local output, err = child:wait_with_output() - if not output then - return nil, "Cannot read output: " .. tostring(err) - elseif not output.status.success and output.status.code ~= 130 then - return nil, "Script exited with code " .. tostring(output.status.code) - end - return output.stdout, nil -end - -local function entry(_, job) - local script_name = job.args[1] - - local permit = ui.hide() - local cwd, selected = state() - - local output, err = run_with(cwd, selected, script_name) - - if permit then - permit:drop() - end - - if not output then - return ya.notify { title = "Fazif", content = tostring(err), timeout = 5, level = "error" } - end - - local urls = split_urls(cwd, output) - if #urls == 0 then - return - elseif #urls == 1 then - ya.emit("tab_create", {}) - ya.emit(fs.cha(urls[1]).is_dir and "cd" or "reveal", { urls[1], raw = true }) - else - ya.emit("tab_create", {}) - local id = ya.id("ft") - local virtual_cwd = cwd:into_search("FZF Results") - ya.emit("cd", { Url(virtual_cwd) }) - ya.emit("update_files", { op = fs.op("part", { id = id, url = Url(virtual_cwd), files = {} }) }) - - local files = {} - for i = 1, #urls do - local url = urls[i] - local cha = fs.cha(url, true) - if cha then - files[#files + 1] = File { url = url, cha = cha } - else - files[#files + 1] = File { url = url } - end - end - - ya.emit("update_files", { op = fs.op("part", { id = id, url = Url(virtual_cwd), files = files }) }) - ya.emit("update_files", { op = fs.op("done", { id = id, url = virtual_cwd, cha = Cha { kind = 16 } }) }) - end -end - -return { entry = entry } - diff --git a/yazi_1/.config/yazi/plugins/fchar.yazi/LICENSE b/yazi_1/.config/yazi/plugins/fchar.yazi/LICENSE deleted file mode 100644 index f288702..0000000 --- a/yazi_1/.config/yazi/plugins/fchar.yazi/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/yazi_1/.config/yazi/plugins/fchar.yazi/README.md b/yazi_1/.config/yazi/plugins/fchar.yazi/README.md deleted file mode 100644 index b687a92..0000000 --- a/yazi_1/.config/yazi/plugins/fchar.yazi/README.md +++ /dev/null @@ -1,97 +0,0 @@ -list of files with highlighted matching characters - -# Features - -- case insensitive matching -- supports aliases for different languages -- ignores leading non-alphabet -- can match characters anywhere in filename - -# Installation - -```sh -ya pkg add AminurAlam/yazi-plugins:fchar -``` - -# Usage - -in `~/.config/yazi/keymap.toml` - -```toml -[mgr] -prepend_keymap = [ - { on = "f", run = "plugin fchar", desc = "Jump to char" }, -] -``` - -in `~/.config/yazi/init.lua` - -```lua --- default config -require('fchar'):setup { - -- if true: f -> file, File, FILE - insensitive = true, - -- if true: f -> file, .file, @file, #file, ...file - skip_symbols = true, - -- if {"yazi-"}: f -> file, yazi-file - skip_prefix = {}, - -- start: f -> file - -- word: f -> file, also-file - -- all: f -> file, also-file, alsofile, elf - search_location = 'start', - aliases = {}, -} - --- aliases for German -require('fchar'):setup { - aliases = { - a = 'Ă€', - o = 'ö', - u = 'ĂŒ', - s = 'ß' - }, -} - --- aliases for Japanese -require('fchar'):setup { - aliases = { - a = 'あケ', - b = 'ばびぶăčăŒăƒăƒ“ăƒ–ăƒ™ăƒœ', - c = 'づチ', - d = 'ă ăąă„ă§ă©ăƒ€ăƒ‚ăƒ…ăƒ‡ăƒ‰', - e = 'えス', - g = 'がぎぐげごガゼグă‚Čギ', - h = 'はăČă”ăžă»ăƒăƒ’ăƒ•ăƒ˜ăƒ›', - i = 'いむ', - j = 'じゾ', - k = 'ă‹ăăă‘ă“ă‚«ă‚­ă‚Żă‚±ă‚ł', - m = 'ăŸăżă‚€ă‚ă‚‚ăƒžăƒŸăƒ ăƒĄăƒą', - n = 'ăȘă«ăŹă­ăźă‚“ăƒŠăƒ‹ăƒŒăƒăƒŽăƒł', - o = 'おă‚Ș', - p = 'ぱぎぷășăœăƒ‘ăƒ”ăƒ—ăƒšăƒ', - r = 'ă‚‰ă‚Šă‚‹ă‚Œă‚ăƒ©ăƒȘルハロ', - s = 'ă•ă—ă™ă›ăă‚”ă‚·ă‚čă‚»ă‚œ', - t = 'ăŸă€ăŠăšă‚żăƒ„ăƒ†ăƒˆ', - u = 'うォ', - w = 'わをワăƒČ', - y = 'ă‚„ă‚†ă‚ˆăƒ€ăƒŠăƒš', - z = 'ă–ăšăœăžă‚¶ă‚șă‚Œă‚Ÿ', - }, -} - --- you may want to turn off the search regex from --- showing up in the header by doing this -function Header:flags() - local cwd = self._current.cwd - local filter = self._current.files.filter - - local t = {} - if cwd.is_search then - t[#t + 1] = string.format('search: %s', cwd.domain) - end - if filter then - t[#t + 1] = string.format('filter: %s', filter) - end - return #t == 0 and '' or ' (' .. table.concat(t, ', ') .. ')' -end -``` diff --git a/yazi_1/.config/yazi/plugins/fchar.yazi/main.lua b/yazi_1/.config/yazi/plugins/fchar.yazi/main.lua deleted file mode 100644 index d7c6cea..0000000 --- a/yazi_1/.config/yazi/plugins/fchar.yazi/main.lua +++ /dev/null @@ -1,159 +0,0 @@ ---- @since 25.5.31 - -local M = {} - -local changed = ya.sync(function(st, new) - local b = st.last ~= new - st.last = new - return b or not cx.active.finder -end) - ----@type fun(opts: FCharConf): nil -local set_config = ya.sync(function(st, opts) - st.opts = opts -end) - ----@type fun(): FCharConf -local get_config = ya.sync(function(st) - return st.opts - or { - -- if true: f -> file, File, FILE - insensitive = true, - -- if true: f -> file, .file, @file, #file, ...file - skip_symbols = true, - -- if {"yazi-"}: f -> file, yazi-file - skip_prefix = {}, - -- start: f -> file - -- word: f -> file, also-file - -- all: f -> file, also-file, twofile, elf - search_location = 'start', - aliases = {}, - } -end) - -local function tbl_deep_extend(default, config) - if type(config) ~= 'table' then - return config - end - - default = (type(default) == 'table') and default or {} - for key, _ in pairs(config) do - default[key] = tbl_deep_extend(default[key], config[key]) - end - - return default -end - ----@type fun(self, config: FCharConf): nil -function M:setup(config) - set_config(tbl_deep_extend(get_config(), config)) -end - --- TODO: process `--flags` -function M:entry() - local cands = { - { on = '0' }, - { on = '1' }, - { on = '2' }, - { on = '3' }, - { on = '4' }, - { on = '5' }, - { on = '6' }, - { on = '7' }, - { on = '8' }, - { on = '9' }, - { on = '_' }, - { on = 'a' }, - { on = 'b' }, - { on = 'c' }, - { on = 'd' }, - { on = 'e' }, - { on = 'f' }, - { on = 'g' }, - { on = 'h' }, - { on = 'i' }, - { on = 'j' }, - { on = 'k' }, - { on = 'l' }, - { on = 'm' }, - { on = 'n' }, - { on = 'o' }, - { on = 'p' }, - { on = 'q' }, - { on = 'r' }, - { on = 's' }, - { on = 't' }, - { on = 'u' }, - { on = 'v' }, - { on = 'w' }, - { on = 'x' }, - { on = 'y' }, - { on = 'z' }, - { on = 'A' }, - { on = 'B' }, - { on = 'C' }, - { on = 'D' }, - { on = 'E' }, - { on = 'F' }, - { on = 'G' }, - { on = 'H' }, - { on = 'I' }, - { on = 'J' }, - { on = 'K' }, - { on = 'L' }, - { on = 'M' }, - { on = 'N' }, - { on = 'O' }, - { on = 'P' }, - { on = 'Q' }, - { on = 'R' }, - { on = 'S' }, - { on = 'T' }, - { on = 'U' }, - { on = 'V' }, - { on = 'W' }, - { on = 'X' }, - { on = 'Y' }, - { on = 'Z' }, - } - local opts = get_config() - - if opts.skip_symbols then - local additional_keys = '~.!@#-' - for i = 1, #additional_keys do - cands[#cands + 1] = { on = additional_keys:sub(i, i) } - end - end - - local idx = ya.which { cands = cands, silent = true } - if not idx then - return - end - - local loc = { - start = '^', - word = '(^|\\W)', - all = '', - } - - -- TODO: autodetect common prefix - local prefixes = '' - for _, prefix in ipairs(opts.skip_prefix) do - prefixes = prefixes .. '(' .. prefix .. ')?' - end - - local re = loc[opts.search_location] - .. ((opts.search_location == 'start' and opts.skip_symbols) and [[\W?]] or '') - .. prefixes - .. '[' - .. cands[idx].on - .. (opts.aliases[cands[idx].on] or '') - .. ']' - if changed(re) then - ya.emit('find_do', { re, insensitive = opts.insensitive }) - else - ya.emit('find_arrow', {}) - end -end - -return M diff --git a/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/LICENSE b/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/LICENSE deleted file mode 100644 index fb10e72..0000000 --- a/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2024 boydaihungst - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/README.md b/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/README.md deleted file mode 100644 index 2420bca..0000000 --- a/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# file-extra-metadata - - - -- [file-extra-metadata](#file-extra-metadata) - - [Preview](#preview) - - [Before:](#before) - - [After:](#after) - - [Requirements](#requirements) - - [Installation](#installation) - - [For developer](#for-developer) - - -This is a Yazi plugin that replaces the default file previewer and spotter with extra information. - -> [!IMPORTANT] -> Minimum version: yazi v25.5.28 - -## Preview - -### Before: - -- Previewer - - ![Before preview](statics/2024-11-17-12-06-24.png) - -- Spotter - - ![Before spot](statics/2025-12-29-before_spotter.png) - -### After: - -- Previewer - - ![After previewer](statics/2024-11-21-05-27-48.png) - -- Spotter - - ![After spotter](statics/2025-12-29-after_spotter.png) - -## Requirements - -- [yazi >= 25.5.28](https://github.com/sxyazi/yazi) -- Tested on Linux. For MacOS, Windows: some fields will shows empty values. - -## Installation - -Install the plugin: - -```sh -ya pkg add boydaihungst/file-extra-metadata -``` - -Create `~/.config/yazi/yazi.toml` and add: -For yazi < v25.12.29 (29/12/2025) replace `url` with `name` - -```toml -[plugin] - append_previewers = [ - { url = "*", run = "file-extra-metadata" }, - ] - - # Setup keybind for spotter: https://github.com/sxyazi/yazi/pull/1802 - append_spotters = [ - { url = "*", run = "file-extra-metadata" }, - ] -``` - -or - -```toml -[plugin] - previewers = [ - # ... the rest - # disable default file plugin { name = "*", run = "file" }, - { url = "*", run = "file-extra-metadata" }, - ] - - # Setup keybind for spotter: https://github.com/sxyazi/yazi/pull/1802 - spotters = [ - # ... the rest - # Fallback - # { name = "*", run = "file" }, - { url = "*", run = "file-extra-metadata" }, - ] -``` - -### Custom theme - -Read more: https://github.com/sxyazi/yazi/pull/2391 - -Edit or add `yazi/theme.toml`: - -```toml -[spot] -border = { fg = "#4fa6ed" } -title = { fg = "#4fa6ed" } - -# Table. -tbl_cell = { fg = "#4fa6ed", reversed = true } -tbl_col = { fg = "#4fa6ed" } -``` - -## For developer - -If you want to combine this with other spotter/previewer: - -```lua -require("file-extra-metadata"):render_table(job, { show_plugins_section = true }) -``` diff --git a/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/main.lua b/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/main.lua deleted file mode 100644 index 9d11fde..0000000 --- a/yazi_1/.config/yazi/plugins/file-extra-metadata.yazi/main.lua +++ /dev/null @@ -1,367 +0,0 @@ ---- @since 25.5.28 - -local M = {} - -local STATE_KEY = { - ALTER_DF_COMMAND = "ALTER_DF_COMMAND", -} - -local set_state = ya.sync(function(state, key, value) - state[key] = value -end) - -local get_state = ya.sync(function(state, key) - return state[key] -end) - -local function permission(file) - local h = file - if not h then - return "" - end - - local perm = h.cha:perm() - if not perm then - return "" - end - - local spans = "" - for i = 1, #perm do - local c = perm:sub(i, i) - spans = spans .. c - end - return spans -end - -local function link_count(file) - local h = file - if h == nil or ya.target_family() ~= "unix" then - return "" - end - - return h.cha.nlink -end - -local function owner_group(file) - local h = file - if h == nil or ya.target_family() ~= "unix" then - return "" - end - return (ya.user_name(h.cha.uid) or tostring(h.cha.uid)) .. "/" .. (ya.group_name(h.cha.gid) or tostring(h.cha.gid)) -end - -local file_size_and_folder_childs = function(file) - local h = file - if not h then - return "" - end - - return h.cha.len and ya.readable_size(h.cha.len) or "" -end - ---- get file timestamp ----@param file any ----@param type "mtime" | "atime" | "btime" ----@return any -local function fileTimestamp(file, type) - local h = file - if not h then - return "" - end - local time = math.floor(h.cha[type] or 0) - if time == 0 then - return "" - else - return os.date("%Y-%m-%d %H:%M", time) - end -end - --- Function to split a string by spaces (considering multiple spaces as one delimiter) -local function split_by_whitespace(input) - local result = {} - for word in string.gmatch(input, "%S+") do - table.insert(result, word) - end - return result -end - -local function get_filesystem_extra(file) - local result = { - filesystem = "", - device = "", - type = "", - used_space = "", - avail_space = "", - total_space = "", - used_space_percent = "", - avail_space_percent = "", - error = nil, - is_virtual = false, - } - local h = file - local file_url = h.url - local is_virtual = file_url.spec and file_url.scheme.is_virtual - file_url = is_virtual and (file.path or Url(file_url.scheme.cache .. tostring(file_url.path))) - or (file_url.path or file_url.url) - if not h or ya.target_family() ~= "unix" then - return result - end - local output, child - - local alter_df_command = get_state(STATE_KEY.ALTER_DF_COMMAND) - if not alter_df_command then - child, _ = Command("df"):arg({ "-P", "-T", "-h", tostring(file_url) }):stdout(Command.PIPED):spawn() - - if child then - -- Ignore header - local _, event = child:read_line() - if event == 0 then - output, _ = child:read_line() - end - child:start_kill() - end - end - - -- Fallback for macOS/BSD if -T failed (empty output or error) - if not output or output == "" then - if not alter_df_command then - set_state(STATE_KEY.ALTER_DF_COMMAND, true) - end - child, _ = Command("df"):arg({ "-P", "-h", tostring(file_url) }):stdout(Command.PIPED):spawn() - if child then - local _, event = child:read_line() -- skip header - if event == 0 then - output, _ = child:read_line() - end - child:start_kill() - end - end - - if output and output ~= "" then - -- Splitting the data - local parts = split_by_whitespace(output) - - -- Display the result - if #parts >= 7 then - result.filesystem = is_virtual and (parts[7] .. " (vfs)") or parts[7] - result.device = is_virtual and (parts[1] .. " (vfs)") or parts[1] - result.total_space = parts[3] - result.used_space = parts[4] - result.avail_space = parts[5] - result.used_space_percent = parts[6] - result.avail_space_percent = 100 - tonumber((string.match(parts[6], "%d+") or "0")) - result.type = is_virtual and (parts[2] .. " (vfs)") or parts[2] - else - result.filesystem = is_virtual and (parts[6] .. " (vfs)") or parts[6] - -- result.device (Type) is missing in df output, fetch from mount - result.total_space = parts[2] - result.used_space = parts[3] - result.avail_space = parts[4] - result.used_space_percent = parts[5] - result.avail_space_percent = 100 - tonumber((string.match(parts[5], "%d+") or "0")) - result.device = is_virtual and (parts[1] .. " (vfs)") or parts[1] - - local mount_child = Command("mount"):stdout(Command.PIPED):spawn() - if mount_child then - while true do - local line, event = mount_child:read_line() - if not line or event ~= 0 then - break - end - -- Check if line starts with filesystem (e.g. /dev/disk1s1 on ...) - local s, e = line:find(parts[1] .. " on ", 1, true) - if s == 1 then - local fstype = line:match("%(([^,]+)") - if fstype then - result.type = is_virtual and (fstype .. " (vfs)") or fstype - end - break - end - end - end - end - result.is_virtual = is_virtual - else - result.error = "df error: check install" - end - return result -end - -local function attributes(file) - local h = file - local file_url = h.url - if h.cha.is_link then - file_url = Url(h.link_to) - end - local is_virtual = file_url.scheme and file_url.scheme.is_virtual - file_url = is_virtual and (file.path or Url(file_url.scheme.cache .. tostring(file_url.path))) or file_url - - if not h or ya.target_family() ~= "unix" then - return "" - end - - local output, _ = Command("lsattr"):arg({ "-d", tostring(file_url) }):stdout(Command.PIPED):output() - - if output then - -- Splitting the data - local parts = split_by_whitespace(output.stdout) - - -- Display the result - for i, part in ipairs(parts) do - if i == 1 then - return part - end - end - return "" - else - return "lsattr error: check install" - end -end - ----shorten string ----@param _s string string ----@param _t string tail ----@param _w number max characters ----@return string -local shorten = function(_s, _t, _w) - local s = _s or utf8.len(_s) - local t = _t or "" - local ellipsis = "
" .. t - local w = _w < utf8.len(ellipsis) and utf8.len(ellipsis) or _w - local n_ellipsis = utf8.len(ellipsis) or 0 - if utf8.len(s) > w then - return s:sub(1, (utf8.offset(s, w - n_ellipsis + 1) or 2) - 1) .. ellipsis - end - return s -end - -function M:render_table(job, opts) - local styles = { - header = th.spot.title or ui.Style():fg("green"), - row_label = ui.Style():fg("reset"), - row_value = th.spot.tbl_col or ui.Style():fg("blue"), - } - local filesystem_extra = get_filesystem_extra(job.file) - local prefix = " " - local rows = {} - local label_max_length = 15 - local file_name_extension = job.file.cha.is_dir and "
" or ("." .. (job.file.url.ext or "")) - - local row = function(key, value) - local h = type(value) == "table" and #value or 1 - rows[#rows + 1] = ui.Row({ ui.Line(key):style(styles.row_label), ui.Text(value):style(styles.row_value) }):height(h) - end - - local file_name = shorten( - job.file.name, - file_name_extension, - math.floor(job.area.w - label_max_length - utf8.len(file_name_extension)) - ) - local location = shorten( - tostring((job.file.url.path or job.file.url).parent), - "", - math.floor(job.area.w - label_max_length - utf8.len(prefix)) - ) - local filesystem_error = filesystem_extra.error - and shorten(filesystem_extra.error, "", math.floor(job.area.w - label_max_length - utf8.len(prefix))) - or nil - local filesystem = - shorten(filesystem_extra.filesystem, "", math.floor(job.area.w - label_max_length - utf8.len(prefix))) - - rows[#rows + 1] = ui.Row({ "Metadata", "" }):style(styles.header) - row(prefix .. "File:", file_name) - row(prefix .. "Mimetype:", job.mime) - row(prefix .. "Location:", location) - if job.file.cache then - row(prefix .. "Cached:", tostring(job.file.path or job.file.cache)) - end - row(prefix .. "Mode:", permission(job.file)) - row(prefix .. "Attributes:", attributes(job.file)) - row(prefix .. "Links:", tostring(link_count(job.file))) - if job.file.cha.is_link then - row(prefix .. "Linked:", tostring(job.file.cha.is_link and job.file.link_to)) - end - row(prefix .. "Owner:", owner_group(job.file)) - row(prefix .. "Size:", file_size_and_folder_childs(job.file)) - row(prefix .. "Created:", fileTimestamp(job.file, "btime")) - row(prefix .. "Modified:", fileTimestamp(job.file, "mtime")) - row(prefix .. "Accessed:", fileTimestamp(job.file, "atime")) - row(prefix .. "Filesystem:", filesystem_error or filesystem) - row(prefix .. "Device:", filesystem_error or filesystem_extra.device) - row(prefix .. "Type:", filesystem_error or filesystem_extra.type) - row( - prefix .. "Free space:", - filesystem_error - or ( - (filesystem_extra.avail_space and filesystem_extra.total_space and filesystem_extra.avail_space_percent) - and (filesystem_extra.avail_space .. " / " .. filesystem_extra.total_space .. " (" .. filesystem_extra.avail_space_percent .. "%)") - or "" - ) - ) - if opts and opts.show_plugins_section then - -- TODO: Remove this after the next release - local is_yazi_nightly, _ = pcall(require, "mime.dir") - local spotter = rt.plugin.spotter(is_yazi_nightly and job.file or job.file.url, job.mime) - local previewer = rt.plugin.previewer(is_yazi_nightly and job.file or job.file.url, job.mime) - local fetchers = rt.plugin.fetchers(job.file, job.mime) - local preloaders = rt.plugin.preloaders(is_yazi_nightly and job.file or job.file.url, job.mime) - - for i, v in ipairs(fetchers) do - fetchers[i] = v.cmd - end - for i, v in ipairs(preloaders) do - preloaders[i] = v.cmd - end - - rows[#rows + 1] = ui.Row({ { "", "Plugins" }, "" }):height(2):style(styles.header) - row(prefix .. "Spotter:", spotter and spotter.cmd or "(none)") - row(prefix .. "Previewer:", previewer and previewer.cmd or "(none)") - row(prefix .. "Fetchers:", #fetchers ~= 0 and fetchers or "(none)") - row(prefix .. "Preloaders:", #preloaders ~= 0 and preloaders or "(none)") - end - - return ui.Table(rows):area(job.area):row(1):col(1):col_style(styles.row_value):widths({ - ui.Constraint.Length(label_max_length), - ui.Constraint.Fill(1), - }) -end - -function M:peek(job) - local start, cache = os.clock(), ya.file_cache(job) - if not cache or not self:preload(job) then - return 1 - end - ya.sleep(math.max(0, rt.preview.image_delay / 1000 + start - os.clock())) - ya.preview_widget(job, { self:render_table(job) }) -end - -function M:seek(job) - local h = cx.active.current.hovered - if h and h.url == job.file.url then - local step = math.floor(job.units * job.area.h / 10) - ya.emit("peek", { - tostring(math.max(0, cx.active.preview.skip + step)), - only_if = tostring(job.file.url), - }) - end -end - -function M:preload(job) - local cache = ya.file_cache(job) - if not cache or fs.cha(cache) then - return true - end - return true -end - -function M:spot(job) - job.area = ui.Pos({ "center", w = 80, h = 25 }) - ya.spot_table( - job, - self - :render_table(job, { show_plugins_section = true }) - :cell_style(th.spot.tbl_cell or ui.Style():fg("blue"):reverse()) - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/full-border.yazi/LICENSE b/yazi_1/.config/yazi/plugins/full-border.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/full-border.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/full-border.yazi/README.md b/yazi_1/.config/yazi/plugins/full-border.yazi/README.md deleted file mode 100644 index 269ca8e..0000000 --- a/yazi_1/.config/yazi/plugins/full-border.yazi/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# full-border.yazi - -Add a full border to Yazi to make it look fancier. - -![full-border](https://github.com/yazi-rs/plugins/assets/17523360/ef81b560-2465-4d36-abf2-5d21dcb7b987) - -## Installation - -```sh -ya pkg add yazi-rs/plugins:full-border -``` - -## Usage - -Add this to your `init.lua` to enable the plugin: - -```lua -require("full-border"):setup() -``` - -Or you can customize the border type: - -```lua -require("full-border"):setup { - -- Available values: ui.Border.PLAIN, ui.Border.ROUNDED - type = ui.Border.ROUNDED, -} -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/full-border.yazi/main.lua b/yazi_1/.config/yazi/plugins/full-border.yazi/main.lua deleted file mode 100644 index a917e1e..0000000 --- a/yazi_1/.config/yazi/plugins/full-border.yazi/main.lua +++ /dev/null @@ -1,43 +0,0 @@ ---- @since 25.2.26 - -local function setup(_, opts) - local type = opts and opts.type or ui.Border.ROUNDED - local old_build = Tab.build - - Tab.build = function(self, ...) - local bar = function(c, x, y) - if x <= 0 or x == self._area.w - 1 or th.mgr.border_symbol ~= "│" then - return ui.Bar(ui.Edge.TOP) - end - - return ui.Bar(ui.Edge.TOP) - :area( - ui.Rect { x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) } - ) - :symbol(c) - end - - local c = self._chunks - self._chunks = { - c[1]:pad(ui.Pad.y(1)), - c[2]:pad(ui.Pad(1, c[3].w > 0 and 0 or 1, 1, c[1].w > 0 and 0 or 1)), - c[3]:pad(ui.Pad.y(1)), - } - - local style = th.mgr.border_style - self._base = ya.list_merge(self._base or {}, { - ui.Border(ui.Edge.ALL):area(self._area):type(type):style(style), - ui.Bar(ui.Edge.RIGHT):area(self._chunks[1]):style(style), - ui.Bar(ui.Edge.LEFT):area(self._chunks[3]):style(style), - - bar("┬", c[1].right - 1, c[1].y), - bar("┮", c[1].right - 1, c[1].bottom - 1), - bar("┬", c[2].right, c[2].y), - bar("┮", c[2].right, c[2].bottom - 1), - }) - - old_build(self, ...) - end -end - -return { setup = setup } diff --git a/yazi_1/.config/yazi/plugins/git.yazi/LICENSE b/yazi_1/.config/yazi/plugins/git.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/git.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/git.yazi/README.md b/yazi_1/.config/yazi/plugins/git.yazi/README.md deleted file mode 100644 index 23b3bbb..0000000 --- a/yazi_1/.config/yazi/plugins/git.yazi/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# git.yazi - -Show the status of Git file changes as linemode in the file list. - -https://github.com/user-attachments/assets/34976be9-a871-4ffe-9d5a-c4cdd0bf4576 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:git -``` - -## Setup - -Add the following to your `~/.config/yazi/init.lua`: - -```lua -require("git"):setup() -``` - -And register it as fetchers in your `~/.config/yazi/yazi.toml`: - -```toml -[[plugin.prepend_fetchers]] -id = "git" -url = "*" -run = "git" - -[[plugin.prepend_fetchers]] -id = "git" -url = "*/" -run = "git" -``` - -## Advanced - -> [!NOTE] -> The following configuration must be put before `require("git"):setup()` - -You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with: - -- `th.git.modified` -- `th.git.added` -- `th.git.untracked` -- `th.git.ignored` -- `th.git.deleted` -- `th.git.updated` - -For example: - -```lua --- ~/.config/yazi/init.lua -th.git = th.git or {} -th.git.modified = ui.Style():fg("blue") -th.git.deleted = ui.Style():fg("red"):bold() -``` - -You can also customize the text of the status sign with: - -- `th.git.modified_sign` -- `th.git.added_sign` -- `th.git.untracked_sign` -- `th.git.ignored_sign` -- `th.git.deleted_sign` -- `th.git.updated_sign` - -For example: - -```lua --- ~/.config/yazi/init.lua -th.git = th.git or {} -th.git.modified_sign = "M" -th.git.deleted_sign = "D" -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/git.yazi/main.lua b/yazi_1/.config/yazi/plugins/git.yazi/main.lua deleted file mode 100644 index cdc1532..0000000 --- a/yazi_1/.config/yazi/plugins/git.yazi/main.lua +++ /dev/null @@ -1,255 +0,0 @@ ---- @since 25.12.29 - -local WINDOWS = ya.target_family() == "windows" - --- The code of supported git status, --- also used to determine which status to show for directories when they contain different statuses --- see `bubble_up` ----@enum CODES -local CODES = { - excluded = 100, -- ignored directory - ignored = 6, -- ignored file - untracked = 5, - modified = 4, - added = 3, - deleted = 2, - updated = 1, - unknown = 0, -} - -local PATTERNS = { - { "!$", CODES.ignored }, - { "?$", CODES.untracked }, - { "[MT]", CODES.modified }, - { "[AC]", CODES.added }, - { "D", CODES.deleted }, - { "U", CODES.updated }, - { "[AD][AD]", CODES.updated }, -} - ----@param line string ----@return CODES, string -local function match(line) - local signs = line:sub(1, 2) - for _, p in ipairs(PATTERNS) do - local path, pattern, code = nil, p[1], p[2] - if signs:find(pattern) then - path = line:sub(4, 4) == '"' and line:sub(5, -2) or line:sub(4) - path = WINDOWS and path:gsub("/", "\\") or path - end - if not path then - elseif path:find("[/\\]$") then - -- Mark the ignored directory as `excluded`, so we can process it further within `propagate_down` - return code == CODES.ignored and CODES.excluded or code, path:sub(1, -2) - else - return code, path - end - ---@diagnostic disable-next-line: missing-return - end -end - ----@param cwd Url ----@return string? -local function root(cwd) - local is_worktree = function(url) - local file, head = io.open(tostring(url)), nil - if file then - head = file:read(8) - file:close() - end - return head == "gitdir: " - end - - repeat - local next = cwd:join(".git") - local cha = fs.cha(next) - if cha and (cha.is_dir or is_worktree(next)) then - return tostring(cwd) - end - cwd = cwd.parent - until not cwd -end - ----@param changed Changes ----@return Changes -local function bubble_up(changed) - local new, empty = {}, Url("") - for path, code in pairs(changed) do - if code ~= CODES.ignored then - local url = Url(path).parent - while url and url ~= empty do - local s = tostring(url) - new[s] = (new[s] or CODES.unknown) > code and new[s] or code - url = url.parent - end - end - end - return new -end - ----@param excluded string[] ----@param cwd Url ----@param repo Url ----@return Changes -local function propagate_down(excluded, cwd, repo) - local new, rel = {}, cwd:strip_prefix(repo) - for _, path in ipairs(excluded) do - if rel:starts_with(path) then - -- If `cwd` is a subdirectory of an excluded directory, also mark it as `excluded` - new[tostring(cwd)] = CODES.excluded - elseif cwd == repo:join(path).parent then - -- If `path` is a direct subdirectory of `cwd`, mark it as `ignored` - new[path] = CODES.ignored - else - -- Skipping, we only care about `cwd` itself and its direct subdirectories for maximum performance - end - end - return new -end - ----@param cwd string ----@param repo string ----@param changed Changes -local add = ya.sync(function(st, cwd, repo, changed) - ---@cast st State - - st.dirs[cwd] = repo - st.repos[repo] = st.repos[repo] or {} - for path, code in pairs(changed) do - if code == CODES.unknown then - st.repos[repo][path] = nil - elseif code == CODES.excluded then - -- Mark the directory with a special value `excluded` so that it can be distinguished during UI rendering - st.dirs[path] = CODES.excluded - else - st.repos[repo][path] = code - end - end - ui.render() -end) - ----@param cwd string -local remove = ya.sync(function(st, cwd) - ---@cast st State - - local repo = st.dirs[cwd] - if not repo then - return - end - - ui.render() - st.dirs[cwd] = nil - if not st.repos[repo] then - return - end - - for _, r in pairs(st.dirs) do - if r == repo then - return - end - end - st.repos[repo] = nil -end) - ----@param st State ----@param opts Options -local function setup(st, opts) - st.dirs = {} - st.repos = {} - - opts = opts or {} - opts.order = opts.order or 1500 - - local t = th.git or {} - local styles = { - [CODES.ignored] = t.ignored and ui.Style(t.ignored) or ui.Style():fg("darkgray"), - [CODES.untracked] = t.untracked and ui.Style(t.untracked) or ui.Style():fg("magenta"), - [CODES.modified] = t.modified and ui.Style(t.modified) or ui.Style():fg("yellow"), - [CODES.added] = t.added and ui.Style(t.added) or ui.Style():fg("green"), - [CODES.deleted] = t.deleted and ui.Style(t.deleted) or ui.Style():fg("red"), - [CODES.updated] = t.updated and ui.Style(t.updated) or ui.Style():fg("yellow"), - } - local signs = { - [CODES.ignored] = t.ignored_sign or " ", - [CODES.untracked] = t.untracked_sign or "? ", - [CODES.modified] = t.modified_sign or " ", - [CODES.added] = t.added_sign or " ", - [CODES.deleted] = t.deleted_sign or " ", - [CODES.updated] = t.updated_sign or " ", - } - - Linemode:children_add(function(self) - if not self._file.in_current then - return "" - end - - local url = self._file.url - local repo = st.dirs[tostring(url.base or url.parent)] - local code - if repo then - code = repo == CODES.excluded and CODES.ignored or st.repos[repo][tostring(url):sub(#repo + 2)] - end - - if not code or signs[code] == "" then - return "" - elseif self._file.is_hovered then - return ui.Line { " ", signs[code] } - else - return ui.Line { " ", ui.Span(signs[code]):style(styles[code]) } - end - end, opts.order) -end - ----@type UnstableFetcher -local function fetch(_, job) - local cwd = job.files[1].url.base or job.files[1].url.parent - local repo = root(cwd) - if not repo then - remove(tostring(cwd)) - return true - end - - local paths = {} - for _, file in ipairs(job.files) do - paths[#paths + 1] = tostring(file.url) - end - - -- stylua: ignore - local output, err = Command("git") - :cwd(tostring(cwd)) - :arg({ "--no-optional-locks", "-c", "core.quotePath=", "status", "--porcelain", "-unormal", "--no-renames", "--ignored=matching" }) - :arg(paths) - :stdout(Command.PIPED) - :output() - if not output then - return true, Err("Cannot spawn `git` command, error: %s", err) - end - - local changed, excluded = {}, {} - for line in output.stdout:gmatch("[^\r\n]+") do - local code, path = match(line) - if code == CODES.excluded then - excluded[#excluded + 1] = path - else - changed[path] = code - end - end - - if job.files[1].cha.is_dir then - ya.dict_merge(changed, bubble_up(changed)) - end - ya.dict_merge(changed, propagate_down(excluded, cwd, Url(repo))) - - -- Reset the status of any files that don't appear in the output of `git status` to `unknown`, - -- so that cleaning up outdated statuses from `st.repos` - for _, path in ipairs(paths) do - local s = path:sub(#repo + 2) - changed[s] = changed[s] or CODES.unknown - end - - add(tostring(cwd), repo, changed) - - return false -end - -return { setup = setup, fetch = fetch } diff --git a/yazi_1/.config/yazi/plugins/git.yazi/types.lua b/yazi_1/.config/yazi/plugins/git.yazi/types.lua deleted file mode 100644 index 9936849..0000000 --- a/yazi_1/.config/yazi/plugins/git.yazi/types.lua +++ /dev/null @@ -1,12 +0,0 @@ ----@class State ----@field dirs table Mapping between a directory and its corresponding repository ----@field repos table Mapping between a repository and the status of each of its files - ----@class Options ----@field order number The order in which the status is displayed ----@field renamed boolean Whether to include renamed files in the status (or treat them as modified) - --- TODO: move this to `types.yazi` once it's get stable ----@alias UnstableFetcher fun(self: unknown, job: { files: File[] }): boolean, Error? - ----@alias Changes table diff --git a/yazi_1/.config/yazi/plugins/lazygit.yazi/LICENSE b/yazi_1/.config/yazi/plugins/lazygit.yazi/LICENSE deleted file mode 100644 index ae1f60d..0000000 --- a/yazi_1/.config/yazi/plugins/lazygit.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Darius - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/lazygit.yazi/README.md b/yazi_1/.config/yazi/plugins/lazygit.yazi/README.md deleted file mode 100644 index daaa2a6..0000000 --- a/yazi_1/.config/yazi/plugins/lazygit.yazi/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# lazygit.yazi -Plugin for [Yazi](https://github.com/sxyazi/yazi) to manage git repos with [lazygit](https://github.com/jesseduffield/lazygit) -## Dependencies -Make sure [lazygit](https://github.com/jesseduffield/lazygit) is installed and in your `PATH`. -## Installation - -### Using `ya pkg` -``` - ya pkg add Lil-Dank/lazygit -``` - -### Manual -**Linux/macOS** -``` -git clone https://github.com/Lil-Dank/lazygit.yazi.git ~/.config/yazi/plugins/lazygit.yazi -``` -**Windows** -``` -git clone https://github.com/Lil-Dank/lazygit.yazi.git %AppData%\yazi\config\plugins\lazygit.yazi -``` -## Configuration -add this to your **keymap.toml** file -```toml -[[mgr.prepend_keymap]] -on = [ "g", "i" ] -run = "plugin lazygit" -desc = "run lazygit" -``` -you can customize the keybinding however you like. Please refer to the [keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap) documentation -## Disclaimer -**THIS PLUGIN IS FOR THE STABLE RELEASE OF YAZI, DON'T PROPOSE ANY CHANGES BASED ON PRE-RELEASES OF YAZI** diff --git a/yazi_1/.config/yazi/plugins/lazygit.yazi/main.lua b/yazi_1/.config/yazi/plugins/lazygit.yazi/main.lua deleted file mode 100644 index 125dab5..0000000 --- a/yazi_1/.config/yazi/plugins/lazygit.yazi/main.lua +++ /dev/null @@ -1,34 +0,0 @@ -return { - entry = function() - local output = Command("git"):arg("status"):stderr(Command.PIPED):output() - if output.stderr ~= "" then - ya.notify({ - title = "lazygit", - content = "Not in a git directory\nError: " .. output.stderr, - level = "warn", - timeout = 5, - }) - else - permit = ui.hide and ui.hide() or ya.hide() - local output, err_code = Command("lazygit"):stdin(Command.INHERIT):stdout(Command.INHERIT):stderr(Command.PIPED):spawn() - if output and not err_code then - output, err_code = output:wait_with_output() - end - if err_code ~= nil then - ya.notify({ - title = "Failed to run lazygit command", - content = "Status: " .. err_code, - level = "error", - timeout = 5, - }) - elseif not output.status.success then - ya.notify({ - title = "lazygit in" .. cwd .. "failed, exit code " .. output.status.code, - content = output.stderr, - level = "error", - timeout = 5, - }) - end - end - end, -} diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/LICENSE b/yazi_1/.config/yazi/plugins/mediainfo.yazi/LICENSE deleted file mode 100644 index 0399f1c..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2024 Lauri Niskanen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/README.md b/yazi_1/.config/yazi/plugins/mediainfo.yazi/README.md deleted file mode 100644 index 7ad6dc9..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# mediainfo.yazi (fork) - - - -- [mediainfo.yazi (fork)](#mediainfoyazi-fork) - - [Preview](#preview) - - [Installation](#installation) - - [Configuration:](#configuration) - - [Custom theme](#custom-theme) - - -This is a Yazi plugin for previewing media files. The preview shows thumbnail -using `ffmpeg` if available and media metadata using `mediainfo`. - -> [!IMPORTANT] -> Minimum version: yazi v25.5.31. - -## Preview - -- Video - - ![video](assets/2025-02-15-09-15-39.png) - -- Audio file with cover - - ![audio_with_cover_picture](assets/2025-02-15-09-14-23.png) - -- Images - - ![image](assets/2025-02-15-16-52-39.png) - -- Subtitle - - ![subrip](assets/2025-02-15-16-51-11.png) - -- SVG+XML file doesn't have useful information, so it only show the image preview. -- There are more file extensions which are supported by mediainfo. Just add file's MIME type to `prepend_previewers`, `prepend_preloaders`. - Use `spotter` to determine File's MIME type. [Default is `` key](https://github.com/sxyazi/yazi/blob/1a6abae974370702c8865459344bf256de58359e/yazi-config/preset/keymap-default.toml#L59) - -## Installation - -- Install mediainfo CLI: - - [https://mediaarea.net/en/MediaInfo/Download](https://mediaarea.net/en/MediaInfo/Download) - - Run this command in terminal to check if it's installed correctly: - - ```bash - mediainfo --version - ``` - - If it output `Not found` then add it to your PATH environment variable. It's better to ask ChatGPT to help you (Prompt: `Add MediaInfo CLI to PATH environment variable in Windows`). - -- Install ImageMagick (for linux, you can use your distro package manager to install): - https://imagemagick.org/script/download.php -- Install this plugin: - - ```bash - ya pkg add boydaihungst/mediainfo - ``` - -## Configuration: - -> [!IMPORTANT] -> -> `mediainfo` use built-in video, image, svg, magick plugins behind the scene to render preview image, song cover. -> So you can remove those 4 plugins from `prepend_preloaders` and `prepend_previewers` sections in `yazi.toml`. - -If you have cache problem, run this cmd, and follow the tips: `yazi --clear-cache` - -Config folder for each OS: https://yazi-rs.github.io/docs/configuration/overview. - -Create `.../yazi/yazi.toml` and add: - -> [!IMPORTANT] -> -> For yazi (>=v25.12.29) replace `name` with `url` - -```toml -[plugin] - prepend_preloaders = [ - # Replace magick, image, video with mediainfo - { mime = "{audio,video,image}/*", run = "mediainfo" }, - { mime = "application/subrip", run = "mediainfo" }, - # Adobe Illustrator, Adobe Photoshop is image/adobe.photoshop, already handled above - { mime = "application/postscript", run = "mediainfo" }, - ] - prepend_previewers = [ - # Replace magick, image, video with mediainfo - { mime = "{audio,video,image}/*", run = "mediainfo"}, - { mime = "application/subrip", run = "mediainfo" }, - # Adobe Illustrator, Adobe Photoshop is image/adobe.photoshop, already handled above - { mime = "application/postscript", run = "mediainfo" }, - ] - # There are more extensions which are supported by mediainfo. - # Just add file's MIME type to `previewers`, `preloaders` above. - # https://mediaarea.net/en/MediaInfo/Support/Formats - -# For a large file like Adobe Illustrator, Adobe Photoshop, etc -# you may need to increase the memory limit if no image is rendered. -# https://yazi-rs.github.io/docs/configuration/yazi#tasks -[tasks] - image_alloc = 1073741824 # = 1024*1024*1024 = 1024MB - -``` - -## Custom theme - -Using the same style with spotter. [Read more](https://github.com/sxyazi/yazi/pull/2391) - -Edit or add `yazi/theme.toml`: - -```toml -[spot] -# Section header style. -# Example: Video, Text, Image,... with green color in preview images above -title = { fg = "green" } - -# Value style. -# Example: `Format: FLAC` with blue color in preview images above -tbl_col = { fg = "blue" } -``` - -## (Optional) Keymaps to hide metadata and to preview images in full screen - -> [!IMPORTANT] -> Use any key you want, but make sure there is no conflicts with [default Keybindings](https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/keymap-default.toml). - -Since Yazi prioritizes the first matching key, `prepend_keymap` takes precedence over defaults. -Or you can use `keymap` to replace all other keys - -```toml -[mgr] - prepend_keymap = [ - { on = "", run = "plugin mediainfo -- toggle-metadata", desc = "Toggle media preview metadata" }, - ] -``` diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/adobe-old.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/adobe-old.lua deleted file mode 100644 index f46ee03..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/adobe-old.lua +++ /dev/null @@ -1,302 +0,0 @@ ---- @since 26.1.22 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -local function image_layer_count(job) - local cache = ya.file_cache({ file = job.file, skip = 0 }) - if not cache then - return 0 - end - local layer_count = utils.get_state("f" .. tostring(cache)) - if layer_count then - return layer_count - end - local output, err = Command("identify") - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - if err or not output then - return 0 - end - layer_count = 0 - for line in output.stdout:gmatch("[^\r\n]+") do - if line:match("%S") then - layer_count = layer_count + 1 - end - end - utils.set_state("f" .. tostring(cache), layer_count) - return layer_count -end - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url = ya.file_cache(job) - - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local no_metadata = job.args.no_metadata - local mediainfo_job_skip = job.skip - ::recalc_mediainfo_job_skip:: - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - if not no_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = ui.Line({ - ui.Span(label .. ": "):style(ui.Style():fg("reset"):bold()), - ui.Span(value):style(th.spot.tbl_col or ui.Style():fg("blue")), - }) - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = ui.Line({ ui.Span(str):style(th.spot.title or ui.Style():fg("green")) }) - end - end - - if line then - local line_height = ui.height - and ui.height(str, { width = max_width, ansi = true, wrap = rt.preview.wrap }) - or (math.max(1, is_wrap and math.ceil(ui.width(line) / max_width) or 1)) - if next_str == nil and line_height == 1 then - EOF_mediainfo = true - end - if (last_line + line_height) > mediainfo_job_skip then - table.insert(lines, line) - end - if (last_line + line_height) >= mediainfo_job_skip + limit then - last_line = mediainfo_job_skip + limit - EOF_mediainfo = false - break - end - last_line = last_line + line_height - end - str = next_str - end - end - mediainfo_height = math.min(limit, last_line) - end - - if not no_metadata then - if EOF_mediainfo and #lines == 0 and mediainfo_job_skip > 0 then - if - image_layer_count(job) - < ( - 1 - + math.floor( - math.max( - 0, - utils.get_state(const.STATE_KEY.units) - and (math.abs(job.skip / utils.get_state(const.STATE_KEY.units))) - or 0 - ) - ) - ) - then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - else - local last_valid_mediainfo_skip = utils.get_state(const.STATE_KEY.last_valid_mediainfo_skip) - mediainfo_job_skip = last_valid_mediainfo_skip - and last_valid_mediainfo_skip[tostring(cache_img_url_no_skip)] - or math.max(0, mediainfo_job_skip - (utils.get_state(const.STATE_KEY.units) or 0)) - - goto recalc_mediainfo_job_skip - end - else - utils.set_state( - const.STATE_KEY.last_valid_mediainfo_skip, - { [tostring(cache_img_url_no_skip)] = mediainfo_job_skip } - ) - end - end - - -- NOTE: Hacky way to prevent image overlap with old metadata area - if utils.get_state(const.STATE_KEY.prev_metadata_area) then - local old_metadata_area = utils.get_state(const.STATE_KEY.prev_metadata_area) - if - old_metadata_area.win_x == job.area.x - and old_metadata_area.win_y == job.area.y - and old_metadata_area.win_w == job.area.w - and old_metadata_area.win_h == job.area.h - then - ya.preview_widget(job, { - ui.Clear(ui.Rect({ - x = old_metadata_area.x, - y = old_metadata_area.y, - w = old_metadata_area.w, - h = old_metadata_area.h, - })), - }) - end - end - utils.force_render() - - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, not no_metadata and { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - - -- NOTE: Preload image - - local cache_img_url = ya.file_cache(job) - local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url) - - -- NOTE: Only generate preview image when cache image is not exist - if not cache_img_url_cha or cache_img_url_cha.len <= 0 then - local cache_img_status, image_preload_err - local layer_index = 0 - local units = utils.get_state(const.STATE_KEY.units) - if units ~= nil then - local max_layer = image_layer_count(job) - layer_index = math.floor(math.max(0, math.abs(job.skip / units))) - if layer_index + 1 > max_layer then - layer_index = math.max(0, max_layer - 1) - end - end - local cache_img_url_tmp = Url(cache_img_url .. ".tmp") - if fs.cha(cache_img_url_tmp) then - fs.remove("file", cache_img_url_tmp) - end - local tmp_file_path, _ = type(fs.unique) == "function" and fs.unique("file", cache_img_url_tmp) - or fs.unique_name(cache_img_url_tmp) - cache_img_status, image_preload_err = require("magick") - .with_limit() - :arg({ - "-background", - "none", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) .. "[" .. tostring( - layer_index - ) .. "]", - "-auto-orient", - "-strip", - "-resize", - string.format("%dx%d>", rt.preview.max_width, rt.preview.max_height), - "-quality", - rt.preview.image_quality, - string.format("PNG32:%s", tostring(tmp_file_path)), - }) - :status() - if cache_img_status then - os.rename(tostring(tmp_file_path), tostring(cache_img_url)) - end - - if not cache_img_status and image_preload_err then - ya.dbg("mediainfo", image_preload_err) - err_msg = err_msg .. (image_preload_err and (tostring(image_preload_err)) or "") - end - end - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/adobe-stable.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/adobe-stable.lua deleted file mode 100644 index 30a23d6..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/adobe-stable.lua +++ /dev/null @@ -1,338 +0,0 @@ ---- @since 26.5.6 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -local function image_layer_count(job) - local cache = ya.file_cache({ file = job.file, skip = 0 }) - if not cache then - return 0 - end - local layer_count = utils.get_state("f" .. tostring(cache)) - if layer_count then - return layer_count - end - local output, err = Command("identify") - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - if err or not output then - return 0 - end - layer_count = 0 - for line in output.stdout:gmatch("[^\r\n]+") do - if line:match("%S") then - layer_count = layer_count + 1 - end - end - utils.set_state("f" .. tostring(cache), layer_count) - return layer_count -end - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url = ya.file_cache(job) - - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local no_metadata = job.args.no_metadata - local mediainfo_job_skip = job.skip - ::recalc_mediainfo_job_skip:: - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - if not no_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - local opt = { ansi = true, tab_size = rt.preview.tab_size, wrap = rt.preview.wrap, width = max_width } - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = label .. ": " .. value - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = str - end - end - - if line then - local wrapped = ui.lines(line, opt) - local line_height = #wrapped - local from = 1 - local to = math.min(line_height, mediainfo_job_skip + limit - last_line) - - local total_rendered_text_len = 1 - local total_label_rendered_len = 1 - local label_total_len = label and utf8.len(label .. ": ") or 0 - for j = from, to do - local current_line_components = {} - local wrapped_line_len = wrapped[j]:width() or 0 - local wrapped_raw = - utils.utf8_sub(line, total_rendered_text_len, total_rendered_text_len + wrapped_line_len) - wrapped_line_len = utf8.len(wrapped_raw) - total_rendered_text_len = total_rendered_text_len + wrapped_line_len - - if last_line + 1 > mediainfo_job_skip then - local label_raw = label_total_len - total_label_rendered_len <= 0 and "" - or utils.utf8_sub(wrapped_raw, 1, label_total_len - total_label_rendered_len) - local label_raw_len = utf8.len(label_raw) - if label_raw_len > 0 then - table.insert( - current_line_components, - ui.Span(label_raw):style(ui.Style():fg("reset"):bold()) - ) - total_label_rendered_len = total_label_rendered_len + label_raw_len - wrapped_raw = wrapped_raw:gsub("^" .. utils.is_literal_string(label_raw), "", 1) - end - if total_label_rendered_len >= label_total_len then - local value_raw = wrapped_raw - table.insert( - current_line_components, - ui.Span(value_raw or ""):style( - label and (th.spot.tbl_col or ui.Style():fg("blue")) - or (th.spot.title or ui.Style():fg("green")) - ) - ) - end - table.insert(lines, ui.Line(current_line_components)) - -- last_line = last_line + 1 - else - total_label_rendered_len = total_label_rendered_len + total_rendered_text_len - end - last_line = last_line + 1 - if next_str == nil and not wrapped[j + 1] then - EOF_mediainfo = true - end - if last_line >= mediainfo_job_skip + limit then - last_line = mediainfo_job_skip + limit - EOF_mediainfo = false - break - end - end - end - str = next_str - end - end - mediainfo_height = math.min(limit, last_line) - end - - if not no_metadata then - if EOF_mediainfo and #lines == 0 and mediainfo_job_skip > 0 then - if - image_layer_count(job) - < ( - 1 - + math.floor( - math.max( - 0, - utils.get_state(const.STATE_KEY.units) - and (math.abs(job.skip / utils.get_state(const.STATE_KEY.units))) - or 0 - ) - ) - ) - then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - else - local last_valid_mediainfo_skip = utils.get_state(const.STATE_KEY.last_valid_mediainfo_skip) - mediainfo_job_skip = last_valid_mediainfo_skip - and last_valid_mediainfo_skip[tostring(cache_img_url_no_skip)] - or math.max(0, mediainfo_job_skip - (utils.get_state(const.STATE_KEY.units) or 0)) - - goto recalc_mediainfo_job_skip - end - else - utils.set_state( - const.STATE_KEY.last_valid_mediainfo_skip, - { [tostring(cache_img_url_no_skip)] = mediainfo_job_skip } - ) - end - end - - -- NOTE: Hacky way to prevent image overlap with old metadata area - if utils.get_state(const.STATE_KEY.prev_metadata_area) then - local old_metadata_area = utils.get_state(const.STATE_KEY.prev_metadata_area) - if - old_metadata_area.win_x == job.area.x - and old_metadata_area.win_y == job.area.y - and old_metadata_area.win_w == job.area.w - and old_metadata_area.win_h == job.area.h - then - ya.preview_widget(job, { - ui.Clear(ui.Rect({ - x = old_metadata_area.x, - y = old_metadata_area.y, - w = old_metadata_area.w, - h = old_metadata_area.h, - })), - }) - end - end - utils.force_render() - - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, not no_metadata and { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - - -- NOTE: Preload image - - local cache_img_url = ya.file_cache(job) - local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url) - - -- NOTE: Only generate preview image when cache image is not exist - if not cache_img_url_cha or cache_img_url_cha.len <= 0 then - local cache_img_status, image_preload_err - local layer_index = 0 - local units = utils.get_state(const.STATE_KEY.units) - if units ~= nil then - local max_layer = image_layer_count(job) - layer_index = math.floor(math.max(0, math.abs(job.skip / units))) - if layer_index + 1 > max_layer then - layer_index = math.max(0, max_layer - 1) - end - end - local cache_img_url_tmp = Url(cache_img_url .. ".tmp") - if fs.cha(cache_img_url_tmp) then - fs.remove("file", cache_img_url_tmp) - end - local tmp_file_path, _ = type(fs.unique) == "function" and fs.unique("file", cache_img_url_tmp) - or fs.unique_name(cache_img_url_tmp) - cache_img_status, image_preload_err = require("magick") - .with_limit() - :arg({ - "-background", - "none", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) .. "[" .. tostring( - layer_index - ) .. "]", - "-auto-orient", - "-strip", - "-resize", - string.format("%dx%d>", rt.preview.max_width, rt.preview.max_height), - "-quality", - rt.preview.image_quality, - string.format("PNG32:%s", tostring(tmp_file_path)), - }) - :status() - if cache_img_status then - os.rename(tostring(tmp_file_path), tostring(cache_img_url)) - end - - if not cache_img_status and image_preload_err then - ya.dbg("mediainfo", image_preload_err) - err_msg = err_msg .. (image_preload_err and (tostring(image_preload_err)) or "") - end - end - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-09-14-23.png b/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-09-14-23.png deleted file mode 100644 index 2b758d2..0000000 Binary files a/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-09-14-23.png and /dev/null differ diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-09-15-39.png b/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-09-15-39.png deleted file mode 100644 index b24ade5..0000000 Binary files a/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-09-15-39.png and /dev/null differ diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-16-51-11.png b/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-16-51-11.png deleted file mode 100644 index bb3279a..0000000 Binary files a/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-16-51-11.png and /dev/null differ diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-16-52-39.png b/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-16-52-39.png deleted file mode 100644 index 9e23c41..0000000 Binary files a/yazi_1/.config/yazi/plugins/mediainfo.yazi/assets/2025-02-15-16-52-39.png and /dev/null differ diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/audio-old.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/audio-old.lua deleted file mode 100644 index 8352c59..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/audio-old.lua +++ /dev/null @@ -1,345 +0,0 @@ ---- @since 26.1.22 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -local function get_cover_layers(job) - local cache = ya.file_cache({ file = job.file, skip = 0 }) - if not cache then - return {} - end - local covers = utils.get_state("f" .. tostring(cache)) - if covers and type(covers) == "table" then - return covers - end - local output, err = Command("ffprobe"):arg({ - "-v", - "error", - "-select_streams", - "v", - "-show_entries", - "stream=index:stream_disposition=attached_pic", - "-of", - "json", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url), - }):output() - if err or not output then - return {} - end - covers = {} - local data = ya.json_decode(output.stdout) - if type(data.streams) == "table" then - for _, stream in ipairs(data.streams) do - if stream.disposition and stream.disposition.attached_pic then - covers[#covers + 1] = stream.index - end - end - end - utils.set_state("f" .. tostring(cache), covers) - return covers -end - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url = ya.file_cache(job) - - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local no_metadata = job.args.no_metadata - local mediainfo_job_skip = job.skip - ::recalc_mediainfo_job_skip:: - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - if not no_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = ui.Line({ - ui.Span(label .. ": "):style(ui.Style():fg("reset"):bold()), - ui.Span(value):style(th.spot.tbl_col or ui.Style():fg("blue")), - }) - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = ui.Line({ ui.Span(str):style(th.spot.title or ui.Style():fg("green")) }) - end - end - - if line then - local line_height = ui.height - and ui.height(str, { width = max_width, ansi = true, wrap = rt.preview.wrap }) - or (math.max(1, is_wrap and math.ceil(ui.width(line) / max_width) or 1)) - if next_str == nil and line_height == 1 then - EOF_mediainfo = true - end - if (last_line + line_height) > mediainfo_job_skip then - table.insert(lines, line) - end - if (last_line + line_height) >= mediainfo_job_skip + limit then - last_line = mediainfo_job_skip + limit - EOF_mediainfo = false - break - end - last_line = last_line + line_height - end - str = next_str - end - end - mediainfo_height = math.min(limit, last_line) - end - - if not no_metadata then - if EOF_mediainfo and #lines == 0 and mediainfo_job_skip > 0 then - local covers = get_cover_layers(job) - local cover_index = math.floor( - math.max( - 1, - utils.get_state(const.STATE_KEY.units) - and (math.abs(job.skip / utils.get_state(const.STATE_KEY.units))) - or 0 - ) - ) - - if not covers[cover_index] then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - else - -- NOTE: Recalculate mediainfo using cached latest valid skip value when reach the end of mediainfo output - local last_valid_mediainfo_skip = utils.get_state(const.STATE_KEY.last_valid_mediainfo_skip) - mediainfo_job_skip = last_valid_mediainfo_skip - and last_valid_mediainfo_skip[tostring(cache_img_url_no_skip)] - or math.max(0, mediainfo_job_skip - (utils.get_state(const.STATE_KEY.units) or 0)) - - goto recalc_mediainfo_job_skip - end - else - utils.set_state( - const.STATE_KEY.last_valid_mediainfo_skip, - { [tostring(cache_img_url_no_skip)] = mediainfo_job_skip } - ) - end - end - - -- NOTE: Hacky way to prevent image overlap with old metadata area - if utils.get_state(const.STATE_KEY.prev_metadata_area) then - local old_metadata_area = utils.get_state(const.STATE_KEY.prev_metadata_area) - if - old_metadata_area.win_x == job.area.x - and old_metadata_area.win_y == job.area.y - and old_metadata_area.win_w == job.area.w - and old_metadata_area.win_h == job.area.h - then - ya.preview_widget(job, { - ui.Clear(ui.Rect({ - x = old_metadata_area.x, - y = old_metadata_area.y, - w = old_metadata_area.w, - h = old_metadata_area.h, - })), - }) - end - end - utils.force_render() - - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, not no_metadata and { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - - -- NOTE: Preload image - - local cache_img_url = ya.file_cache(job) - local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url) - - -- NOTE: Only generate preview image when cache image is not exist - if cache_img_url and (not cache_img_url_cha or cache_img_url_cha.len <= 0) then - local units = utils.get_state(const.STATE_KEY.units) - local covers = get_cover_layers(job) - local cover_index = covers[1] or 0 - if units ~= nil then - cover_index = math.floor(math.max(1, math.abs(job.skip / units))) - if not covers[cover_index] then - cover_index = math.max(0, #covers - 1) - end - end - local qv = 31 - math.floor(rt.preview.image_quality * 0.3) - local audio_preload_output, audio_preload_err = Command("ffmpeg"):arg({ - "-v", - "error", - "-threads", - 1, - "-i", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url), - "-map", - string.format("0:v:%d?", cover_index), - "-an", - "-sn", - "-dn", - "-vframes", - 1, - "-q:v", - qv, - "-vf", - string.format("scale=-1:'min(%d,ih)':flags=fast_bilinear", rt.preview.max_height / 2), - "-f", - "image2", - "-y", - tostring(cache_img_url), - }):output() - -- NOTE: Some audio types doesn't have cover image -> error "" - if audio_preload_err then - ya.dbg("mediainfo", audio_preload_err) - err_msg = err_msg - .. string.format( - "Failed to start `%s`.\n Error: %s\n", - "ffmpeg", - tostring(audio_preload_err or (audio_preload_output and audio_preload_output.stderr or "")) - ) - elseif - audio_preload_output - and type(audio_preload_output.stderr) == "string" - and audio_preload_output.stderr:find("does not contain any stream") - then - ya.dbg("mediainfo", audio_preload_output and audio_preload_output.stderr) - cache_img_url_cha, _ = fs.cha(cache_img_url) - if cache_img_url_cha then - fs.remove("file", Url(cache_img_url)) - end - -- NOTE: Workaround case audio has no cover image. Prevent regenerate preview image - audio_preload_output, audio_preload_err = require("magick") - .with_limit() - :arg({ - "-size", - "1x1", - "canvas:none", - string.format("PNG32:%s", cache_img_url), - }) - :output() - if - (audio_preload_output and audio_preload_output.stderr ~= nil and audio_preload_output.stderr ~= "") - or audio_preload_err - then - ya.dbg("mediainfo", audio_preload_err or (audio_preload_output and audio_preload_output.stderr)) - err_msg = err_msg - .. string.format( - "Failed to start `%s`.\n Error: %s\n", - "magick", - tostring(audio_preload_err or (audio_preload_output and audio_preload_output.stderr or "")) - ) - end - end - end - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/audio-stable.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/audio-stable.lua deleted file mode 100644 index a6bf677..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/audio-stable.lua +++ /dev/null @@ -1,381 +0,0 @@ ---- @since 26.5.6 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -local function get_cover_layers(job) - local cache = ya.file_cache({ file = job.file, skip = 0 }) - if not cache then - return {} - end - local covers = utils.get_state("f" .. tostring(cache)) - if covers and type(covers) == "table" then - return covers - end - local output, err = Command("ffprobe"):arg({ - "-v", - "error", - "-select_streams", - "v", - "-show_entries", - "stream=index:stream_disposition=attached_pic", - "-of", - "json", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url), - }):output() - if err or not output then - return {} - end - covers = {} - local data = ya.json_decode(output.stdout) - if type(data.streams) == "table" then - for _, stream in ipairs(data.streams) do - if stream.disposition and stream.disposition.attached_pic then - covers[#covers + 1] = stream.index - end - end - end - utils.set_state("f" .. tostring(cache), covers) - return covers -end - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url = ya.file_cache(job) - - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local no_metadata = job.args.no_metadata - local mediainfo_job_skip = job.skip - ::recalc_mediainfo_job_skip:: - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - if not no_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - local opt = { ansi = true, tab_size = rt.preview.tab_size, wrap = rt.preview.wrap, width = max_width } - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = label .. ": " .. value - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = str - end - end - - if line then - local wrapped = ui.lines(line, opt) - local line_height = #wrapped - local from = 1 - local to = math.min(line_height, mediainfo_job_skip + limit - last_line) - - local total_rendered_text_len = 1 - local total_label_rendered_len = 1 - local label_total_len = label and utf8.len(label .. ": ") or 0 - for j = from, to do - local current_line_components = {} - local wrapped_line_len = wrapped[j]:width() or 0 - local wrapped_raw = - utils.utf8_sub(line, total_rendered_text_len, total_rendered_text_len + wrapped_line_len) - wrapped_line_len = utf8.len(wrapped_raw) - total_rendered_text_len = total_rendered_text_len + wrapped_line_len - - if last_line + 1 > mediainfo_job_skip then - local label_raw = label_total_len - total_label_rendered_len <= 0 and "" - or utils.utf8_sub(wrapped_raw, 1, label_total_len - total_label_rendered_len) - local label_raw_len = utf8.len(label_raw) - if label_raw_len > 0 then - table.insert( - current_line_components, - ui.Span(label_raw):style(ui.Style():fg("reset"):bold()) - ) - total_label_rendered_len = total_label_rendered_len + label_raw_len - wrapped_raw = wrapped_raw:gsub("^" .. utils.is_literal_string(label_raw), "", 1) - end - if total_label_rendered_len >= label_total_len then - local value_raw = wrapped_raw - table.insert( - current_line_components, - ui.Span(value_raw or ""):style( - label and (th.spot.tbl_col or ui.Style():fg("blue")) - or (th.spot.title or ui.Style():fg("green")) - ) - ) - end - table.insert(lines, ui.Line(current_line_components)) - -- last_line = last_line + 1 - else - total_label_rendered_len = total_label_rendered_len + total_rendered_text_len - end - last_line = last_line + 1 - if next_str == nil and not wrapped[j + 1] then - EOF_mediainfo = true - end - if last_line >= mediainfo_job_skip + limit then - last_line = mediainfo_job_skip + limit - EOF_mediainfo = false - break - end - end - end - str = next_str - end - end - mediainfo_height = math.min(limit, last_line) - end - - if not no_metadata then - if EOF_mediainfo and #lines == 0 and mediainfo_job_skip > 0 then - local covers = get_cover_layers(job) - local cover_index = math.floor( - math.max( - 1, - utils.get_state(const.STATE_KEY.units) - and (math.abs(job.skip / utils.get_state(const.STATE_KEY.units))) - or 0 - ) - ) - - if not covers[cover_index] then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - else - -- NOTE: Recalculate mediainfo using cached latest valid skip value when reach the end of mediainfo output - local last_valid_mediainfo_skip = utils.get_state(const.STATE_KEY.last_valid_mediainfo_skip) - mediainfo_job_skip = last_valid_mediainfo_skip - and last_valid_mediainfo_skip[tostring(cache_img_url_no_skip)] - or math.max(0, mediainfo_job_skip - (utils.get_state(const.STATE_KEY.units) or 0)) - - goto recalc_mediainfo_job_skip - end - else - utils.set_state( - const.STATE_KEY.last_valid_mediainfo_skip, - { [tostring(cache_img_url_no_skip)] = mediainfo_job_skip } - ) - end - end - - -- NOTE: Hacky way to prevent image overlap with old metadata area - if utils.get_state(const.STATE_KEY.prev_metadata_area) then - local old_metadata_area = utils.get_state(const.STATE_KEY.prev_metadata_area) - if - old_metadata_area.win_x == job.area.x - and old_metadata_area.win_y == job.area.y - and old_metadata_area.win_w == job.area.w - and old_metadata_area.win_h == job.area.h - then - ya.preview_widget(job, { - ui.Clear(ui.Rect({ - x = old_metadata_area.x, - y = old_metadata_area.y, - w = old_metadata_area.w, - h = old_metadata_area.h, - })), - }) - end - end - utils.force_render() - - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, not no_metadata and { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - - -- NOTE: Preload image - - local cache_img_url = ya.file_cache(job) - local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url) - - -- NOTE: Only generate preview image when cache image is not exist - if cache_img_url and (not cache_img_url_cha or cache_img_url_cha.len <= 0) then - local units = utils.get_state(const.STATE_KEY.units) - local covers = get_cover_layers(job) - local cover_index = covers[1] or 0 - if units ~= nil then - cover_index = math.floor(math.max(1, math.abs(job.skip / units))) - if not covers[cover_index] then - cover_index = math.max(0, #covers - 1) - end - end - local qv = 31 - math.floor(rt.preview.image_quality * 0.3) - local audio_preload_output, audio_preload_err = Command("ffmpeg"):arg({ - "-v", - "error", - "-threads", - 1, - "-i", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url), - "-map", - string.format("0:v:%d?", cover_index), - "-an", - "-sn", - "-dn", - "-vframes", - 1, - "-q:v", - qv, - "-vf", - string.format("scale=-1:'min(%d,ih)':flags=fast_bilinear", rt.preview.max_height / 2), - "-f", - "image2", - "-y", - tostring(cache_img_url), - }):output() - -- NOTE: Some audio types doesn't have cover image -> error "" - if audio_preload_err then - ya.dbg("mediainfo", audio_preload_err) - err_msg = err_msg - .. string.format( - "Failed to start `%s`.\n Error: %s\n", - "ffmpeg", - tostring(audio_preload_err or (audio_preload_output and audio_preload_output.stderr or "")) - ) - elseif - audio_preload_output - and type(audio_preload_output.stderr) == "string" - and audio_preload_output.stderr:find("does not contain any stream") - then - ya.dbg("mediainfo", audio_preload_output and audio_preload_output.stderr) - cache_img_url_cha, _ = fs.cha(cache_img_url) - if cache_img_url_cha then - fs.remove("file", Url(cache_img_url)) - end - -- NOTE: Workaround case audio has no cover image. Prevent regenerate preview image - audio_preload_output, audio_preload_err = require("magick") - .with_limit() - :arg({ - "-size", - "1x1", - "canvas:none", - string.format("PNG32:%s", cache_img_url), - }) - :output() - if - (audio_preload_output and audio_preload_output.stderr ~= nil and audio_preload_output.stderr ~= "") - or audio_preload_err - then - ya.dbg("mediainfo", audio_preload_err or (audio_preload_output and audio_preload_output.stderr)) - err_msg = err_msg - .. string.format( - "Failed to start `%s`.\n Error: %s\n", - "magick", - tostring(audio_preload_err or (audio_preload_output and audio_preload_output.stderr or "")) - ) - end - end - end - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/const.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/const.lua deleted file mode 100644 index cef5c01..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/const.lua +++ /dev/null @@ -1,68 +0,0 @@ ---- @since 26.1.22 - -local M = {} - -M.skip_labels = { - ["Complete name"] = true, - ["CompleteName_Last"] = true, - ["Unique ID"] = true, - ["File size"] = true, - ["Format/Info"] = true, - ["Codec ID/Info"] = true, - ["MD5 of the unencoded content"] = true, -} - -M.ENTRY_ACTION = { - toggle_metadata = "toggle-metadata", - toggle_preview = "toggle-preview", - hide_metadata = "hide-metadata", - hide_preview = "hide-preview", - show_metadata = "show-metadata", - show_preview = "show-preview", - reset = "reset", -} - -M.STATE_KEY = { - skip_labels = "skip_labels", - skip_section_labels = "skip_section_labels", - units = "units", - no_metadata = "no_metadata", - no_preview = "no_preview", - prev_metadata_area = "prev_metadata_area", - prev_image_height = "prev_image_height", - last_valid_mediainfo_skip = "last_valid_mediainfo_skip", - cached_mediainfo = "cached_mediainfo", - cached_job_args = "cached_job_args", -} - -M.magick_image_mimes = { - avif = true, - hei = true, - heic = true, - heif = true, - ["heif-sequence"] = true, - ["heic-sequence"] = true, - jxl = true, - tiff = true, - xml = true, - -- ["svg+xml"] = true, - ["canon-cr2"] = true, -} - -M.seekable_mimes = { - -- NOTE: Adobe illustrator photoshop mimetypes - ["application/postscript"] = true, - ["application/dvb.ait"] = true, - ["application/illustrator"] = true, - ["application/vnd.adobe.illustrator"] = true, - ["image/x-eps"] = true, - ["application/eps"] = true, - ["application/pdf"] = true, - - ["image/adobe.photoshop"] = true, -} - -M.suffix = "_mediainfo" -M.SHELL = os.getenv("SHELL") or "" - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/image-old.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/image-old.lua deleted file mode 100644 index bd644d1..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/image-old.lua +++ /dev/null @@ -1,253 +0,0 @@ ---- @since 26.1.22 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url = ya.file_cache({ - skip = 0, - args = job.args, - file = job.file, - area = job.area, - }) - - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local no_metadata = job.args.no_metadata - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - if not no_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = ui.Line({ - ui.Span(label .. ": "):style(ui.Style():fg("reset"):bold()), - ui.Span(value):style(th.spot.tbl_col or ui.Style():fg("blue")), - }) - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = ui.Line({ ui.Span(str):style(th.spot.title or ui.Style():fg("green")) }) - end - end - - if line then - local line_height = ui.height - and ui.height(str, { width = max_width, ansi = true, wrap = rt.preview.wrap }) - or (math.max(1, is_wrap and math.ceil(ui.width(line) / max_width) or 1)) - if next_str == nil and line_height == 1 then - EOF_mediainfo = true - end - if (last_line + line_height) > job.skip then - table.insert(lines, line) - end - if (last_line + line_height) >= job.skip + limit then - last_line = job.skip + limit - EOF_mediainfo = false - break - end - last_line = last_line + line_height - end - str = next_str - end - end - mediainfo_height = math.min(limit, last_line) - end - - if not no_metadata and EOF_mediainfo and #lines == 0 and job.skip > 0 then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - end - - utils.force_render() - -- NOTE: Hacky way to prevent image overlap with old metadata area - if utils.get_state(const.STATE_KEY.prev_metadata_area) then - local old_metadata_area = utils.get_state(const.STATE_KEY.prev_metadata_area) - if - old_metadata_area.win_x == job.area.x - and old_metadata_area.win_y == job.area.y - and old_metadata_area.win_w == job.area.w - and old_metadata_area.win_h == job.area.h - then - ya.preview_widget(job, { - ui.Clear(ui.Rect({ - x = old_metadata_area.x, - y = old_metadata_area.y, - w = old_metadata_area.w, - h = old_metadata_area.h, - })), - }) - end - end - - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, not no_metadata and { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - - -- NOTE: Preload image - - local mime = job.mime:match(".*/(.*)$") - local is_svg = mime == "svg+xml" - local is_magick = const.magick_image_mimes[mime] - local no_skip_job = { skip = 0, file = job.file, args = job.args, area = job.area } - local cache_img_url = ya.file_cache(no_skip_job) - local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url) - - -- NOTE: Only generate preview image when cache image is not exist - if not cache_img_url_cha or cache_img_url_cha.len <= 0 then - local cache_img_status, image_preload_err - if not is_valid_utf8_path then - -- NOTE: Case not valid utf8 path, use trick to generate preview image - if is_svg then - local cache_img_url_tmp = Url(cache_img_url .. ".tmp") - if fs.cha(cache_img_url_tmp) then - fs.remove("file", cache_img_url_tmp) - end - local tmp_file_path, _ = type(fs.unique) == "function" and fs.unique("file", cache_img_url_tmp) - or fs.unique_name(cache_img_url_tmp) - -- svg under invalid utf8 path - cache_img_status, image_preload_err = require("magick") - .with_limit() - :arg({ - "-background", - "none", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url), - "-auto-orient", - "-strip", - string.format("%dx%d>", rt.preview.max_width, rt.preview.max_height), - "-quality", - rt.preview.image_quality, - string.format("PNG32:%s", tostring(tmp_file_path)), - }) - :status() - if cache_img_status then - os.rename(tostring(tmp_file_path), tostring(cache_img_url)) - end - end - else - -- NOTE: Case valid utf8 path, use image, svg, or magick module - local image_module = is_svg and "svg" or (is_magick and "magick" or "image") - cache_img_status, image_preload_err = require(image_module):preload(no_skip_job) - end - - if not cache_img_status and image_preload_err then - ya.dbg("mediainfo", image_preload_err) - err_msg = err_msg .. (image_preload_err and (tostring(image_preload_err)) or "") - end - end - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/image-stable.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/image-stable.lua deleted file mode 100644 index 13f9227..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/image-stable.lua +++ /dev/null @@ -1,290 +0,0 @@ ---- @since 26.5.6 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url = ya.file_cache({ - skip = 0, - args = job.args, - file = job.file, - area = job.area, - }) - - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local no_metadata = job.args.no_metadata - local mediainfo_job_skip = job.skip - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - if not no_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - local opt = { ansi = true, tab_size = rt.preview.tab_size, wrap = rt.preview.wrap, width = max_width } - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = label .. ": " .. value - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = str - end - end - - if line then - local wrapped = ui.lines(line, opt) - local line_height = #wrapped - local from = 1 - local to = math.min(line_height, mediainfo_job_skip + limit - last_line) - - local total_rendered_text_len = 1 - local total_label_rendered_len = 1 - local label_total_len = label and utf8.len(label .. ": ") or 0 - for j = from, to do - local current_line_components = {} - local wrapped_line_len = wrapped[j]:width() or 0 - local wrapped_raw = - utils.utf8_sub(line, total_rendered_text_len, total_rendered_text_len + wrapped_line_len) - wrapped_line_len = utf8.len(wrapped_raw) - total_rendered_text_len = total_rendered_text_len + wrapped_line_len - - if last_line + 1 > mediainfo_job_skip then - local label_raw = label_total_len - total_label_rendered_len <= 0 and "" - or utils.utf8_sub(wrapped_raw, 1, label_total_len - total_label_rendered_len) - local label_raw_len = utf8.len(label_raw) - if label_raw_len > 0 then - table.insert( - current_line_components, - ui.Span(label_raw):style(ui.Style():fg("reset"):bold()) - ) - total_label_rendered_len = total_label_rendered_len + label_raw_len - wrapped_raw = wrapped_raw:gsub("^" .. utils.is_literal_string(label_raw), "", 1) - end - if total_label_rendered_len >= label_total_len then - local value_raw = wrapped_raw - table.insert( - current_line_components, - ui.Span(value_raw or ""):style( - label and (th.spot.tbl_col or ui.Style():fg("blue")) - or (th.spot.title or ui.Style():fg("green")) - ) - ) - end - table.insert(lines, ui.Line(current_line_components)) - -- last_line = last_line + 1 - else - total_label_rendered_len = total_label_rendered_len + total_rendered_text_len - end - last_line = last_line + 1 - if next_str == nil and not wrapped[j + 1] then - EOF_mediainfo = true - end - if last_line >= mediainfo_job_skip + limit then - last_line = mediainfo_job_skip + limit - EOF_mediainfo = false - break - end - end - end - str = next_str - end - end - mediainfo_height = math.min(limit, last_line) - end - - if not no_metadata and EOF_mediainfo and #lines == 0 and job.skip > 0 then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - end - - utils.force_render() - -- NOTE: Hacky way to prevent image overlap with old metadata area - if utils.get_state(const.STATE_KEY.prev_metadata_area) then - local old_metadata_area = utils.get_state(const.STATE_KEY.prev_metadata_area) - if - old_metadata_area.win_x == job.area.x - and old_metadata_area.win_y == job.area.y - and old_metadata_area.win_w == job.area.w - and old_metadata_area.win_h == job.area.h - then - ya.preview_widget(job, { - ui.Clear(ui.Rect({ - x = old_metadata_area.x, - y = old_metadata_area.y, - w = old_metadata_area.w, - h = old_metadata_area.h, - })), - }) - end - end - - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, not no_metadata and { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - - -- NOTE: Preload image - - local mime = job.mime:match(".*/(.*)$") - local is_svg = mime == "svg+xml" - local is_magick = const.magick_image_mimes[mime] - local no_skip_job = { skip = 0, file = job.file, args = job.args, area = job.area } - local cache_img_url = ya.file_cache(no_skip_job) - local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url) - - -- NOTE: Only generate preview image when cache image is not exist - if not cache_img_url_cha or cache_img_url_cha.len <= 0 then - local cache_img_status, image_preload_err - if not is_valid_utf8_path then - -- NOTE: Case not valid utf8 path, use trick to generate preview image - if is_svg then - local cache_img_url_tmp = Url(cache_img_url .. ".tmp") - if fs.cha(cache_img_url_tmp) then - fs.remove("file", cache_img_url_tmp) - end - local tmp_file_path, _ = type(fs.unique) == "function" and fs.unique("file", cache_img_url_tmp) - or fs.unique_name(cache_img_url_tmp) - -- svg under invalid utf8 path - cache_img_status, image_preload_err = require("magick") - .with_limit() - :arg({ - "-background", - "none", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url), - "-auto-orient", - "-strip", - string.format("%dx%d>", rt.preview.max_width, rt.preview.max_height), - "-quality", - rt.preview.image_quality, - string.format("PNG32:%s", tostring(tmp_file_path)), - }) - :status() - if cache_img_status then - os.rename(tostring(tmp_file_path), tostring(cache_img_url)) - end - end - else - -- NOTE: Case valid utf8 path, use image, svg, or magick module - local image_module = is_svg and "svg" or (is_magick and "magick" or "image") - cache_img_status, image_preload_err = require(image_module):preload(no_skip_job) - end - - if not cache_img_status and image_preload_err then - ya.dbg("mediainfo", image_preload_err) - err_msg = err_msg .. (image_preload_err and (tostring(image_preload_err)) or "") - end - end - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/main.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/main.lua deleted file mode 100644 index 6082d51..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/main.lua +++ /dev/null @@ -1,498 +0,0 @@ ---- @since 25.5.31 - -local skip_labels = { - ["Complete name"] = true, - ["CompleteName_Last"] = true, - ["Unique ID"] = true, - ["File size"] = true, - ["Format/Info"] = true, - ["Codec ID/Info"] = true, - ["MD5 of the unencoded content"] = true, -} - -local ENTRY_ACTION = { - toggle_metadata = "toggle-metadata", -} - -local STATE_KEY = { - units = "units", - hide_metadata = "hide_metadata", - prev_metadata_area = "prev_metadata_area", - prev_peek_data = "prev_peek_data", -} - -local magick_image_mimes = { - avif = true, - hei = true, - heic = true, - heif = true, - ["heif-sequence"] = true, - ["heic-sequence"] = true, - jxl = true, - xml = true, - ["svg+xml"] = true, - ["canon-cr2"] = true, -} - -local seekable_mimes = { - ["application/postscript"] = true, - ["image/adobe.photoshop"] = true, -} - -local M = {} -local suffix = "_mediainfo" -local SHELL = os.getenv("SHELL") or "" - -local function is_valid_utf8(str) - return utf8.len(str) ~= nil -end - -local function path_quote(path) - if not path or tostring(path) == "" then - return path - end - local result = "'" .. string.gsub(tostring(path), "'", "'\\''") .. "'" - return result -end - -local function read_mediainfo_cached_file(file_path) - -- Open the file in read mode - local file = io.open(file_path, "r") - - if file then - -- Read the entire file content - local content = file:read("*all") - file:close() - return content - end -end - -local set_state = ya.sync(function(state, key, value) - state[key] = value -end) - -local get_state = ya.sync(function(state, key) - return state[key] -end) - -local force_render = ya.sync(function(_, _) - (ui.render or ya.render)() -end) - -local function image_layer_count(job) - local cache = ya.file_cache({ file = job.file, skip = 0 }) - if not cache then - return 0 - end - local layer_count = get_state("f" .. tostring(cache)) - if layer_count then - return layer_count - end - local output, err = Command("identify") - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - if err then - return 0 - end - layer_count = 0 - for line in output.stdout:gmatch("[^\r\n]+") do - if line:match("%S") then - layer_count = layer_count + 1 - end - end - set_state("f" .. tostring(cache), layer_count) - return layer_count -end - -function M:peek(job) - local start = os.clock() - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - if not job.mime then - return - end - set_state(STATE_KEY.prev_peek_data, { - file = tostring(job.file.path or job.file.cache or job.file.url), - mime = job.mime, - area = { - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = job.area.h, - }, - args = job.args, - skip = job.skip, - }) - local is_video = string.find(job.mime, "^video/") - local is_audio = string.find(job.mime, "^audio/") - local is_image = string.find(job.mime, "^image/") - local is_seekable = seekable_mimes[job.mime] or is_video - local cache_img_url = (is_audio or is_image) and cache_img_url_no_skip - - if is_seekable then - cache_img_url = ya.file_cache(job) - end - local preload_status, preload_err = self:preload(job) - if not preload_status then - return - end - ya.sleep(math.max(0, rt.preview.image_delay / 1000 + start - os.clock())) - local hide_metadata = get_state(STATE_KEY.hide_metadata) - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local is_wrap = rt.preview.wrap == "yes" - if not hide_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. suffix - local output = read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = read_mediainfo_cached_file(cache_mediainfo_path) - end - - for str in output:gsub("\n+$", ""):gmatch("[^\n]*") do - local label, value = str:match("(.*[^ ]) +: (.*)") - local line - if label then - if not skip_labels[label] then - line = ui.Line({ - ui.Span(label .. ": "):style(ui.Style():fg("reset"):bold()), - ui.Span(value):style(th.spot.tbl_col or ui.Style():fg("blue")), - }) - end - elseif str ~= "General" then - line = ui.Line({ ui.Span(str):style(th.spot.title or ui.Style():fg("green")) }) - end - - if line then - local line_height = math.max(1, is_wrap and math.ceil(ui.width(line) / max_width) or 1) - if (last_line + line_height) > job.skip then - table.insert(lines, line) - end - if (last_line + line_height) >= job.skip + limit then - last_line = job.skip + limit - break - end - last_line = last_line + line_height - end - end - end - mediainfo_height = math.min(limit, last_line) - end - - if - (job.skip > 0 and #lines == 0 and not hide_metadata) - and ( - not is_seekable - or (is_video and job.skip >= 90) - or ( - (job.mime == "image/adobe.photoshop" or job.mime == "application/postscript") - and image_layer_count(job) - < (1 + math.floor( - math.max(0, get_state(STATE_KEY.units) and (job.skip / get_state(STATE_KEY.units)) or 0) - )) - ) - ) - then - ya.emit("peek", { - math.max(0, job.skip - (get_state(STATE_KEY.units) or limit)), - only_if = job.file.url, - upper_bound = true, - }) - return - end - force_render() - -- NOTE: Hacky way to prevent image overlap with old metadata area - if hide_metadata and get_state(STATE_KEY.prev_metadata_area) then - ya.preview_widget(job, { - ui.Clear(ui.Rect(get_state(STATE_KEY.prev_metadata_area))), - }) - end - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- NOTE: Workaround case audio has no cover image. Prevent regenerate preview image - if is_audio and image_height == 1 then - local info = ya.image_info(cache_img_url) - if not info or (info.w == 1 and info.h == 1) then - image_height = 0 - end - end - - -- NOTE: Workaround case video.lua doesn't doesn't generate preview image because of `skip` overflow video duration - if is_video and not rendered_img_rect then - image_height = math.max(job.area.h - mediainfo_height, 0) - end - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - -- NOTE: Hacky way to prevent image overlap with old metadata area - if not hide_metadata then - set_state(STATE_KEY.prev_metadata_area, { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - }) - end -end - -function M:seek(job) - local h = cx.active.current.hovered - if h and h.url == job.file.url then - set_state(STATE_KEY.units, job.units) - ya.emit("peek", { - math.max(0, cx.active.preview.skip + job.units), - only_if = job.file.url, - }) - end -end - -function M:re_peek() - local prev_peek_data = get_state(STATE_KEY.prev_peek_data) - if prev_peek_data then - prev_peek_data.file = File({ - url = Url(prev_peek_data.file), - cha = fs.cha(Url(prev_peek_data.file)), - }) - prev_peek_data.area = ui.area and ui.area("preview") or ui.Rect(prev_peek_data.area) - - self:peek(prev_peek_data) - end -end - -function M:preload(job) - local cache_img_url = ya.file_cache({ file = job.file, skip = 0 }) - if not cache_img_url then - return true - end - local cache_mediainfo_url = Url(tostring(cache_img_url) .. suffix) - cache_img_url = seekable_mimes[job.mime] and ya.file_cache(job) or cache_img_url - local cache_img_url_cha = cache_img_url and fs.cha(cache_img_url) - local err_msg = "" - local is_valid_utf8_path = is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - -- video mimetype - if job.mime then - if string.find(job.mime, "^video/") then - local cache_img_status, video_preload_err = require("video"):preload(job) - if not cache_img_status and video_preload_err then - err_msg = err_msg - .. string.format("Failed to start `%s`, Do you have `%s` installed?\n", "ffmpeg", "ffmpeg") - end - -- audo and image mimetype - elseif cache_img_url and (not cache_img_url_cha or cache_img_url_cha.len <= 0) then - -- audio - if string.find(job.mime, "^audio/") then - local qv = 31 - math.floor(rt.preview.image_quality * 0.3) - local audio_preload_output, audio_preload_err = Command("ffmpeg"):arg({ - "-v", - "error", - "-threads", - 1, - "-skip_frame", - "nokey", - "-an", - "-sn", - "-dn", - "-i", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url), - "-vframes", - 1, - "-q:v", - qv, - "-vf", - string.format("scale=-1:'min(%d,ih)':flags=fast_bilinear", rt.preview.max_height / 2), - "-f", - "image2", - "-y", - tostring(cache_img_url), - }):output() - -- NOTE: Some audio types doesn't have cover image -> error "" - if - (audio_preload_output and audio_preload_output.stderr ~= nil and audio_preload_output.stderr ~= "") - or audio_preload_err - then - err_msg = err_msg - .. string.format("Failed to start `%s`, Do you have `%s` installed?\n", "ffmpeg", "ffmpeg") - else - cache_img_url_cha, _ = fs.cha(cache_img_url) - if not cache_img_url_cha then - -- NOTE: Workaround case audio has no cover image. Prevent regenerate preview image - audio_preload_output, audio_preload_err = require("magick") - .with_limit() - :arg({ - "-size", - "1x1", - "canvas:none", - string.format("PNG32:%s", cache_img_url), - }) - :output() - if - (audio_preload_output.stderr ~= nil and audio_preload_output.stderr ~= "") - or audio_preload_err - then - err_msg = err_msg - .. string.format( - "Failed to start `%s`, Do you have `%s` installed?\n", - "magick", - "magick" - ) - end - end - end - -- image - elseif string.find(job.mime, "^image/") or job.mime == "application/postscript" then - local svg_plugin_ok, svg_plugin = pcall(require, "svg") - local _, magick_plugin = pcall(require, "magick") - local mime = job.mime:match(".*/(.*)$") - - local image_plugin = magick_image_mimes[mime] - and ((mime == "svg+xml" and svg_plugin_ok) and svg_plugin or magick_plugin) - or require("image") - - local cache_img_status, image_preload_err - -- psd, ai, eps - if mime == "adobe.photoshop" or job.mime == "application/postscript" then - local layer_index = 0 - local units = get_state(STATE_KEY.units) - if units ~= nil then - local max_layer = image_layer_count(job) - layer_index = math.floor(math.max(0, job.skip / units)) - if layer_index + 1 > max_layer then - layer_index = max_layer - 1 - end - end - local cache_img_url_tmp = Url(cache_img_url .. ".tmp") - if fs.cha(cache_img_url_tmp) then - fs.remove("file", cache_img_url_tmp) - end - local tmp_file_path, _ = fs.unique_name(cache_img_url_tmp) - cache_img_status, image_preload_err = magick_plugin - .with_limit() - :arg({ - "-background", - "none", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) - .. "[" - .. tostring(layer_index) - .. "]", - "-auto-orient", - "-strip", - "-resize", - string.format("%dx%d>", rt.preview.max_width, rt.preview.max_height), - "-quality", - rt.preview.image_quality, - string.format("PNG32:%s", tostring(tmp_file_path)), - }) - :status() - if cache_img_status then - os.rename(tostring(tmp_file_path), tostring(cache_img_url)) - end - elseif mime == "svg+xml" and not is_valid_utf8_path then - local cache_img_url_tmp = Url(cache_img_url .. ".tmp") - if fs.cha(cache_img_url_tmp) then - fs.remove("file", cache_img_url_tmp) - end - local tmp_file_path, _ = fs.unique_name(cache_img_url_tmp) - -- svg under invalid utf8 path - cache_img_status, image_preload_err = magick_plugin - .with_limit() - :arg({ - "-background", - "none", - tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url), - "-auto-orient", - "-strip", - "-flatten", - "-resize", - string.format("%dx%d>", rt.preview.max_width, rt.preview.max_height), - "-quality", - rt.preview.image_quality, - string.format("PNG32:%s", tostring(tmp_file_path)), - }) - :status() - if cache_img_status then - os.rename(tostring(tmp_file_path), tostring(cache_img_url)) - end - else - -- other image - local no_skip_job = { skip = 0, file = job.file, args = {} } - cache_img_status, image_preload_err = image_plugin:preload(no_skip_job) - end - if not cache_img_status then - err_msg = err_msg .. (image_preload_err and (tostring(image_preload_err)) or "") - end - end - end - end - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - local cmd = "mediainfo" - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. path_quote(job.file.path or job.file.cache or (job.file.url.path or job.file.url).parent) - .. " && " - .. cmd - .. " " - .. path_quote(tostring(job.file.path or job.file.cache or job.file.url.name)) - output, err = Command(SHELL) - :arg({ "-c", cmd }) - :arg({ tostring(job.file.path or job.file.cache or (job.file.url.path or job.file.url)) }) - :output() - end - if err then - err_msg = err_msg .. string.format("Failed to start `%s`, Do you have `%s` installed?\n", cmd, cmd) - end - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -function M:entry(job) - local action = job.args[1] - - if action == ENTRY_ACTION.toggle_metadata then - set_state(STATE_KEY.hide_metadata, not get_state(STATE_KEY.hide_metadata)) - M:re_peek() - end -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/none-media-preview-old.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/none-media-preview-old.lua deleted file mode 100644 index b88a9ec..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/none-media-preview-old.lua +++ /dev/null @@ -1,149 +0,0 @@ ---- @since 26.1.22 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = ui.Line({ - ui.Span(label .. ": "):style(ui.Style():fg("reset"):bold()), - ui.Span(value):style(th.spot.tbl_col or ui.Style():fg("blue")), - }) - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = ui.Line({ ui.Span(str):style(th.spot.title or ui.Style():fg("green")) }) - end - end - - if line then - local line_height = ui.height - and ui.height(str, { width = max_width, ansi = true, wrap = rt.preview.wrap }) - or (math.max(1, is_wrap and math.ceil(ui.width(line) / max_width) or 1)) - if next_str == nil and line_height == 1 then - EOF_mediainfo = true - end - if (last_line + line_height) > job.skip then - table.insert(lines, line) - end - if (last_line + line_height) >= job.skip + limit then - last_line = job.skip + limit - EOF_mediainfo = false - break - end - last_line = last_line + line_height - end - str = next_str - end - end - - if EOF_mediainfo and #lines == 0 and job.skip > 0 then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - end - - utils.force_render() - -- Handle preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Clear(job.area), - ui.Text(lines):area(job.area):wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, { - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = job.area.h, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/none-media-preview-stable.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/none-media-preview-stable.lua deleted file mode 100644 index 11e09ca..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/none-media-preview-stable.lua +++ /dev/null @@ -1,185 +0,0 @@ ---- @since 26.5.6 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - local opt = { ansi = true, tab_size = rt.preview.tab_size, wrap = rt.preview.wrap, width = max_width } - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = label .. ": " .. value - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = str - end - end - - if line then - local wrapped = ui.lines(line, opt) - local line_height = #wrapped - local from = 1 - local to = math.min(line_height, job.skip + limit - last_line) - - local total_rendered_text_len = 1 - local total_label_rendered_len = 1 - local label_total_len = label and utf8.len(label .. ": ") or 0 - for j = from, to do - local current_line_components = {} - local wrapped_line_len = wrapped[j]:width() or 0 - local wrapped_raw = - utils.utf8_sub(line, total_rendered_text_len, total_rendered_text_len + wrapped_line_len) - wrapped_line_len = utf8.len(wrapped_raw) - total_rendered_text_len = total_rendered_text_len + wrapped_line_len - - if last_line + 1 > job.skip then - local label_raw = label_total_len - total_label_rendered_len <= 0 and "" - or utils.utf8_sub(wrapped_raw, 1, label_total_len - total_label_rendered_len) - local label_raw_len = utf8.len(label_raw) - if label_raw_len > 0 then - table.insert( - current_line_components, - ui.Span(label_raw):style(ui.Style():fg("reset"):bold()) - ) - total_label_rendered_len = total_label_rendered_len + label_raw_len - wrapped_raw = wrapped_raw:gsub("^" .. utils.is_literal_string(label_raw), "", 1) - end - if total_label_rendered_len >= label_total_len then - local value_raw = wrapped_raw - table.insert( - current_line_components, - ui.Span(value_raw or ""):style( - label and (th.spot.tbl_col or ui.Style():fg("blue")) - or (th.spot.title or ui.Style():fg("green")) - ) - ) - end - table.insert(lines, ui.Line(current_line_components)) - -- last_line = last_line + 1 - else - total_label_rendered_len = total_label_rendered_len + total_rendered_text_len - end - last_line = last_line + 1 - if next_str == nil and not wrapped[j + 1] then - EOF_mediainfo = true - end - if last_line >= job.skip + limit then - last_line = job.skip + limit - EOF_mediainfo = false - break - end - end - end - str = next_str - end - end - - if EOF_mediainfo and #lines == 0 and job.skip > 0 then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - end - - utils.force_render() - -- Handle preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Clear(job.area), - ui.Text(lines):area(job.area):wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, { - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = job.area.h, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/utils.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/utils.lua deleted file mode 100644 index ea969ca..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/utils.lua +++ /dev/null @@ -1,127 +0,0 @@ ---- @since 26.1.22 - -local const = require(".const") - -local M = {} -local MAX_ITEMS_IN_CACHE = 10 - -function M.is_valid_utf8(str) - return utf8.len(str) ~= nil -end - -function M.utf8_sub(str, start_char, end_char) - local start_byte = utf8.offset(str, start_char) -- Expects start_char to be a character index - local end_byte = end_char and (utf8.offset(str, end_char + 1) or (#str + 1)) - 1 -- Expects end_char - if not start_byte then - return "" - end - return str:sub(start_byte, end_byte) -end -function M.is_literal_string(str) - return str and str:gsub("([%^%$%(%)%%%.%[%]%*%+%-%?])", "%%%1") -end -function M.path_quote(path) - if not path or tostring(path) == "" then - return path - end - local result = "'" .. string.gsub(tostring(path), "'", "'\\''") .. "'" - return result -end - -M.force_render = ya.sync(function(_, _) - (ui.render or ya.render)() -end) - -M.set_state = ya.sync(function(state, key, value) - state[key] = value -end) - -M.get_state = ya.sync(function(state, key) - return state[key] -end) - -M.set_states = ya.sync(function(state, namespace, key, value, limit_cached_items) - if not limit_cached_items then - limit_cached_items = MAX_ITEMS_IN_CACHE - end - if not state[namespace] then - state[namespace] = {} - end - local storage = state[namespace] - if limit_cached_items and #storage > limit_cached_items then - table.remove(storage, 1) - end - storage[key] = value -end) - -M.get_states = ya.sync(function(state, namespace, key) - local storage = state[namespace] - if not storage then - return nil - end - - if storage then - return storage[key] - end -end) -function M.read_mediainfo_cached_file(file_path) - local cached = M.get_states(const.STATE_KEY.cached_mediainfo, file_path) - if cached then - return cached - end - -- Open the file in read mode - local file = io.open(file_path, "r") - - if file then - -- Read the entire file content - local content = file:read("*all") - file:close() - M.set_states(const.STATE_KEY.cached_mediainfo, file_path, content) - return content - end -end - -M.current_file = ya.sync(function() - local h = cx.active.current.hovered - if not h then - return - end - return tostring(h.url) -end) - -function M.error(s, ...) - ya.notify({ title = "mediainfo", content = string.format(s, ...), timeout = 3, level = "error" }) -end - -function M.info(s, ...) - ya.notify({ title = "mediainfo", content = string.format(s, ...), timeout = 3, level = "info" }) -end - ---- return a string array with unique value ----@param tbl string[] ----@return string[] table with only unique strings -function M.tbl_unique_strings(tbl) - local unique_table = {} - local seen = {} - - for _, str in ipairs(tbl) do - if not seen[str] then - seen[str] = true - table.insert(unique_table, str) - end - end - - return unique_table -end - -function M.tbl_to_set(t1) - local set = {} - - for _, v in ipairs(t1) do - set[v] = true - end - - return set -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/video-old.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/video-old.lua deleted file mode 100644 index 6f02de9..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/video-old.lua +++ /dev/null @@ -1,241 +0,0 @@ ---- @since 26.1.22 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url = ya.file_cache({ - skip = job.skip > 90 and 90 or job.skip, - args = job.args, - file = job.file, - area = job.area, - }) - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local no_metadata = job.args.no_metadata - local mediainfo_job_skip = job.skip - ::recalc_mediainfo_job_skip:: - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - if not no_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = ui.Line({ - ui.Span(label .. ": "):style(ui.Style():fg("reset"):bold()), - ui.Span(value):style(th.spot.tbl_col or ui.Style():fg("blue")), - }) - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = ui.Line({ ui.Span(str):style(th.spot.title or ui.Style():fg("green")) }) - end - end - - if line then - local line_height = ui.height - and ui.height(str, { width = max_width, ansi = true, wrap = rt.preview.wrap }) - or (math.max(1, is_wrap and math.ceil(ui.width(line) / max_width) or 1)) - if next_str == nil and line_height == 1 then - EOF_mediainfo = true - end - if (last_line + line_height) > mediainfo_job_skip then - table.insert(lines, line) - end - if (last_line + line_height) >= mediainfo_job_skip + limit then - last_line = mediainfo_job_skip + limit - EOF_mediainfo = false - break - end - last_line = last_line + line_height - end - str = next_str - end - end - mediainfo_height = math.min(limit, last_line) - end - - if not no_metadata then - if EOF_mediainfo and #lines == 0 and mediainfo_job_skip > 0 then - if job.skip > 90 then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - else - -- NOTE: Recalculate mediainfo using cached latest valid skip value when reach the end of mediainfo output - local last_valid_mediainfo_skip = utils.get_state(const.STATE_KEY.last_valid_mediainfo_skip) - mediainfo_job_skip = last_valid_mediainfo_skip - and last_valid_mediainfo_skip[tostring(cache_img_url_no_skip)] - or math.max(0, mediainfo_job_skip - (utils.get_state(const.STATE_KEY.units) or 0)) - - goto recalc_mediainfo_job_skip - end - else - utils.set_state( - const.STATE_KEY.last_valid_mediainfo_skip, - { [tostring(cache_img_url_no_skip)] = mediainfo_job_skip } - ) - end - end - - -- NOTE: Hacky way to prevent image overlap with old metadata area - if utils.get_state(const.STATE_KEY.prev_metadata_area) then - local old_metadata_area = utils.get_state(const.STATE_KEY.prev_metadata_area) - if - old_metadata_area.win_x == job.area.x - and old_metadata_area.win_y == job.area.y - and old_metadata_area.win_w == job.area.w - and old_metadata_area.win_h == job.area.h - then - ya.preview_widget(job, { - ui.Clear(ui.Rect({ - x = old_metadata_area.x, - y = old_metadata_area.y, - w = old_metadata_area.w, - h = old_metadata_area.h, - })), - }) - end - end - - utils.force_render() - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- NOTE: Workaround case video.lua doesn't doesn't generate preview image because of `skip` overflow video duration - if not rendered_img_rect then - local prev_image_height = utils.get_state(const.STATE_KEY.prev_image_height) - image_height = prev_image_height and prev_image_height[tostring(cache_img_url_no_skip)] or 0 - else - utils.set_state(const.STATE_KEY.prev_image_height, { [tostring(cache_img_url_no_skip)] = image_height }) - end - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, not no_metadata and { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - - -- NOTE: Preload image from video - - local cache_img_status, video_preload_err = require("video"):preload({ - skip = job.skip > 90 and 90 or job.skip, - args = job.args, - file = job.file, - area = job.area, - }) - - if not cache_img_status and video_preload_err then - ya.dbg("mediainfo", video_preload_err) - err_msg = err_msg .. string.format("Failed to start `%s`.\n Do you have `%s` installed?\n", "ffmpeg", "ffmpeg") - end - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mediainfo.yazi/video-stable.lua b/yazi_1/.config/yazi/plugins/mediainfo.yazi/video-stable.lua deleted file mode 100644 index 4e174eb..0000000 --- a/yazi_1/.config/yazi/plugins/mediainfo.yazi/video-stable.lua +++ /dev/null @@ -1,277 +0,0 @@ ---- @since 26.5.6 - -local M = {} -local const = require(".const") -local utils = require(".utils") - -function M:peek(job) - local preload_status, preload_err = self:preload(job) - -- Stop if preload failed - if not preload_status then - return - end - - local cache_img_url = ya.file_cache({ - skip = job.skip > 90 and 90 or job.skip, - args = job.args, - file = job.file, - area = job.area, - }) - local cache_img_url_no_skip = ya.file_cache({ file = job.file, skip = 0 }) - - local no_metadata = job.args.no_metadata - local mediainfo_job_skip = job.skip - ::recalc_mediainfo_job_skip:: - local mediainfo_height = 0 - local lines = {} - local limit = job.area.h - local last_line = 0 - local EOF_mediainfo = true - local is_wrap = rt.preview.wrap == "yes" or rt.preview.wrap == ui.Wrap.YES - - if not no_metadata then - local cache_mediainfo_path = tostring(cache_img_url_no_skip) .. const.suffix - local output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - if output then - local max_width = math.max(1, job.area.w) - if output:match("^Error:") then - job.args.force_reload_mediainfo = true - preload_status, preload_err = self:preload(job) - if not preload_status or preload_err then - return - end - output = utils.read_mediainfo_cached_file(cache_mediainfo_path) - end - - output = output:gsub("\n+$", "") - - local iter = output:gmatch("[^\n]*") - local str = iter() - local opt = { ansi = true, tab_size = rt.preview.tab_size, wrap = rt.preview.wrap, width = max_width } - while str ~= nil do - local next_str = iter() - local label, value = str:match("(.*[^ ]) +: (.*)") - - local line - if label then - if not (utils.get_state(const.STATE_KEY.skip_labels) or const.skip_labels)[label] then - line = label .. ": " .. value - end - else - if not (utils.get_state(const.STATE_KEY.skip_section_labels) or {})[str] then - line = str - end - end - - if line then - local wrapped = ui.lines(line, opt) - local line_height = #wrapped - local from = 1 - local to = math.min(line_height, mediainfo_job_skip + limit - last_line) - - local total_rendered_text_len = 1 - local total_label_rendered_len = 1 - local label_total_len = label and utf8.len(label .. ": ") or 0 - for j = from, to do - local current_line_components = {} - local wrapped_line_len = wrapped[j]:width() or 0 - local wrapped_raw = - utils.utf8_sub(line, total_rendered_text_len, total_rendered_text_len + wrapped_line_len) - wrapped_line_len = utf8.len(wrapped_raw) - total_rendered_text_len = total_rendered_text_len + wrapped_line_len - - if last_line + 1 > mediainfo_job_skip then - local label_raw = label_total_len - total_label_rendered_len <= 0 and "" - or utils.utf8_sub(wrapped_raw, 1, label_total_len - total_label_rendered_len) - local label_raw_len = utf8.len(label_raw) - if label_raw_len > 0 then - table.insert( - current_line_components, - ui.Span(label_raw):style(ui.Style():fg("reset"):bold()) - ) - total_label_rendered_len = total_label_rendered_len + label_raw_len - wrapped_raw = wrapped_raw:gsub("^" .. utils.is_literal_string(label_raw), "", 1) - end - if total_label_rendered_len >= label_total_len then - local value_raw = wrapped_raw - table.insert( - current_line_components, - ui.Span(value_raw or ""):style( - label and (th.spot.tbl_col or ui.Style():fg("blue")) - or (th.spot.title or ui.Style():fg("green")) - ) - ) - end - table.insert(lines, ui.Line(current_line_components)) - -- last_line = last_line + 1 - else - total_label_rendered_len = total_label_rendered_len + total_rendered_text_len - end - last_line = last_line + 1 - if next_str == nil and not wrapped[j + 1] then - EOF_mediainfo = true - end - if last_line >= mediainfo_job_skip + limit then - last_line = mediainfo_job_skip + limit - EOF_mediainfo = false - break - end - end - end - str = next_str - end - end - mediainfo_height = math.min(limit, last_line) - end - - if not no_metadata then - if EOF_mediainfo and #lines == 0 and mediainfo_job_skip > 0 then - if job.skip > 90 then - ya.emit("peek", { - math.max(0, (job.skip - (utils.get_state(const.STATE_KEY.units) or 0))), - only_if = job.file.url, - upper_bound = true, - }) - return - else - -- NOTE: Recalculate mediainfo using cached latest valid skip value when reach the end of mediainfo output - local last_valid_mediainfo_skip = utils.get_state(const.STATE_KEY.last_valid_mediainfo_skip) - mediainfo_job_skip = last_valid_mediainfo_skip - and last_valid_mediainfo_skip[tostring(cache_img_url_no_skip)] - or math.max(0, mediainfo_job_skip - (utils.get_state(const.STATE_KEY.units) or 0)) - - goto recalc_mediainfo_job_skip - end - else - utils.set_state( - const.STATE_KEY.last_valid_mediainfo_skip, - { [tostring(cache_img_url_no_skip)] = mediainfo_job_skip } - ) - end - end - - -- NOTE: Hacky way to prevent image overlap with old metadata area - if utils.get_state(const.STATE_KEY.prev_metadata_area) then - local old_metadata_area = utils.get_state(const.STATE_KEY.prev_metadata_area) - if - old_metadata_area.win_x == job.area.x - and old_metadata_area.win_y == job.area.y - and old_metadata_area.win_w == job.area.w - and old_metadata_area.win_h == job.area.h - then - ya.preview_widget(job, { - ui.Clear(ui.Rect({ - x = old_metadata_area.x, - y = old_metadata_area.y, - w = old_metadata_area.w, - h = old_metadata_area.h, - })), - }) - end - end - - utils.force_render() - local rendered_img_rect = cache_img_url - and fs.cha(cache_img_url) - and ya.image_show( - cache_img_url, - ui.Rect({ - x = job.area.x, - y = job.area.y, - w = job.area.w, - h = mediainfo_height > 0 and math.max(job.area.h - mediainfo_height, job.area.h / 2) or job.area.h, - }) - ) - or nil - local image_height = rendered_img_rect and rendered_img_rect.h or 0 - - -- NOTE: Workaround case video.lua doesn't doesn't generate preview image because of `skip` overflow video duration - if not rendered_img_rect then - local prev_image_height = utils.get_state(const.STATE_KEY.prev_image_height) - image_height = prev_image_height and prev_image_height[tostring(cache_img_url_no_skip)] or 0 - else - utils.set_state(const.STATE_KEY.prev_image_height, { [tostring(cache_img_url_no_skip)] = image_height }) - end - - -- Handle image preload error - if preload_err then - table.insert(lines, ui.Line(tostring(preload_err)):style(th.spot.title or ui.Style():fg("red"))) - end - - ya.preview_widget(job, { - ui.Text(lines) - :area(ui.Rect({ - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - })) - :wrap(is_wrap and ui.Wrap.YES or ui.Wrap.NO), - }) - - -- NOTE: Hacky way to prevent image overlap with old metadata area - utils.set_state(const.STATE_KEY.prev_metadata_area, not no_metadata and { - x = job.area.x, - y = job.area.y + image_height, - w = job.area.w, - h = job.area.h - image_height, - win_x = job.area.x, - win_y = job.area.y, - win_w = job.area.w, - win_h = job.area.h, - } or nil) -end - -function M:preload(job) - local cmd = "mediainfo" - local err_msg = "" - - -- NOTE: Preload image from video - - local cache_img_status, video_preload_err = require("video"):preload({ - skip = job.skip > 90 and 90 or job.skip, - args = job.args, - file = job.file, - area = job.area, - }) - - if not cache_img_status and video_preload_err then - ya.dbg("mediainfo", video_preload_err) - err_msg = err_msg .. string.format("Failed to start `%s`.\n Do you have `%s` installed?\n", "ffmpeg", "ffmpeg") - end - - -- NOTE: Get mediainfo and save to cache folder - local cache_mediainfo_url = Url(tostring(ya.file_cache({ file = job.file, skip = 0 })) .. const.suffix) - local cache_mediainfo_cha = fs.cha(cache_mediainfo_url) - -- Case peek function called preload to refetch mediainfo - if cache_mediainfo_cha and not job.args.force_reload_mediainfo then - return true, err_msg ~= "" and ("Error: " .. err_msg) or nil - end - - local output, err - local is_valid_utf8_path = utils.is_valid_utf8(tostring(job.file.path or job.file.cache or job.file.url)) - if is_valid_utf8_path then - output, err = Command(cmd) - :arg({ tostring(job.file.path or job.file.cache or job.file.url.path or job.file.url) }) - :output() - else - cmd = "cd " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url.path or job.file.url).parent)) - .. " && " - .. cmd - .. " " - .. utils.path_quote(tostring((job.file.path or job.file.cache or job.file.url).name)) - output, err = Command(const.SHELL):arg({ "-c", cmd }):output() - end - if err then - ya.dbg("mediainfo", tostring(err)) - err_msg = err_msg .. string.format("Failed to start `%s`. \n Do you have `%s` installed?\n", cmd, cmd) - end - - return fs.write( - cache_mediainfo_url, - (err_msg ~= "" and ("Error: " .. err_msg) or "") .. (output and output.stdout or "") - ) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mime-ext.yazi/LICENSE b/yazi_1/.config/yazi/plugins/mime-ext.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/mime-ext.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/mime-ext.yazi/README.md b/yazi_1/.config/yazi/plugins/mime-ext.yazi/README.md deleted file mode 100644 index 65c6d20..0000000 --- a/yazi_1/.config/yazi/plugins/mime-ext.yazi/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# mime-ext.yazi - -A mime-type provider based on a file extension database, replacing the [builtin `file(1)`](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/mime.lua) to speed up mime-type retrieval at the expense of accuracy. - -See https://yazi-rs.github.io/docs/tips#make-yazi-even-faster for more information. - -## Installation - -```sh -ya pkg add yazi-rs/plugins:mime-ext -``` - -## Usage - -Add this to your `~/.config/yazi/yazi.toml`: - -```toml -[[plugin.prepend_fetchers]] -id = "mime" -url = "*" -run = "mime-ext" -prio = "high" -``` - -## Advanced - -You can also customize it in your `~/.config/yazi/init.lua` with: - -```lua -require("mime-ext"):setup { - -- Expand the existing filename database (lowercase), for example: - with_files = { - makefile = "text/makefile", - -- ... - }, - - -- Expand the existing extension database (lowercase), for example: - with_exts = { - mk = "text/makefile", - -- ... - }, - - -- If the mime-type is not in both filename and extension databases, - -- then fallback to Yazi's preset `mime` plugin, which uses `file(1)` - fallback_file1 = false, -} -``` - -## TODO - -- Add more file types (PRs welcome!). -- Compress mime-type tables. - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/mime-ext.yazi/local.lua b/yazi_1/.config/yazi/plugins/mime-ext.yazi/local.lua deleted file mode 100644 index ae0fd1e..0000000 --- a/yazi_1/.config/yazi/plugins/mime-ext.yazi/local.lua +++ /dev/null @@ -1,1146 +0,0 @@ ---- @since 26.8.15 ---- See https://www.iana.org/assignments/media-types/media-types.xhtml - -local FILES = { - [".envrc"] = "text/plain", - [".gitconfig"] = "text/plain", - [".gitignore"] = "text/plain", - [".luacheckrc"] = "text/lua", - [".npmrc"] = "text/plain", - [".styluaignore"] = "text/plain", - [".zshenv"] = "text/plain", - [".zshrc"] = "text/plain", - ["cargo.lock"] = "application/json", - ["flake.lock"] = "application/json", - license = "text/plain", -} - -local EXTS = { - ["123"] = "application/lotus-1-2-3", - ["3dml"] = "text/in3d.3dml", - ["3ds"] = "image/3ds", - ["3g2"] = "video/3gpp2", - ["3gp"] = "video/3gpp", - ["3mf"] = "model/3mf", - ["7z"] = "application/7z-compressed", - ["for"] = "text/fortran", - ["in"] = "text/plain", - ["n-gage"] = "application/nokia.n-gage.symbian.install", - ["sfd-hdstx"] = "application/hydrostatix.sof-data", - aab = "application/authorware-bin", - aac = "audio/aac", - aam = "application/authorware-map", - aas = "application/authorware-seg", - abw = "application/abiword", - ac = "application/pkix-attr-cert", - acc = "application/americandynamics.acc", - ace = "application/ace-compressed", - acu = "application/acucobol", - acutc = "application/acucorp", - adp = "audio/adpcm", - aep = "application/audiograph", - afm = "application/font-type1", - afp = "application/ibm.modcap", - ahead = "application/ahead.space", - ahk = "text/plain", - ai = "application/postscript", - aif = "audio/aiff", - aifc = "audio/aiff", - aiff = "audio/aiff", - air = "application/adobe.air-application-installer-package+zip", - ait = "application/dvb.ait", - ami = "application/amiga.ami", - apk = "application/android.package-archive", - appcache = "text/cache-manifest", - application = "application/ms-application", - apr = "application/lotus-approach", - arc = "application/freearc", - asc = "application/pgp-signature", - asf = "video/ms-asf", - asm = "text/asm", - aso = "application/accpac.simply.aso", - ass = "text/ass", - asx = "video/ms-asf", - atc = "application/acucorp", - atom = "application/atom+xml", - atomcat = "application/atomcat+xml", - atomsvc = "application/atomsvc+xml", - atx = "application/antix.game-component", - au = "audio/basic", - avi = "video/msvideo", - avif = "image/avif", - aw = "application/applixware", - azf = "application/airzip.filesecure.azf", - azs = "application/airzip.filesecure.azs", - azw = "application/amazon.ebook", - bash = "text/shellscript", - bat = "application/msdownload", - bcpio = "application/bcpio", - bdf = "application/font-bdf", - bdm = "application/syncml.dm+wbxml", - bean = "text/plain", - beancount = "text/plain", - bed = "application/realvnc.bed", - bh2 = "application/fujitsu.oasysprs", - bin = "application/octet-stream", - blb = "application/blorb", - blend = "application/blender", - blend1 = "application/blender", - blorb = "application/blorb", - bmi = "application/bmi", - bmp = "image/bmp", - book = "application/framemaker", - box = "application/previewsystems.box", - boz = "application/bzip2", - bpk = "application/octet-stream", - btif = "image/prs.btif", - bz = "application/bzip", - bz2 = "application/bzip2", - c = "text/c", - c11amc = "application/cluetrust.cartomobile-config", - c11amz = "application/cluetrust.cartomobile-config-pkg", - c4d = "application/clonk.c4group", - c4f = "application/clonk.c4group", - c4g = "application/clonk.c4group", - c4p = "application/clonk.c4group", - c4u = "application/clonk.c4group", - cab = "application/ms-cab-compressed", - caf = "audio/caf", - cap = "application/tcpdump.pcap", - car = "application/curl.car", - cat = "application/ms-pki.seccat", - cb7 = "application/cbr", - cba = "application/cbr", - cbr = "application/cbr", - cbt = "application/cbr", - cbz = "application/cbr", - cc = "text/c", - cct = "application/director", - ccxml = "application/ccxml+xml", - cdbcmsg = "application/contact.cmsg", - cdf = "application/netcdf", - cdkey = "application/mediastation.cdkey", - cdmia = "application/cdmi-capability", - cdmic = "application/cdmi-container", - cdmid = "application/cdmi-domain", - cdmio = "application/cdmi-object", - cdmiq = "application/cdmi-queue", - cdx = "chemical/cdx", - cdxml = "application/chemdraw+xml", - cdy = "application/cinderella", - cer = "application/pkix-cert", - cfg = "text/plain", - cfs = "application/cfs-compressed", - cgm = "image/cgm", - chat = "application/chat", - chm = "application/ms-htmlhelp", - chrt = "application/kde.kchart", - cif = "chemical/cif", - cii = "application/anser-web-certificate-issue-initiation", - cil = "application/ms-artgalry", - cla = "application/claymore", - class = "application/java-vm", - clkk = "application/crick.clicker.keyboard", - clkp = "application/crick.clicker.palette", - clkt = "application/crick.clicker.template", - clkw = "application/crick.clicker.wordbank", - clkx = "application/crick.clicker", - clp = "application/msclip", - cmc = "application/cosmocaller", - cmdf = "chemical/cmdf", - cml = "chemical/cml", - cmp = "application/yellowriver-custom-menu", - cmx = "image/cmx", - cod = "application/rim.cod", - com = "application/msdownload", - conf = "text/plain", - cpio = "application/cpio", - cpp = "text/c", - cpt = "application/mac-compactpro", - crd = "application/mscardfile", - crl = "application/pkix-crl", - crt = "application/x509-ca-cert", - cryptonote = "application/rig.cryptonote", - csh = "application/csh", - csml = "chemical/csml", - csp = "application/commonspace", - css = "text/css", - cst = "application/director", - csv = "text/csv", - cu = "application/cu-seeme", - curl = "text/curl", - cww = "application/prs.cww", - cxt = "application/director", - cxx = "text/c", - dae = "model/collada+xml", - daf = "application/mobius.daf", - dart = "application/dart", - dataless = "application/fdsn.seed", - davmount = "application/davmount+xml", - dbk = "application/docbook+xml", - dcr = "application/director", - dcurl = "text/curl.dcurl", - dd2 = "application/oma.dd2+xml", - ddd = "application/fujixerox.ddd", - deb = "application/debian-package", - def = "text/plain", - deploy = "application/octet-stream", - der = "application/x509-ca-cert", - dfac = "application/dreamfactory", - dgc = "application/dgc-compressed", - dic = "text/c", - dir = "application/director", - dis = "application/mobius.dis", - dist = "application/octet-stream", - distz = "application/octet-stream", - djv = "image/djvu", - djvu = "image/djvu", - dll = "application/msdownload", - dmg = "application/apple-diskimage", - dmp = "application/tcpdump.pcap", - dms = "application/octet-stream", - dna = "application/dna", - doc = "application/msword", - docm = "application/ms-word.document.macroenabled.12", - docx = "application/openxmlformats-officedocument.wordprocessingml.document", - dot = "application/msword", - dotm = "application/ms-word.template.macroenabled.12", - dotx = "application/openxmlformats-officedocument.wordprocessingml.template", - dp = "application/osgi.dp", - dpg = "application/dpgraph", - dra = "audio/dra", - dsc = "text/prs.lines.tag", - dssc = "application/dssc+der", - dtb = "application/dtbook+xml", - dtd = "application/xml-dtd", - dts = "audio/dts", - dtshd = "audio/dts.hd", - dump = "application/octet-stream", - dvb = "video/dvb.file", - dvi = "application/dvi", - dwf = "model/dwf", - dwg = "image/dwg", - dxf = "image/dxf", - dxp = "application/spotfire.dxp", - dxr = "application/director", - ebuild = "application/gentoo.ebuild", - ecelp4800 = "audio/nuera.ecelp4800", - ecelp7470 = "audio/nuera.ecelp7470", - ecelp9600 = "audio/nuera.ecelp9600", - eclass = "application/gentoo.eclass", - ecma = "application/ecmascript", - edm = "application/novadigm.edm", - edx = "application/novadigm.edx", - efif = "application/picsel", - ei6 = "application/pg.osasli", - el = "text/plain", - elc = "application/octet-stream", - emf = "application/msmetafile", - eml = "message/rfc822", - emma = "application/emma+xml", - emz = "application/msmetafile", - env = "text/plain", - eol = "audio/digital-winds", - eot = "application/ms-fontobject", - eps = "application/postscript", - epub = "application/epub+zip", - es3 = "application/eszigno3+xml", - esa = "application/osgi.subsystem", - esf = "application/epson.esf", - et3 = "application/eszigno3+xml", - etx = "text/setext", - eva = "application/eva", - evy = "application/envoy", - exe = "application/msdownload", - exi = "application/exi", - ext = "application/novadigm.ext", - ez = "application/andrew-inset", - ez2 = "application/ezpix-album", - ez3 = "application/ezpix-package", - f = "text/fortran", - f4v = "video/f4v", - f77 = "text/fortran", - f90 = "text/fortran", - fbs = "image/fastbidsheet", - fcdt = "application/adobe.formscentral.fcdt", - fcs = "application/isac.fcs", - fdf = "application/fdf", - fe_launch = "application/denovo.fcselayout-link", - fg5 = "application/fujitsu.oasysgp", - fgd = "application/director", - fh = "image/freehand", - fh4 = "image/freehand", - fh5 = "image/freehand", - fh7 = "image/freehand", - fhc = "image/freehand", - fig = "application/xfig", - fish = "text/shellscript", - flac = "audio/flac", - fli = "video/fli", - flo = "application/micrografx.flo", - flv = "video/flv", - flw = "application/kde.kivio", - flx = "text/fmi.flexstor", - fly = "text/fly", - fm = "application/framemaker", - fnc = "application/frogans.fnc", - fpx = "image/fpx", - frame = "application/framemaker", - fsc = "application/fsc.weblaunch", - fst = "image/fst", - ftc = "application/fluxtime.clip", - fti = "application/anser-web-funds-transfer-initiation", - fvt = "video/fvt", - fxp = "application/adobe.fxp", - fxpl = "application/adobe.fxp", - fzs = "application/fuzzysheet", - g2w = "application/geoplan", - g3 = "image/g3fax", - g3w = "application/geospace", - gac = "application/groove-account", - gam = "application/tads", - gbr = "application/rpki-ghostbusters", - gca = "application/gca-compressed", - gdl = "model/gdl", - geo = "application/dynageo", - gex = "application/geometry-explorer", - ggb = "application/geogebra.file", - ggs = "application/geogebra.slides", - ggt = "application/geogebra.tool", - ghf = "application/groove-help", - gif = "image/gif", - gim = "application/groove-identity-message", - gml = "application/gml+xml", - gmx = "application/gmx", - gnumeric = "application/gnumeric", - go = "text/go", - gph = "application/flographit", - gpx = "application/gpx+xml", - gqf = "application/grafeq", - gqs = "application/grafeq", - gram = "application/srgs", - gramps = "application/gramps-xml", - gre = "application/geometry-explorer", - grv = "application/groove-injector", - grxml = "application/srgs+xml", - gsf = "application/font-ghostscript", - gtar = "application/gtar", - gtm = "application/groove-tool-message", - gtw = "model/gtw", - gv = "text/graphviz", - gxf = "application/gxf", - gxt = "application/geonext", - gz = "application/gzip", - h = "text/c", - h261 = "video/h261", - h263 = "video/h263", - h264 = "video/h264", - hal = "application/hal+xml", - hbci = "application/hbci", - hcl = "text/hcl", - hdf = "application/hdf", - hh = "text/c", - hlp = "application/winhlp", - hpgl = "application/hp-hpgl", - hpid = "application/hp-hpid", - hpp = "text/c", - hps = "application/hp-hps", - hqx = "application/mac-binhex40", - htke = "application/kenameaapp", - htm = "text/html", - html = "text/html", - hvd = "application/yamaha.hv-dic", - hvp = "application/yamaha.hv-voice", - hvs = "application/yamaha.hv-script", - i2g = "application/intergeo", - icc = "application/iccprofile", - ice = "conference/cooltalk", - icm = "application/iccprofile", - ico = "image/icon", - ics = "text/calendar", - ief = "image/ief", - ifb = "text/calendar", - ifm = "application/shana.informed.formdata", - iges = "model/iges", - igl = "application/igloader", - igm = "application/insors.igm", - igs = "model/iges", - igx = "application/micrografx.igx", - iif = "application/shana.informed.interchange", - imp = "application/accpac.simply.imp", - ims = "application/ms-ims", - ini = "text/plain", - ink = "application/inkml+xml", - inkml = "application/inkml+xml", - install = "application/install-instructions", - iota = "application/astraea-software.iota", - ipfix = "application/ipfix", - ipk = "application/shana.informed.package", - irm = "application/ibm.rights-management", - irp = "application/irepository.package+xml", - iso = "application/iso9660-image", - itp = "application/shana.informed.formtemplate", - ivp = "application/immervision-ivp", - ivu = "application/immervision-ivu", - jad = "text/sun.j2me.app-descriptor", - jam = "application/jam", - jar = "application/java-archive", - java = "text/java-source", - jisp = "application/jisp", - jlt = "application/hp-jlyt", - jnlp = "application/java-jnlp-file", - joda = "application/joost.joda-archive", - jpe = "image/jpeg", - jpeg = "image/jpeg", - jpg = "image/jpeg", - jpgm = "video/jpm", - jpgv = "video/jpeg", - jpm = "video/jpm", - js = "text/javascript", - json = "application/json", - jsonc = "application/json", - jsonml = "application/jsonml+json", - jsx = "text/jsx", - jxl = "image/jxl", - kar = "audio/midi", - karbon = "application/kde.karbon", - kfo = "application/kde.kformula", - kia = "application/kidspiration", - kml = "application/google-earth.kml+xml", - kmz = "application/google-earth.kmz", - kne = "application/kinar", - knp = "application/kinar", - kon = "application/kde.kontour", - kpr = "application/kde.kpresenter", - kpt = "application/kde.kpresenter", - kpxx = "application/ds-keypoint", - kra = "application/krita", - ["kra~"] = "application/krita", - ksp = "application/kde.kspread", - ktr = "application/kahootz", - ktx = "image/ktx", - ktz = "application/kahootz", - kwd = "application/kde.kword", - kwt = "application/kde.kword", - lasxml = "application/las.las+xml", - latex = "application/latex", - lbd = "application/llamagraphics.life-balance.desktop", - lbe = "application/llamagraphics.life-balance.exchange+xml", - les = "application/hhe.lesson-player", - lha = "application/lzh-compressed", - link66 = "application/route66.link66+xml", - list = "text/plain", - list3820 = "application/ibm.modcap", - listafp = "application/ibm.modcap", - lnk = "application/ms-shortcut", - log = "text/plain", - lostxml = "application/lost+xml", - lrf = "application/octet-stream", - lrm = "application/ms-lrm", - lrz = "application/lrzip", - ltf = "application/frogans.ltf", - lua = "text/lua", - lvp = "audio/lucent.voice", - lwp = "application/lotus-wordpro", - lz = "application/lzip", - lz4 = "application/lz4", - lzh = "application/lzh-compressed", - lzma = "application/lzma", - lzo = "application/lzop", - m13 = "application/msmediaview", - m14 = "application/msmediaview", - m1v = "video/mpeg", - m21 = "application/mp21", - m2a = "audio/mpeg", - m2t = "video/mp2t", - m2ts = "video/mp2t", - m2v = "video/mpeg", - m3a = "audio/mpeg", - m3u = "audio/mpegurl", - m3u8 = "application/apple.mpegurl", - m4a = "audio/mp4", - m4u = "video/mpegurl", - m4v = "video/m4v", - ma = "application/mathematica", - mads = "application/mads+xml", - mag = "application/ecowin.chart", - maker = "application/framemaker", - man = "text/troff", - mar = "application/octet-stream", - mathml = "application/mathml+xml", - mb = "application/mathematica", - mbk = "application/mobius.mbk", - mbox = "application/mbox", - mc1 = "application/medcalcdata", - mcd = "application/mcd", - mcurl = "text/curl.mcurl", - md = "text/markdown", - mdb = "application/msaccess", - mdi = "image/ms-modi", - me = "text/troff", - mesh = "model/mesh", - meta4 = "application/metalink4+xml", - metalink = "application/metalink+xml", - mets = "application/mets+xml", - mfm = "application/mfmp", - mft = "application/rpki-manifest", - mgp = "application/osgeo.mapguide.package", - mgz = "application/proteus.magazine", - mid = "audio/midi", - midi = "audio/midi", - mie = "application/mie", - mif = "application/mif", - mime = "message/rfc822", - mj2 = "video/mj2", - mjp2 = "video/mj2", - mjs = "text/javascript", - mk3d = "video/matroska", - mka = "audio/matroska", - mks = "video/matroska", - mkv = "video/matroska", - mlp = "application/dolby.mlp", - mmd = "application/chipnuts.karaoke-mmd", - mmf = "application/smaf", - mmr = "image/fujixerox.edmics-mmr", - mng = "video/mng", - mny = "application/msmoney", - mobi = "application/mobipocket-ebook", - mods = "application/mods+xml", - mov = "video/quicktime", - movie = "video/sgi-movie", - mp2 = "audio/mpeg", - mp21 = "application/mp21", - mp2a = "audio/mpeg", - mp3 = "audio/mpeg", - mp4 = "video/mp4", - mp4a = "audio/mp4", - mp4s = "application/mp4", - mp4v = "video/mp4", - mpc = "application/mophun.certificate", - mpe = "video/mpeg", - mpeg = "video/mpeg", - mpg = "video/mpeg", - mpg4 = "video/mp4", - mpga = "audio/mpeg", - mpkg = "application/apple.installer+xml", - mpm = "application/blueice.multipass", - mpn = "application/mophun.application", - mpp = "application/ms-project", - mpt = "application/ms-project", - mpy = "application/ibm.minipay", - mqy = "application/mobius.mqy", - mrc = "application/marc", - mrcx = "application/marcxml+xml", - ms = "text/troff", - mscml = "application/mediaservercontrol+xml", - mseed = "application/fdsn.mseed", - mseq = "application/mseq", - msf = "application/epson.msf", - msh = "model/mesh", - msi = "application/msdownload", - msl = "application/mobius.msl", - msty = "application/muvee.style", - mtl = "model/mtl", - mts = "video/mp2t", - mus = "application/musician", - musicxml = "application/recordare.musicxml+xml", - mvb = "application/msmediaview", - mwf = "application/mfer", - mxf = "application/mxf", - mxl = "application/recordare.musicxml", - mxml = "application/xv+xml", - mxs = "application/triscape.mxs", - mxu = "video/mpegurl", - n3 = "text/n3", - nb = "application/mathematica", - nbp = "application/wolfram.player", - nc = "application/netcdf", - ncx = "application/dtbncx+xml", - nfo = "text/nfo", - ngdat = "application/nokia.n-gage.data", - nitf = "application/nitf", - nix = "text/nix", - nlu = "application/neurolanguage.nlu", - nml = "application/enliven", - nnd = "application/noblenet-directory", - nns = "application/noblenet-sealer", - nnw = "application/noblenet-web", - npx = "image/net-fpx", - nsc = "application/conference", - nsf = "application/lotus-notes", - ntf = "application/nitf", - nzb = "application/nzb", - oa2 = "application/fujitsu.oasys2", - oa3 = "application/fujitsu.oasys3", - oas = "application/fujitsu.oasys", - obd = "application/msbinder", - obj = "model/obj", - oda = "application/oda", - odb = "application/oasis.opendocument.database", - odc = "application/oasis.opendocument.chart", - odf = "application/oasis.opendocument.formula", - odft = "application/oasis.opendocument.formula-template", - odg = "application/oasis.opendocument.graphics", - odi = "application/oasis.opendocument.image", - odm = "application/oasis.opendocument.text-master", - odp = "application/oasis.opendocument.presentation", - ods = "application/oasis.opendocument.spreadsheet", - odt = "application/oasis.opendocument.text", - oga = "audio/ogg", - ogg = "audio/ogg", - ogv = "video/ogg", - ogx = "application/ogg", - omdoc = "application/omdoc+xml", - onepkg = "application/onenote", - onetmp = "application/onenote", - onetoc = "application/onenote", - onetoc2 = "application/onenote", - opf = "application/oebps-package+xml", - opml = "text/opml", - oprc = "application/palm", - opus = "audio/ogg", - org = "application/lotus-organizer", - osf = "application/yamaha.openscoreformat", - osfpvg = "application/yamaha.openscoreformat.osfpvg+xml", - otc = "application/oasis.opendocument.chart-template", - otf = "font/otf", - otg = "application/oasis.opendocument.graphics-template", - oth = "application/oasis.opendocument.text-web", - oti = "application/oasis.opendocument.image-template", - otp = "application/oasis.opendocument.presentation-template", - ots = "application/oasis.opendocument.spreadsheet-template", - ott = "application/oasis.opendocument.text-template", - oxps = "application/oxps", - oxt = "application/openofficeorg.extension", - p = "text/pascal", - p10 = "application/pkcs10", - p12 = "application/pkcs12", - p7b = "application/pkcs7-certificates", - p7c = "application/pkcs7-mime", - p7m = "application/pkcs7-mime", - p7r = "application/pkcs7-certreqresp", - p7s = "application/pkcs7-signature", - p8 = "application/pkcs8", - pas = "text/pascal", - patch = "text/diff", - paw = "application/pawaafile", - pbd = "application/powerbuilder6", - pbm = "image/portable-bitmap", - pcap = "application/tcpdump.pcap", - pcf = "application/font-pcf", - pcl = "application/hp-pcl", - pclxl = "application/hp-pclxl", - pct = "image/pict", - pcurl = "application/curl.pcurl", - pcx = "image/pcx", - pdb = "application/palm", - pdf = "application/pdf", - pfa = "application/font-type1", - pfb = "application/font-type1", - pfm = "application/font-type1", - pfr = "application/font-tdpfr", - pfx = "application/pkcs12", - pgm = "image/portable-graymap", - pgn = "application/chess-pgn", - pgp = "application/pgp-encrypted", - php = "text/php", - pic = "image/pict", - pkg = "application/octet-stream", - pki = "application/pkixcmp", - pkipath = "application/pkix-pkipath", - plb = "application/3gpp.pic-bw-large", - plc = "application/mobius.plc", - plf = "application/pocketlearn", - pls = "application/pls+xml", - pml = "application/ctc-posml", - png = "image/png", - pnm = "image/portable-anymap", - portpkg = "application/macports.portpkg", - pot = "application/ms-powerpoint", - potm = "application/ms-powerpoint.template.macroenabled.12", - potx = "application/openxmlformats-officedocument.presentationml.template", - ppam = "application/ms-powerpoint.addin.macroenabled.12", - ppd = "application/cups-ppd", - ppm = "image/portable-pixmap", - pps = "application/ms-powerpoint", - ppsm = "application/ms-powerpoint.slideshow.macroenabled.12", - ppsx = "application/openxmlformats-officedocument.presentationml.slideshow", - ppt = "application/ms-powerpoint", - pptm = "application/ms-powerpoint.presentation.macroenabled.12", - pptx = "application/openxmlformats-officedocument.presentationml.presentation", - pqa = "application/palm", - prc = "application/mobipocket-ebook", - pre = "application/lotus-freelance", - prf = "application/pics-rules", - ps = "application/postscript", - psb = "application/3gpp.pic-bw-small", - psd = "image/adobe.photoshop", - psf = "application/font-linux-psf", - pskcxml = "application/pskc+xml", - ptid = "application/pvi.ptid1", - pub = "application/mspublisher", - pvb = "application/3gpp.pic-bw-var", - pwn = "application/3m.post-it-notes", - py = "text/python", - pya = "audio/ms-playready.media.pya", - pyv = "video/ms-playready.media.pyv", - qam = "application/epson.quickanime", - qbo = "application/intu.qbo", - qfx = "application/intu.qfx", - qml = "text/qml", - qps = "application/publishare-delta-tree", - qt = "video/quicktime", - qwd = "application/quark.quarkxpress", - qwt = "application/quark.quarkxpress", - qxb = "application/quark.quarkxpress", - qxd = "application/quark.quarkxpress", - qxl = "application/quark.quarkxpress", - qxt = "application/quark.quarkxpress", - r = "text/r", - ra = "audio/pn-realaudio", - ram = "audio/pn-realaudio", - rar = "application/rar", - ras = "image/cmu-raster", - rb = "text/ruby", - rcprofile = "application/ipunplugged.rcprofile", - rdf = "application/rdf+xml", - rdz = "application/data-vision.rdz", - rep = "application/businessobjects", - res = "application/dtbresource+xml", - rgb = "image/rgb", - rif = "application/reginfo+xml", - rip = "audio/rip", - ris = "application/research-info-systems", - rl = "application/resource-lists+xml", - rlc = "image/fujixerox.edmics-rlc", - rld = "application/resource-lists-diff+xml", - rm = "application/rn-realmedia", - rmi = "audio/midi", - rmp = "audio/pn-realaudio-plugin", - rms = "application/jcp.javame.midlet-rms", - rmvb = "application/rn-realmedia-vbr", - rnc = "application/relax-ng-compact-syntax", - roa = "application/rpki-roa", - roff = "text/troff", - rp9 = "application/cloanto.rp9", - rpm = "application/rpm", - rpss = "application/nokia.radio-presets", - rpst = "application/nokia.radio-preset", - rq = "application/sparql-query", - rs = "text/rust", - rsd = "application/rsd+xml", - rss = "application/rss+xml", - rtf = "application/rtf", - rtx = "text/richtext", - s = "text/asm", - s3m = "audio/s3m", - saf = "application/yamaha.smaf-audio", - sbml = "application/sbml+xml", - sc = "application/ibm.secure-container", - scd = "application/msschedule", - scm = "application/lotus-screencam", - scq = "application/scvp-cv-request", - scs = "application/scvp-cv-response", - scss = "text/scss", - scurl = "text/curl.scurl", - sda = "application/stardivision.draw", - sdc = "application/stardivision.calc", - sdd = "application/stardivision.impress", - sdkd = "application/solent.sdkm+xml", - sdkm = "application/solent.sdkm+xml", - sdp = "application/sdp", - sdw = "application/stardivision.writer", - see = "application/seemail", - seed = "application/fdsn.seed", - sema = "application/sema", - semd = "application/semd", - semf = "application/semf", - ser = "application/java-serialized-object", - setpay = "application/set-payment-initiation", - setreg = "application/set-registration-initiation", - sfs = "application/spotfire.sfs", - sfv = "text/sfv", - sgi = "image/sgi", - sgl = "application/stardivision.writer-global", - sgm = "text/sgml", - sgml = "text/sgml", - sh = "text/shellscript", - shar = "application/shar", - shf = "application/shf+xml", - sid = "image/mrsid-image", - sig = "application/pgp-signature", - sil = "audio/silk", - silo = "model/mesh", - sis = "application/symbian.install", - sisx = "application/symbian.install", - sit = "application/stuffit", - sitx = "application/stuffitx", - skd = "application/koan", - skm = "application/koan", - skp = "application/koan", - skt = "application/koan", - sldm = "application/ms-powerpoint.slide.macroenabled.12", - sldx = "application/openxmlformats-officedocument.presentationml.slide", - slt = "application/epson.salt", - sm = "application/stepmania.stepchart", - smf = "application/stardivision.math", - smi = "application/smil+xml", - smil = "application/smil+xml", - smv = "video/smv", - smzip = "application/stepmania.package", - snd = "audio/basic", - snf = "application/font-snf", - so = "application/octet-stream", - spc = "application/pkcs7-certificates", - spf = "application/yamaha.smaf-phrase", - spl = "application/futuresplash", - spot = "text/in3d.spot", - spp = "application/scvp-vp-response", - spq = "application/scvp-vp-request", - spx = "audio/ogg", - sql = "application/sql", - src = "application/wais-source", - srt = "application/subrip", - sru = "application/sru+xml", - srx = "application/sparql-results+xml", - ssdl = "application/ssdl+xml", - sse = "application/kodak-descriptor", - ssf = "application/epson.ssf", - ssml = "application/ssml+xml", - st = "application/sailingtracker.track", - stc = "application/sun.xml.calc.template", - std = "application/sun.xml.draw.template", - step = "model/step", - stf = "application/wt.stf", - sti = "application/sun.xml.impress.template", - stk = "application/hyperstudio", - stl = "model/stl", - stp = "model/step", - str = "application/pg.format", - stw = "application/sun.xml.writer.template", - sub = "text/dvb.subtitle", - sus = "application/sus-calendar", - susp = "application/sus-calendar", - sv4cpio = "application/sv4cpio", - sv4crc = "application/sv4crc", - svc = "application/dvb.service", - svd = "application/svd", - svg = "image/svg+xml", - svgz = "image/svg+xml", - swa = "application/director", - swf = "application/shockwave-flash", - swi = "application/aristanetworks.swi", - sxc = "application/sun.xml.calc", - sxd = "application/sun.xml.draw", - sxg = "application/sun.xml.writer.global", - sxi = "application/sun.xml.impress", - sxm = "application/sun.xml.math", - sxw = "application/sun.xml.writer", - t = "text/troff", - t3 = "application/t3vm-image", - taglet = "application/mynfc", - tao = "application/tao.intent-module-archive", - tar = "application/tar", - tcap = "application/3gpp2.tcap", - tcl = "application/tcl", - teacher = "application/smart.teacher", - tei = "application/tei+xml", - teicorpus = "application/tei+xml", - tex = "application/tex", - texi = "application/texinfo", - texinfo = "application/texinfo", - text = "text/plain", - tf = "text/hcl", - tfi = "application/thraud+xml", - tfm = "application/tex-tfm", - tfrc = "text/hcl", - tfstate = "application/json", - tfvars = "text/hcl", - tga = "image/tga", - thmx = "application/ms-officetheme", - tif = "image/tiff", - tiff = "image/tiff", - tmo = "application/tmobile-livetv", - tofu = "text/hcl", - toml = "text/toml", - torrent = "application/bittorrent", - tpl = "application/groove-tool-template", - tpt = "application/trid.tpt", - tr = "text/troff", - tra = "application/trueapp", - trm = "application/msterminal", - ts = "text/typescript", - tsd = "application/timestamped-data", - tsv = "text/tab-separated-values", - tsx = "text/tsx", - ttc = "font/collection", - ttf = "font/ttf", - ttl = "text/turtle", - twd = "application/simtech-mindmapper", - twds = "application/simtech-mindmapper", - txd = "application/genomatix.tuxedo", - txf = "application/mobius.txf", - txt = "text/plain", - u32 = "application/authorware-bin", - udeb = "application/debian-package", - ufd = "application/ufdl", - ufdl = "application/ufdl", - ulx = "application/glulx", - umj = "application/umajin", - unityweb = "application/unity", - uoml = "application/uoml+xml", - uri = "text/uri-list", - uris = "text/uri-list", - urls = "text/uri-list", - ustar = "application/ustar", - utz = "application/uiq.theme", - uu = "text/uuencode", - uva = "audio/dece.audio", - uvd = "application/dece.data", - uvf = "application/dece.data", - uvg = "image/dece.graphic", - uvh = "video/dece.hd", - uvi = "image/dece.graphic", - uvm = "video/dece.mobile", - uvp = "video/dece.pd", - uvs = "video/dece.sd", - uvt = "application/dece.ttml+xml", - uvu = "video/uvvu.mp4", - uvv = "video/dece.video", - uvva = "audio/dece.audio", - uvvd = "application/dece.data", - uvvf = "application/dece.data", - uvvg = "image/dece.graphic", - uvvh = "video/dece.hd", - uvvi = "image/dece.graphic", - uvvm = "video/dece.mobile", - uvvp = "video/dece.pd", - uvvs = "video/dece.sd", - uvvt = "application/dece.ttml+xml", - uvvu = "video/uvvu.mp4", - uvvv = "video/dece.video", - uvvx = "application/dece.unspecified", - uvvz = "application/dece.zip", - uvx = "application/dece.unspecified", - uvz = "application/dece.zip", - vcard = "text/vcard", - vcd = "application/cdlink", - vcf = "text/vcard", - vcg = "application/groove-vcard", - vcs = "text/vcalendar", - vcx = "application/vcx", - vim = "text/plain", - vis = "application/visionary", - viv = "video/vivo", - vob = "video/ms-vob", - vor = "application/stardivision.writer", - vox = "application/authorware-bin", - vrml = "model/vrml", - vsd = "application/visio", - vsf = "application/vsf", - vss = "application/visio", - vst = "application/visio", - vsw = "application/visio", - vtu = "model/vtu", - vxml = "application/voicexml+xml", - w3d = "application/director", - wad = "application/doom", - wasm = "application/wasm", - wav = "audio/wav", - wax = "audio/ms-wax", - wbmp = "image/wap.wbmp", - wbs = "application/criticaltools.wbs+xml", - wbxml = "application/wap.wbxml", - wcm = "application/ms-works", - wdb = "application/ms-works", - wdp = "image/ms-photo", - weba = "audio/webm", - webm = "video/webm", - webp = "image/webp", - wg = "application/pmi.widget", - wgt = "application/widget", - wks = "application/ms-works", - wm = "video/ms-wm", - wma = "audio/ms-wma", - wmd = "application/ms-wmd", - wmf = "application/msmetafile", - wml = "text/wap.wml", - wmlc = "application/wap.wmlc", - wmls = "text/wap.wmlscript", - wmlsc = "application/wap.wmlscriptc", - wmv = "video/ms-wmv", - wmx = "video/ms-wmx", - wmz = "application/ms-wmz", - woff = "font/woff", - woff2 = "font/woff2", - wpd = "application/wordperfect", - wpl = "application/ms-wpl", - wps = "application/ms-works", - wqd = "application/wqd", - wri = "application/mswrite", - wrl = "model/vrml", - wsdl = "application/wsdl+xml", - wspolicy = "application/wspolicy+xml", - wtb = "application/webturbo", - wvx = "video/ms-wvx", - x32 = "application/authorware-bin", - x3d = "model/x3d+xml", - x3db = "model/x3d+binary", - x3dbz = "model/x3d+binary", - x3dv = "model/x3d+vrml", - x3dvz = "model/x3d+vrml", - x3dz = "model/x3d+xml", - xaml = "application/xaml+xml", - xap = "application/silverlight-app", - xar = "application/xara", - xbap = "application/ms-xbap", - xbd = "application/fujixerox.docuworks.binder", - xbm = "image/xbitmap", - xdf = "application/xcap-diff+xml", - xdm = "application/syncml.dm+xml", - xdp = "application/adobe.xdp+xml", - xdssc = "application/dssc+xml", - xdw = "application/fujixerox.docuworks", - xenc = "application/xenc+xml", - xer = "application/patch-ops-error+xml", - xfdf = "application/adobe.xfdf", - xfdl = "application/xfdl", - xht = "application/xhtml+xml", - xhtml = "application/xhtml+xml", - xhvml = "application/xv+xml", - xif = "image/xiff", - xla = "application/ms-excel", - xlam = "application/ms-excel.addin.macroenabled.12", - xlc = "application/ms-excel", - xlf = "application/xliff+xml", - xlm = "application/ms-excel", - xls = "application/ms-excel", - xlsb = "application/ms-excel.sheet.binary.macroenabled.12", - xlsm = "application/ms-excel.sheet.macroenabled.12", - xlsx = "application/openxmlformats-officedocument.spreadsheetml.sheet", - xlt = "application/ms-excel", - xltm = "application/ms-excel.template.macroenabled.12", - xltx = "application/openxmlformats-officedocument.spreadsheetml.template", - xlw = "application/ms-excel", - xm = "audio/xm", - xml = "application/xml", - xo = "application/olpc-sugar", - xop = "application/xop+xml", - xpak = "application/gentoo.xpak", - xpi = "application/xpinstall", - xpl = "application/xproc+xml", - xpm = "image/xpixmap", - xpr = "application/is-xpr", - xps = "application/ms-xpsdocument", - xpw = "application/intercon.formnet", - xpx = "application/intercon.formnet", - xsl = "application/xml", - xslt = "application/xslt+xml", - xsm = "application/syncml+xml", - xspf = "application/xspf+xml", - xul = "application/mozilla.xul+xml", - xvm = "application/xv+xml", - xvml = "application/xv+xml", - xwd = "image/xwindowdump", - xyz = "chemical/xyz", - xz = "application/xz", - yaml = "text/yaml", - yang = "application/yang", - yin = "application/yin+xml", - yml = "text/yaml", - z1 = "application/zmachine", - z2 = "application/zmachine", - z3 = "application/zmachine", - z4 = "application/zmachine", - z5 = "application/zmachine", - z6 = "application/zmachine", - z7 = "application/zmachine", - z8 = "application/zmachine", - zaz = "application/zzazz.deck+xml", - zip = "application/zip", - zir = "application/zul", - zirz = "application/zul", - zmm = "application/handheld-entertainment+xml", - zsh = "text/shellscript", - zst = "application/zstd", -} - -local options = ya.sync( - function(st) - return { - with_files = st.with_files, - with_exts = st.with_exts, - custom_only = st.custom_only, - fallback_file1 = st.fallback_file1, - } - end -) - -local M = {} - -function M:setup(opts) - opts = opts or {} - - self.with_files = opts.with_files - self.with_exts = opts.with_exts - self.custom_only = opts.custom_only - self.fallback_file1 = opts.fallback_file1 -end - -function M:fetch(job) - local opts = options() - local merged_files = opts.with_files or {} - local merged_exts = opts.with_exts or {} - - if not opts.custom_only then - merged_files = ya.dict_merge(FILES, merged_files) - merged_exts = ya.dict_merge(EXTS, merged_exts) - end - - return ya.co(function() - local updates, unknown = {}, {} - for _, file in ipairs(job.files) do - if file.cha.is_dummy then - coroutine.yield(file, { retry = true }) - goto continue - end - - local mime - if file.cha.len == 0 then - mime = "inode/empty" - else - mime = merged_files[(file.url.name or ""):lower()] - mime = mime or merged_exts[(file.url.ext or ""):lower()] - end - - if not mime and opts.fallback_file1 then - unknown[#unknown + 1] = file - elseif not mime then - mime = "application/octet-stream" - end - - if mime and coroutine.yield(file, { mime }) then - updates[file.url] = mime - end - ::continue:: - end - - if next(updates) then - ya.emit("update_mimes", { updates = updates }) - end - - if #unknown > 0 then - self.fallback_builtin(job, unknown) - end - end) -end - -function M.fallback_builtin(job, unknown) - local next = require("mime.local"):fetch(ya.dict_merge(job, { files = unknown })) - local file, result = next() - while file do - file, result = next(coroutine.yield(file, result)) - end -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mime-ext.yazi/main.lua b/yazi_1/.config/yazi/plugins/mime-ext.yazi/main.lua deleted file mode 100644 index abe183b..0000000 --- a/yazi_1/.config/yazi/plugins/mime-ext.yazi/main.lua +++ /dev/null @@ -1,1130 +0,0 @@ ---- @since 25.12.29 - -local FILES = { - [".envrc"] = "text/plain", - [".gitconfig"] = "text/plain", - [".gitignore"] = "text/plain", - [".luacheckrc"] = "text/lua", - [".npmrc"] = "text/plain", - [".styluaignore"] = "text/plain", - [".zshenv"] = "text/plain", - [".zshrc"] = "text/plain", - ["cargo.lock"] = "application/json", - ["flake.lock"] = "application/json", - license = "text/plain", - config = "text/plain", -} - -local EXTS = { - ["123"] = "application/lotus-1-2-3", - ["3dml"] = "text/in3d.3dml", - ["3ds"] = "image/3ds", - ["3g2"] = "video/3gpp2", - ["3gp"] = "video/3gpp", - ["7z"] = "application/7z-compressed", - ["for"] = "text/fortran", - ["in"] = "text/plain", - ["n-gage"] = "application/nokia.n-gage.symbian.install", - ["sfd-hdstx"] = "application/hydrostatix.sof-data", - aab = "application/authorware-bin", - aac = "audio/aac", - aam = "application/authorware-map", - aas = "application/authorware-seg", - abw = "application/abiword", - ac = "application/pkix-attr-cert", - acc = "application/americandynamics.acc", - ace = "application/ace-compressed", - acu = "application/acucobol", - acutc = "application/acucorp", - adp = "audio/adpcm", - aep = "application/audiograph", - afm = "application/font-type1", - afp = "application/ibm.modcap", - ahead = "application/ahead.space", - ai = "application/postscript", - aif = "audio/aiff", - aifc = "audio/aiff", - aiff = "audio/aiff", - air = "application/adobe.air-application-installer-package+zip", - ait = "application/dvb.ait", - ami = "application/amiga.ami", - apk = "application/android.package-archive", - appcache = "text/cache-manifest", - application = "application/ms-application", - apr = "application/lotus-approach", - arc = "application/freearc", - asc = "application/pgp-signature", - asf = "video/ms-asf", - asm = "text/asm", - aso = "application/accpac.simply.aso", - ass = "text/ass", - asx = "video/ms-asf", - atc = "application/acucorp", - atom = "application/atom+xml", - atomcat = "application/atomcat+xml", - atomsvc = "application/atomsvc+xml", - atx = "application/antix.game-component", - au = "audio/basic", - avi = "video/msvideo", - avif = "image/avif", - aw = "application/applixware", - azf = "application/airzip.filesecure.azf", - azs = "application/airzip.filesecure.azs", - azw = "application/amazon.ebook", - bash = "text/shellscript", - bat = "application/msdownload", - bcpio = "application/bcpio", - bdf = "application/font-bdf", - bdm = "application/syncml.dm+wbxml", - bean = "text/plain", - beancount = "text/plain", - bed = "application/realvnc.bed", - bh2 = "application/fujitsu.oasysprs", - bin = "application/octet-stream", - blb = "application/blorb", - blorb = "application/blorb", - bmi = "application/bmi", - bmp = "image/bmp", - book = "application/framemaker", - box = "application/previewsystems.box", - boz = "application/bzip2", - bpk = "application/octet-stream", - btif = "image/prs.btif", - bz = "application/bzip", - bz2 = "application/bzip2", - c = "text/c", - c11amc = "application/cluetrust.cartomobile-config", - c11amz = "application/cluetrust.cartomobile-config-pkg", - c4d = "application/clonk.c4group", - c4f = "application/clonk.c4group", - c4g = "application/clonk.c4group", - c4p = "application/clonk.c4group", - c4u = "application/clonk.c4group", - cab = "application/ms-cab-compressed", - caf = "audio/caf", - cap = "application/tcpdump.pcap", - car = "application/curl.car", - cat = "application/ms-pki.seccat", - cb7 = "application/cbr", - cba = "application/cbr", - cbr = "application/cbr", - cbt = "application/cbr", - cbz = "application/cbr", - cc = "text/c", - cct = "application/director", - ccxml = "application/ccxml+xml", - cdbcmsg = "application/contact.cmsg", - cdf = "application/netcdf", - cdkey = "application/mediastation.cdkey", - cdmia = "application/cdmi-capability", - cdmic = "application/cdmi-container", - cdmid = "application/cdmi-domain", - cdmio = "application/cdmi-object", - cdmiq = "application/cdmi-queue", - cdx = "chemical/cdx", - cdxml = "application/chemdraw+xml", - cdy = "application/cinderella", - cer = "application/pkix-cert", - cfg = "text/plain", - cfs = "application/cfs-compressed", - cgm = "image/cgm", - chat = "application/chat", - chm = "application/ms-htmlhelp", - chrt = "application/kde.kchart", - cif = "chemical/cif", - cii = "application/anser-web-certificate-issue-initiation", - cil = "application/ms-artgalry", - cla = "application/claymore", - class = "application/java-vm", - clkk = "application/crick.clicker.keyboard", - clkp = "application/crick.clicker.palette", - clkt = "application/crick.clicker.template", - clkw = "application/crick.clicker.wordbank", - clkx = "application/crick.clicker", - clp = "application/msclip", - cmc = "application/cosmocaller", - cmdf = "chemical/cmdf", - cml = "chemical/cml", - cmp = "application/yellowriver-custom-menu", - cmx = "image/cmx", - cod = "application/rim.cod", - com = "application/msdownload", - conf = "text/plain", - config = "text/plain", - cpio = "application/cpio", - cpp = "text/c", - cpt = "application/mac-compactpro", - crd = "application/mscardfile", - crl = "application/pkix-crl", - crt = "application/x509-ca-cert", - cryptonote = "application/rig.cryptonote", - csh = "application/csh", - csml = "chemical/csml", - csp = "application/commonspace", - css = "text/css", - cst = "application/director", - csv = "text/csv", - cu = "application/cu-seeme", - curl = "text/curl", - cww = "application/prs.cww", - cxt = "application/director", - cxx = "text/c", - dae = "model/collada+xml", - daf = "application/mobius.daf", - dart = "application/dart", - dataless = "application/fdsn.seed", - davmount = "application/davmount+xml", - dbk = "application/docbook+xml", - dcr = "application/director", - dcurl = "text/curl.dcurl", - dd2 = "application/oma.dd2+xml", - ddd = "application/fujixerox.ddd", - deb = "application/debian-package", - def = "text/plain", - deploy = "application/octet-stream", - der = "application/x509-ca-cert", - dfac = "application/dreamfactory", - dgc = "application/dgc-compressed", - dic = "text/c", - dir = "application/director", - dis = "application/mobius.dis", - dist = "application/octet-stream", - distz = "application/octet-stream", - djv = "image/djvu", - djvu = "image/djvu", - dll = "application/msdownload", - dmg = "application/apple-diskimage", - dmp = "application/tcpdump.pcap", - dms = "application/octet-stream", - dna = "application/dna", - doc = "application/msword", - docm = "application/ms-word.document.macroenabled.12", - docx = "application/openxmlformats-officedocument.wordprocessingml.document", - dot = "application/msword", - dotm = "application/ms-word.template.macroenabled.12", - dotx = "application/openxmlformats-officedocument.wordprocessingml.template", - dp = "application/osgi.dp", - dpg = "application/dpgraph", - dra = "audio/dra", - dsc = "text/prs.lines.tag", - dssc = "application/dssc+der", - dtb = "application/dtbook+xml", - dtd = "application/xml-dtd", - dts = "audio/dts", - dtshd = "audio/dts.hd", - dump = "application/octet-stream", - dvb = "video/dvb.file", - dvi = "application/dvi", - dwf = "model/dwf", - dwg = "image/dwg", - dxf = "image/dxf", - dxp = "application/spotfire.dxp", - dxr = "application/director", - ebuild = "application/gentoo.ebuild", - ecelp4800 = "audio/nuera.ecelp4800", - ecelp7470 = "audio/nuera.ecelp7470", - ecelp9600 = "audio/nuera.ecelp9600", - eclass = "application/gentoo.eclass", - ecma = "application/ecmascript", - edm = "application/novadigm.edm", - edx = "application/novadigm.edx", - efif = "application/picsel", - ei6 = "application/pg.osasli", - elc = "application/octet-stream", - emf = "application/msmetafile", - eml = "message/rfc822", - emma = "application/emma+xml", - emz = "application/msmetafile", - env = "text/plain", - eol = "audio/digital-winds", - eot = "application/ms-fontobject", - eps = "application/postscript", - epub = "application/epub+zip", - es3 = "application/eszigno3+xml", - esa = "application/osgi.subsystem", - esf = "application/epson.esf", - et3 = "application/eszigno3+xml", - etx = "text/setext", - eva = "application/eva", - evy = "application/envoy", - exe = "application/msdownload", - exi = "application/exi", - ext = "application/novadigm.ext", - ez = "application/andrew-inset", - ez2 = "application/ezpix-album", - ez3 = "application/ezpix-package", - f = "text/fortran", - f4v = "video/f4v", - f77 = "text/fortran", - f90 = "text/fortran", - fbs = "image/fastbidsheet", - fcdt = "application/adobe.formscentral.fcdt", - fcs = "application/isac.fcs", - fdf = "application/fdf", - fe_launch = "application/denovo.fcselayout-link", - fg5 = "application/fujitsu.oasysgp", - fgd = "application/director", - fh = "image/freehand", - fh4 = "image/freehand", - fh5 = "image/freehand", - fh7 = "image/freehand", - fhc = "image/freehand", - fig = "application/xfig", - fish = "text/shellscript", - flac = "audio/flac", - fli = "video/fli", - flo = "application/micrografx.flo", - flv = "video/flv", - flw = "application/kde.kivio", - flx = "text/fmi.flexstor", - fly = "text/fly", - fm = "application/framemaker", - fnc = "application/frogans.fnc", - fpx = "image/fpx", - frame = "application/framemaker", - fsc = "application/fsc.weblaunch", - fst = "image/fst", - ftc = "application/fluxtime.clip", - fti = "application/anser-web-funds-transfer-initiation", - fvt = "video/fvt", - fxp = "application/adobe.fxp", - fxpl = "application/adobe.fxp", - fzs = "application/fuzzysheet", - g2w = "application/geoplan", - g3 = "image/g3fax", - g3w = "application/geospace", - gac = "application/groove-account", - gam = "application/tads", - gbr = "application/rpki-ghostbusters", - gca = "application/gca-compressed", - gdl = "model/gdl", - geo = "application/dynageo", - gex = "application/geometry-explorer", - ggb = "application/geogebra.file", - ggs = "application/geogebra.slides", - ggt = "application/geogebra.tool", - ghf = "application/groove-help", - gif = "image/gif", - gim = "application/groove-identity-message", - gml = "application/gml+xml", - gmx = "application/gmx", - gnumeric = "application/gnumeric", - go = "text/go", - gph = "application/flographit", - gpx = "application/gpx+xml", - gqf = "application/grafeq", - gqs = "application/grafeq", - gram = "application/srgs", - gramps = "application/gramps-xml", - gre = "application/geometry-explorer", - grv = "application/groove-injector", - grxml = "application/srgs+xml", - gsf = "application/font-ghostscript", - gtar = "application/gtar", - gtm = "application/groove-tool-message", - gtw = "model/gtw", - gv = "text/graphviz", - gxf = "application/gxf", - gxt = "application/geonext", - h = "text/c", - h261 = "video/h261", - h263 = "video/h263", - h264 = "video/h264", - hal = "application/hal+xml", - hbci = "application/hbci", - hcl = "text/hcl", - hdf = "application/hdf", - hh = "text/c", - hlp = "application/winhlp", - hpgl = "application/hp-hpgl", - hpid = "application/hp-hpid", - hpp = "text/c", - hps = "application/hp-hps", - hqx = "application/mac-binhex40", - htke = "application/kenameaapp", - htm = "text/html", - html = "text/html", - hvd = "application/yamaha.hv-dic", - hvp = "application/yamaha.hv-voice", - hvs = "application/yamaha.hv-script", - i2g = "application/intergeo", - icc = "application/iccprofile", - ice = "conference/cooltalk", - icm = "application/iccprofile", - ico = "image/icon", - ics = "text/calendar", - ief = "image/ief", - ifb = "text/calendar", - ifm = "application/shana.informed.formdata", - iges = "model/iges", - igl = "application/igloader", - igm = "application/insors.igm", - igs = "model/iges", - igx = "application/micrografx.igx", - iif = "application/shana.informed.interchange", - imp = "application/accpac.simply.imp", - ims = "application/ms-ims", - ini = "text/plain", - ink = "application/inkml+xml", - inkml = "application/inkml+xml", - install = "application/install-instructions", - iota = "application/astraea-software.iota", - ipfix = "application/ipfix", - ipk = "application/shana.informed.package", - irm = "application/ibm.rights-management", - irp = "application/irepository.package+xml", - iso = "application/iso9660-image", - itp = "application/shana.informed.formtemplate", - ivp = "application/immervision-ivp", - ivu = "application/immervision-ivu", - jad = "text/sun.j2me.app-descriptor", - jam = "application/jam", - jar = "application/java-archive", - java = "text/java-source", - jisp = "application/jisp", - jlt = "application/hp-jlyt", - jnlp = "application/java-jnlp-file", - joda = "application/joost.joda-archive", - jpe = "image/jpeg", - jpeg = "image/jpeg", - jpg = "image/jpeg", - jpgm = "video/jpm", - jpgv = "video/jpeg", - jpm = "video/jpm", - js = "text/javascript", - json = "application/json", - jsonc = "application/json", - jsonml = "application/jsonml+json", - jsx = "text/jsx", - jxl = "image/jxl", - kar = "audio/midi", - karbon = "application/kde.karbon", - kdl = "text/kdl", - kfo = "application/kde.kformula", - kia = "application/kidspiration", - kml = "application/google-earth.kml+xml", - kmz = "application/google-earth.kmz", - kne = "application/kinar", - knp = "application/kinar", - kon = "application/kde.kontour", - kpr = "application/kde.kpresenter", - kpt = "application/kde.kpresenter", - kpxx = "application/ds-keypoint", - ksp = "application/kde.kspread", - ktr = "application/kahootz", - ktx = "image/ktx", - ktz = "application/kahootz", - kwd = "application/kde.kword", - kwt = "application/kde.kword", - lasxml = "application/las.las+xml", - latex = "application/latex", - lbd = "application/llamagraphics.life-balance.desktop", - lbe = "application/llamagraphics.life-balance.exchange+xml", - les = "application/hhe.lesson-player", - lha = "application/lzh-compressed", - link66 = "application/route66.link66+xml", - list = "text/plain", - list3820 = "application/ibm.modcap", - listafp = "application/ibm.modcap", - lnk = "application/ms-shortcut", - log = "text/plain", - lostxml = "application/lost+xml", - lrf = "application/octet-stream", - lrm = "application/ms-lrm", - ltf = "application/frogans.ltf", - lua = "text/lua", - lvp = "audio/lucent.voice", - lwp = "application/lotus-wordpro", - lzh = "application/lzh-compressed", - m13 = "application/msmediaview", - m14 = "application/msmediaview", - m1v = "video/mpeg", - m21 = "application/mp21", - m2a = "audio/mpeg", - m2t = "video/mp2t", - m2ts = "video/mp2t", - m2v = "video/mpeg", - m3a = "audio/mpeg", - m3u = "audio/mpegurl", - m3u8 = "application/apple.mpegurl", - m4a = "audio/mp4", - m4u = "video/mpegurl", - m4v = "video/m4v", - ma = "application/mathematica", - mads = "application/mads+xml", - mag = "application/ecowin.chart", - maker = "application/framemaker", - man = "text/troff", - mar = "application/octet-stream", - mathml = "application/mathml+xml", - mb = "application/mathematica", - mbk = "application/mobius.mbk", - mbox = "application/mbox", - mc1 = "application/medcalcdata", - mcd = "application/mcd", - mcurl = "text/curl.mcurl", - md = "text/markdown", - mdb = "application/msaccess", - mdi = "image/ms-modi", - me = "text/troff", - mesh = "model/mesh", - meta4 = "application/metalink4+xml", - metalink = "application/metalink+xml", - mets = "application/mets+xml", - mfm = "application/mfmp", - mft = "application/rpki-manifest", - mgp = "application/osgeo.mapguide.package", - mgz = "application/proteus.magazine", - mid = "audio/midi", - midi = "audio/midi", - mie = "application/mie", - mif = "application/mif", - mime = "message/rfc822", - mj2 = "video/mj2", - mjp2 = "video/mj2", - mjs = "text/javascript", - mk3d = "video/matroska", - mka = "audio/matroska", - mks = "video/matroska", - mkv = "video/matroska", - mlp = "application/dolby.mlp", - mmd = "application/chipnuts.karaoke-mmd", - mmf = "application/smaf", - mmr = "image/fujixerox.edmics-mmr", - mng = "video/mng", - mny = "application/msmoney", - mobi = "application/mobipocket-ebook", - mods = "application/mods+xml", - mov = "video/quicktime", - movie = "video/sgi-movie", - mp2 = "audio/mpeg", - mp21 = "application/mp21", - mp2a = "audio/mpeg", - mp3 = "audio/mpeg", - mp4 = "video/mp4", - mp4a = "audio/mp4", - mp4s = "application/mp4", - mp4v = "video/mp4", - mpc = "application/mophun.certificate", - mpe = "video/mpeg", - mpeg = "video/mpeg", - mpg = "video/mpeg", - mpg4 = "video/mp4", - mpga = "audio/mpeg", - mpkg = "application/apple.installer+xml", - mpm = "application/blueice.multipass", - mpn = "application/mophun.application", - mpp = "application/ms-project", - mpt = "application/ms-project", - mpy = "application/ibm.minipay", - mqy = "application/mobius.mqy", - mrc = "application/marc", - mrcx = "application/marcxml+xml", - ms = "text/troff", - mscml = "application/mediaservercontrol+xml", - mseed = "application/fdsn.mseed", - mseq = "application/mseq", - msf = "application/epson.msf", - msh = "model/mesh", - msi = "application/msdownload", - msl = "application/mobius.msl", - msty = "application/muvee.style", - mts = "video/mp2t", - mus = "application/musician", - musicxml = "application/recordare.musicxml+xml", - mvb = "application/msmediaview", - mwf = "application/mfer", - mxf = "application/mxf", - mxl = "application/recordare.musicxml", - mxml = "application/xv+xml", - mxs = "application/triscape.mxs", - mxu = "video/mpegurl", - n3 = "text/n3", - nb = "application/mathematica", - nbp = "application/wolfram.player", - nc = "application/netcdf", - ncx = "application/dtbncx+xml", - nfo = "text/nfo", - ngdat = "application/nokia.n-gage.data", - nitf = "application/nitf", - nix = "text/nix", - nlu = "application/neurolanguage.nlu", - nml = "application/enliven", - nnd = "application/noblenet-directory", - nns = "application/noblenet-sealer", - nnw = "application/noblenet-web", - npx = "image/net-fpx", - nsc = "application/conference", - nsf = "application/lotus-notes", - ntf = "application/nitf", - nu = "text/nu", - nzb = "application/nzb", - oa2 = "application/fujitsu.oasys2", - oa3 = "application/fujitsu.oasys3", - oas = "application/fujitsu.oasys", - obd = "application/msbinder", - obj = "application/tgif", - oda = "application/oda", - odb = "application/oasis.opendocument.database", - odc = "application/oasis.opendocument.chart", - odf = "application/oasis.opendocument.formula", - odft = "application/oasis.opendocument.formula-template", - odg = "application/oasis.opendocument.graphics", - odi = "application/oasis.opendocument.image", - odm = "application/oasis.opendocument.text-master", - odp = "application/oasis.opendocument.presentation", - ods = "application/oasis.opendocument.spreadsheet", - odt = "application/oasis.opendocument.text", - oga = "audio/ogg", - ogg = "audio/ogg", - ogv = "video/ogg", - ogx = "application/ogg", - omdoc = "application/omdoc+xml", - onepkg = "application/onenote", - onetmp = "application/onenote", - onetoc = "application/onenote", - onetoc2 = "application/onenote", - opf = "application/oebps-package+xml", - opml = "text/opml", - oprc = "application/palm", - opus = "audio/ogg", - org = "application/lotus-organizer", - osf = "application/yamaha.openscoreformat", - osfpvg = "application/yamaha.openscoreformat.osfpvg+xml", - otc = "application/oasis.opendocument.chart-template", - otf = "font/otf", - otg = "application/oasis.opendocument.graphics-template", - oth = "application/oasis.opendocument.text-web", - oti = "application/oasis.opendocument.image-template", - otp = "application/oasis.opendocument.presentation-template", - ots = "application/oasis.opendocument.spreadsheet-template", - ott = "application/oasis.opendocument.text-template", - oxps = "application/oxps", - oxt = "application/openofficeorg.extension", - p = "text/pascal", - p10 = "application/pkcs10", - p12 = "application/pkcs12", - p7b = "application/pkcs7-certificates", - p7c = "application/pkcs7-mime", - p7m = "application/pkcs7-mime", - p7r = "application/pkcs7-certreqresp", - p7s = "application/pkcs7-signature", - p8 = "application/pkcs8", - pas = "text/pascal", - patch = "text/diff", - paw = "application/pawaafile", - pbd = "application/powerbuilder6", - pbm = "image/portable-bitmap", - pcap = "application/tcpdump.pcap", - pcf = "application/font-pcf", - pcl = "application/hp-pcl", - pclxl = "application/hp-pclxl", - pct = "image/pict", - pcurl = "application/curl.pcurl", - pcx = "image/pcx", - pdb = "application/palm", - pdf = "application/pdf", - pfa = "application/font-type1", - pfb = "application/font-type1", - pfm = "application/font-type1", - pfr = "application/font-tdpfr", - pfx = "application/pkcs12", - pgm = "image/portable-graymap", - pgn = "application/chess-pgn", - pgp = "application/pgp-encrypted", - php = "text/php", - pic = "image/pict", - pkg = "application/octet-stream", - pki = "application/pkixcmp", - pkipath = "application/pkix-pkipath", - plb = "application/3gpp.pic-bw-large", - plc = "application/mobius.plc", - plf = "application/pocketlearn", - pls = "application/pls+xml", - pml = "application/ctc-posml", - png = "image/png", - pnm = "image/portable-anymap", - portpkg = "application/macports.portpkg", - pot = "application/ms-powerpoint", - potm = "application/ms-powerpoint.template.macroenabled.12", - potx = "application/openxmlformats-officedocument.presentationml.template", - ppam = "application/ms-powerpoint.addin.macroenabled.12", - ppd = "application/cups-ppd", - ppm = "image/portable-pixmap", - pps = "application/ms-powerpoint", - ppsm = "application/ms-powerpoint.slideshow.macroenabled.12", - ppsx = "application/openxmlformats-officedocument.presentationml.slideshow", - ppt = "application/ms-powerpoint", - pptm = "application/ms-powerpoint.presentation.macroenabled.12", - pptx = "application/openxmlformats-officedocument.presentationml.presentation", - pqa = "application/palm", - prc = "application/mobipocket-ebook", - pre = "application/lotus-freelance", - prf = "application/pics-rules", - ps = "application/postscript", - psb = "application/3gpp.pic-bw-small", - psd = "image/adobe.photoshop", - psf = "application/font-linux-psf", - pskcxml = "application/pskc+xml", - ptid = "application/pvi.ptid1", - pub = "application/mspublisher", - pvb = "application/3gpp.pic-bw-var", - pwn = "application/3m.post-it-notes", - py = "text/python", - pya = "audio/ms-playready.media.pya", - pyv = "video/ms-playready.media.pyv", - qam = "application/epson.quickanime", - qbo = "application/intu.qbo", - qfx = "application/intu.qfx", - qml = "text/qml", - qps = "application/publishare-delta-tree", - qt = "video/quicktime", - qwd = "application/quark.quarkxpress", - qwt = "application/quark.quarkxpress", - qxb = "application/quark.quarkxpress", - qxd = "application/quark.quarkxpress", - qxl = "application/quark.quarkxpress", - qxt = "application/quark.quarkxpress", - r = "text/r", - ra = "audio/pn-realaudio", - ram = "audio/pn-realaudio", - rar = "application/rar", - ras = "image/cmu-raster", - rb = "text/nu", - rcprofile = "application/ipunplugged.rcprofile", - rdf = "application/rdf+xml", - rdz = "application/data-vision.rdz", - rep = "application/businessobjects", - res = "application/dtbresource+xml", - rgb = "image/rgb", - rif = "application/reginfo+xml", - rip = "audio/rip", - ris = "application/research-info-systems", - rl = "application/resource-lists+xml", - rlc = "image/fujixerox.edmics-rlc", - rld = "application/resource-lists-diff+xml", - rm = "application/rn-realmedia", - rmi = "audio/midi", - rmp = "audio/pn-realaudio-plugin", - rms = "application/jcp.javame.midlet-rms", - rmvb = "application/rn-realmedia-vbr", - rnc = "application/relax-ng-compact-syntax", - roa = "application/rpki-roa", - roff = "text/troff", - rp9 = "application/cloanto.rp9", - rpm = "application/rpm", - rpss = "application/nokia.radio-presets", - rpst = "application/nokia.radio-preset", - rq = "application/sparql-query", - rs = "text/rust", - rsd = "application/rsd+xml", - rss = "application/rss+xml", - rtf = "application/rtf", - rtx = "text/richtext", - s = "text/asm", - s3m = "audio/s3m", - saf = "application/yamaha.smaf-audio", - sbml = "application/sbml+xml", - sc = "application/ibm.secure-container", - scd = "application/msschedule", - scm = "application/lotus-screencam", - scq = "application/scvp-cv-request", - scs = "application/scvp-cv-response", - scss = "text/scss", - scurl = "text/curl.scurl", - sda = "application/stardivision.draw", - sdc = "application/stardivision.calc", - sdd = "application/stardivision.impress", - sdkd = "application/solent.sdkm+xml", - sdkm = "application/solent.sdkm+xml", - sdp = "application/sdp", - sdw = "application/stardivision.writer", - see = "application/seemail", - seed = "application/fdsn.seed", - sema = "application/sema", - semd = "application/semd", - semf = "application/semf", - ser = "application/java-serialized-object", - setpay = "application/set-payment-initiation", - setreg = "application/set-registration-initiation", - sfs = "application/spotfire.sfs", - sfv = "text/sfv", - sgi = "image/sgi", - sgl = "application/stardivision.writer-global", - sgm = "text/sgml", - sgml = "text/sgml", - sh = "text/shellscript", - shar = "application/shar", - shf = "application/shf+xml", - sid = "image/mrsid-image", - sig = "application/pgp-signature", - sil = "audio/silk", - silo = "model/mesh", - sis = "application/symbian.install", - sisx = "application/symbian.install", - sit = "application/stuffit", - sitx = "application/stuffitx", - skd = "application/koan", - skm = "application/koan", - skp = "application/koan", - skt = "application/koan", - sldm = "application/ms-powerpoint.slide.macroenabled.12", - sldx = "application/openxmlformats-officedocument.presentationml.slide", - slt = "application/epson.salt", - sm = "application/stepmania.stepchart", - smf = "application/stardivision.math", - smi = "application/smil+xml", - smil = "application/smil+xml", - smv = "video/smv", - smzip = "application/stepmania.package", - snd = "audio/basic", - snf = "application/font-snf", - so = "application/octet-stream", - spc = "application/pkcs7-certificates", - spf = "application/yamaha.smaf-phrase", - spl = "application/futuresplash", - spot = "text/in3d.spot", - spp = "application/scvp-vp-response", - spq = "application/scvp-vp-request", - spx = "audio/ogg", - sql = "application/sql", - src = "application/wais-source", - srt = "application/subrip", - sru = "application/sru+xml", - srx = "application/sparql-results+xml", - ssdl = "application/ssdl+xml", - sse = "application/kodak-descriptor", - ssf = "application/epson.ssf", - ssml = "application/ssml+xml", - st = "application/sailingtracker.track", - stc = "application/sun.xml.calc.template", - std = "application/sun.xml.draw.template", - stf = "application/wt.stf", - sti = "application/sun.xml.impress.template", - stk = "application/hyperstudio", - stl = "application/ms-pki.stl", - str = "application/pg.format", - stw = "application/sun.xml.writer.template", - sub = "text/dvb.subtitle", - sus = "application/sus-calendar", - susp = "application/sus-calendar", - sv4cpio = "application/sv4cpio", - sv4crc = "application/sv4crc", - svc = "application/dvb.service", - svd = "application/svd", - svg = "image/svg+xml", - svgz = "image/svg+xml", - swa = "application/director", - swf = "application/shockwave-flash", - swi = "application/aristanetworks.swi", - sxc = "application/sun.xml.calc", - sxd = "application/sun.xml.draw", - sxg = "application/sun.xml.writer.global", - sxi = "application/sun.xml.impress", - sxm = "application/sun.xml.math", - sxw = "application/sun.xml.writer", - t = "text/troff", - t3 = "application/t3vm-image", - taglet = "application/mynfc", - tao = "application/tao.intent-module-archive", - tar = "application/tar", - tcap = "application/3gpp2.tcap", - tcl = "application/tcl", - teacher = "application/smart.teacher", - tei = "application/tei+xml", - teicorpus = "application/tei+xml", - tex = "application/tex", - texi = "application/texinfo", - texinfo = "application/texinfo", - text = "text/plain", - tf = "text/hcl", - tfi = "application/thraud+xml", - tfm = "application/tex-tfm", - tfrc = "text/hcl", - tfstate = "application/json", - tfvars = "text/hcl", - tga = "image/tga", - theme = "application/plain", - thmx = "application/ms-officetheme", - tif = "image/tiff", - tiff = "image/tiff", - tmo = "application/tmobile-livetv", - tmTheme = "text/plain", - toml = "text/toml", - torrent = "application/bittorrent", - tpl = "application/groove-tool-template", - tpt = "application/trid.tpt", - tr = "text/troff", - tra = "application/trueapp", - trm = "application/msterminal", - ts = "text/typescript", - tsd = "application/timestamped-data", - tsv = "text/tab-separated-values", - tsx = "text/tsx", - ttc = "font/collection", - ttf = "font/ttf", - ttl = "text/turtle", - twd = "application/simtech-mindmapper", - twds = "application/simtech-mindmapper", - txd = "application/genomatix.tuxedo", - txf = "application/mobius.txf", - txt = "text/plain", - u32 = "application/authorware-bin", - udeb = "application/debian-package", - ufd = "application/ufdl", - ufdl = "application/ufdl", - ulx = "application/glulx", - umj = "application/umajin", - unityweb = "application/unity", - uoml = "application/uoml+xml", - uri = "text/uri-list", - uris = "text/uri-list", - urls = "text/uri-list", - ustar = "application/ustar", - utz = "application/uiq.theme", - uu = "text/uuencode", - uva = "audio/dece.audio", - uvd = "application/dece.data", - uvf = "application/dece.data", - uvg = "image/dece.graphic", - uvh = "video/dece.hd", - uvi = "image/dece.graphic", - uvm = "video/dece.mobile", - uvp = "video/dece.pd", - uvs = "video/dece.sd", - uvt = "application/dece.ttml+xml", - uvu = "video/uvvu.mp4", - uvv = "video/dece.video", - uvva = "audio/dece.audio", - uvvd = "application/dece.data", - uvvf = "application/dece.data", - uvvg = "image/dece.graphic", - uvvh = "video/dece.hd", - uvvi = "image/dece.graphic", - uvvm = "video/dece.mobile", - uvvp = "video/dece.pd", - uvvs = "video/dece.sd", - uvvt = "application/dece.ttml+xml", - uvvu = "video/uvvu.mp4", - uvvv = "video/dece.video", - uvvx = "application/dece.unspecified", - uvvz = "application/dece.zip", - uvx = "application/dece.unspecified", - uvz = "application/dece.zip", - vcard = "text/vcard", - vcd = "application/cdlink", - vcf = "text/vcard", - vcg = "application/groove-vcard", - vcs = "text/vcalendar", - vcx = "application/vcx", - vis = "application/visionary", - viv = "video/vivo", - vob = "video/ms-vob", - vor = "application/stardivision.writer", - vox = "application/authorware-bin", - vrml = "model/vrml", - vsd = "application/visio", - vsf = "application/vsf", - vss = "application/visio", - vst = "application/visio", - vsw = "application/visio", - vtu = "model/vtu", - vxml = "application/voicexml+xml", - w3d = "application/director", - wad = "application/doom", - wasm = "application/wasm", - wav = "audio/wav", - wax = "audio/ms-wax", - wbmp = "image/wap.wbmp", - wbs = "application/criticaltools.wbs+xml", - wbxml = "application/wap.wbxml", - wcm = "application/ms-works", - wdb = "application/ms-works", - wdp = "image/ms-photo", - weba = "audio/webm", - webm = "video/webm", - webp = "image/webp", - wg = "application/pmi.widget", - wgt = "application/widget", - wks = "application/ms-works", - wm = "video/ms-wm", - wma = "audio/ms-wma", - wmd = "application/ms-wmd", - wmf = "application/msmetafile", - wml = "text/wap.wml", - wmlc = "application/wap.wmlc", - wmls = "text/wap.wmlscript", - wmlsc = "application/wap.wmlscriptc", - wmv = "video/ms-wmv", - wmx = "video/ms-wmx", - wmz = "application/ms-wmz", - woff = "font/woff", - woff2 = "font/woff2", - wpd = "application/wordperfect", - wpl = "application/ms-wpl", - wps = "application/ms-works", - wqd = "application/wqd", - wri = "application/mswrite", - wrl = "model/vrml", - wsdl = "application/wsdl+xml", - wspolicy = "application/wspolicy+xml", - wtb = "application/webturbo", - wvx = "video/ms-wvx", - x32 = "application/authorware-bin", - x3d = "model/x3d+xml", - x3db = "model/x3d+binary", - x3dbz = "model/x3d+binary", - x3dv = "model/x3d+vrml", - x3dvz = "model/x3d+vrml", - x3dz = "model/x3d+xml", - xaml = "application/xaml+xml", - xap = "application/silverlight-app", - xar = "application/xara", - xbap = "application/ms-xbap", - xbd = "application/fujixerox.docuworks.binder", - xbm = "image/xbitmap", - xdf = "application/xcap-diff+xml", - xdm = "application/syncml.dm+xml", - xdp = "application/adobe.xdp+xml", - xdssc = "application/dssc+xml", - xdw = "application/fujixerox.docuworks", - xenc = "application/xenc+xml", - xer = "application/patch-ops-error+xml", - xfdf = "application/adobe.xfdf", - xfdl = "application/xfdl", - xht = "application/xhtml+xml", - xhtml = "application/xhtml+xml", - xhvml = "application/xv+xml", - xif = "image/xiff", - xla = "application/ms-excel", - xlam = "application/ms-excel.addin.macroenabled.12", - xlc = "application/ms-excel", - xlf = "application/xliff+xml", - xlm = "application/ms-excel", - xls = "application/ms-excel", - xlsb = "application/ms-excel.sheet.binary.macroenabled.12", - xlsm = "application/ms-excel.sheet.macroenabled.12", - xlsx = "application/openxmlformats-officedocument.spreadsheetml.sheet", - xlt = "application/ms-excel", - xltm = "application/ms-excel.template.macroenabled.12", - xltx = "application/openxmlformats-officedocument.spreadsheetml.template", - xlw = "application/ms-excel", - xm = "audio/xm", - xml = "application/xml", - xo = "application/olpc-sugar", - xop = "application/xop+xml", - xpak = "application/gentoo.xpak", - xpi = "application/xpinstall", - xpl = "application/xproc+xml", - xpm = "image/xpixmap", - xpr = "application/is-xpr", - xps = "application/ms-xpsdocument", - xpw = "application/intercon.formnet", - xpx = "application/intercon.formnet", - xsl = "application/xml", - xslt = "application/xslt+xml", - xsm = "application/syncml+xml", - xspf = "application/xspf+xml", - xul = "application/mozilla.xul+xml", - xvm = "application/xv+xml", - xvml = "application/xv+xml", - xwd = "image/xwindowdump", - xyz = "chemical/xyz", - xz = "application/xz", - yaml = "text/yaml", - yang = "application/yang", - yin = "application/yin+xml", - yml = "text/yaml", - z1 = "application/zmachine", - z2 = "application/zmachine", - z3 = "application/zmachine", - z4 = "application/zmachine", - z5 = "application/zmachine", - z6 = "application/zmachine", - z7 = "application/zmachine", - z8 = "application/zmachine", - zaz = "application/zzazz.deck+xml", - zip = "application/zip", - zir = "application/zul", - zirz = "application/zul", - zmm = "application/handheld-entertainment+xml", - zsh = "text/shellscript", -} - -local options = ya.sync(function(st) - return { - with_files = st.with_files, - with_exts = st.with_exts, - fallback_file1 = st.fallback_file1, - } -end) - -local M = {} - -function M:setup(opts) - opts = opts or {} - - self.with_files = opts.with_files - self.with_exts = opts.with_exts - self.fallback_file1 = opts.fallback_file1 -end - -function M:fetch(job) - local opts = options() - local merged_files = ya.dict_merge(FILES, opts.with_files or {}) - local merged_exts = ya.dict_merge(EXTS, opts.with_exts or {}) - - local updates, unknown, state = {}, {}, {} - for i, file in ipairs(job.files) do - if file.cha.is_dummy then - state[i] = false - goto continue - end - - local mime - if file.cha.len == 0 then - mime = "inode/empty" - else - mime = merged_files[(file.url.name or ""):lower()] - mime = mime or merged_exts[(file.url.ext or ""):lower()] - end - - if mime then - updates[tostring(file.url)], state[i] = mime, true - elseif opts.fallback_file1 then - unknown[#unknown + 1] = file - else - updates[tostring(file.url)], state[i] = "application/octet-stream", true - end - ::continue:: - end - - if next(updates) then - ya.emit("update_mimes", { updates = updates }) - end - - if #unknown > 0 then - return self.fallback_builtin(job, unknown, state) - end - - return state -end - -function M.fallback_builtin(job, unknown, state) - local indices = {} - for i, f in ipairs(job.files) do - indices[f:hash()] = i - end - - local result = require("mime.local"):fetch(ya.dict_merge(job, { files = unknown })) - for i, f in ipairs(unknown) do - if type(result) == "table" then - state[indices[f:hash()]] = result[i] - else - state[indices[f:hash()]] = result - end - end - return state -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mime-ext.yazi/remote.lua b/yazi_1/.config/yazi/plugins/mime-ext.yazi/remote.lua deleted file mode 100644 index 7626434..0000000 --- a/yazi_1/.config/yazi/plugins/mime-ext.yazi/remote.lua +++ /dev/null @@ -1,53 +0,0 @@ ---- @since 26.8.15 -local M = {} - -local function stale_cache(file) - local url = file.url - local stamp = url.spec.stamp:join(url:hash(true)) - - local fd = fs.access():read(true):open(Url(stamp)) - if not fd then - return true - end - - local sig = fd:read(26) - ya.drop(fd) - return sig ~= file.cha:hash(true) -end - -function M:fetch(job) - return ya.co(function() - local updates, unknown = {}, {} - for _, file in ipairs(job.files) do - if file.cha.is_dummy then - coroutine.yield(file, {}) - elseif not file.cache then - unknown[#unknown + 1] = file - elseif not fs.cha(Url(file.cache)) then - updates[file.url] = coroutine.yield(file, { "vfs/absent" }) and "vfs/absent" or nil - elseif stale_cache(file) then - updates[file.url] = coroutine.yield(file, { "vfs/stale" }) and "vfs/stale" or nil - else - unknown[#unknown + 1] = file - end - end - - if next(updates) then - ya.emit("update_mimes", { updates = updates }) - end - - if #unknown > 0 then - self.fallback_local(job, unknown) - end - end) -end - -function M.fallback_local(job, unknown) - local next = require(".local"):fetch(ya.dict_merge(job, { files = unknown })) - local file, result = next() - while file do - file, result = next(coroutine.yield(file, result)) - end -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mount.yazi/LICENSE b/yazi_1/.config/yazi/plugins/mount.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/mount.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/mount.yazi/README.md b/yazi_1/.config/yazi/plugins/mount.yazi/README.md deleted file mode 100644 index 20a5615..0000000 --- a/yazi_1/.config/yazi/plugins/mount.yazi/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# mount.yazi - -A mount manager for Yazi, providing disk mount, unmount, and eject functionality. - -Supported platforms: - -- Linux with [`udisksctl`](https://github.com/storaged-project/udisks), `lsblk` and `eject` both provided by [`util-linux`](https://github.com/util-linux/util-linux) -- macOS with `diskutil`, which is pre-installed - -https://github.com/user-attachments/assets/c6f780ab-458b-420f-85cf-2fc45fcfe3a2 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:mount -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "M" -run = "plugin mount" -``` - -Note that, the keybindings above are just examples, please tune them up as needed to ensure they don't conflict with your other commands/plugins. - -## Actions - -| Key binding | Alternate key | Action | -| ------------ | ------------- | --------------------- | -| q | - | Quit the plugin | -| k | ↑ | Move up | -| j | ↓ | Move down | -| l | → | Enter the mount point | -| m | - | Mount the partition | -| u | - | Unmount the partition | -| e | - | Eject the disk | - -## TODO - -- Custom keybindings -- Windows support (I don't use Windows myself, PRs welcome!) -- Support mount, unmount, and eject the entire disk - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/mount.yazi/cross.lua b/yazi_1/.config/yazi/plugins/mount.yazi/cross.lua deleted file mode 100644 index 7d329eb..0000000 --- a/yazi_1/.config/yazi/plugins/mount.yazi/cross.lua +++ /dev/null @@ -1,148 +0,0 @@ -local M = {} - ---- @param type "mount"|"unmount"|"eject" ---- @param partition table -function M.operate(type, partition) - if not partition then - return - elseif not partition.sub then - return -- TODO: mount/unmount main disk - end - - local cmd, output, err - if ya.target_os() == "macos" then - cmd, output, err = "diskutil", M.diskutil(type, partition.src) - elseif ya.target_os() == "linux" then - if type == "eject" and partition.src:match("^/dev/sr%d+") then - M.udisksctl("unmount", partition.src) - cmd, output, err = "eject", M.eject(partition.src) - elseif type == "eject" then - M.udisksctl("unmount", partition.src) - cmd, output, err = "udisksctl", M.udisksctl("power-off", partition.src) - else - cmd, output, err = "udisksctl", M.udisksctl(type, partition.src) - end - end - - if not cmd then - M.fail("mount.yazi is not currently supported on your platform") - elseif not output then - M.fail("Failed to spawn `%s`: %s", cmd, err) - elseif not output.status.success then - M.fail("Failed to %s `%s`: %s", type, partition.src, output.stderr) - end -end - ---- @param type "mount"|"unmount"|"eject" ---- @param src string ---- @return Output? output ---- @return Error? err -function M.diskutil(type, src) return Command("diskutil"):arg({ type, src }):output() end - ---- @param type "mount"|"unmount"|"power-off" ---- @param src string ---- @return Output? output ---- @return Error? err -function M.udisksctl(type, src) - local args = { type, "-b", src, "--no-user-interaction" } - local output, err = Command("udisksctl"):arg(args):output() - - if not output or err then - return nil, err - elseif output.stderr:find("org.freedesktop.UDisks2.Error.NotAuthorizedCanObtain", 1, true) then - local tx, rx = table.unpack(require(".main").permit) - tx:send(true) - ya.emit("which:dismiss", {}) - output, err = M.udisks_dbus(type, src) - if not output then - output, err = M.udisksctl_interactive(type, src) - end - rx:recv() - return output, err - else - return output - end -end - ---- @param type "mount"|"unmount"|"power-off" ---- @param src string ---- @return Output? output ---- @return Error? err -function M.udisks_dbus(type, src) - local obj, err = M.gdbus_resolve( - "/org/freedesktop/UDisks2/Manager", - "org.freedesktop.UDisks2.Manager.ResolveDevice", - string.format("{'path': <%q>}", src), - "{}" - ) - if not obj then - return nil, err - end - - local method, options = "", "{}" - if type == "mount" then - local user = ya.user_name() - if not user then - return nil, Err("Cannot determine the current user") - end - method = "org.freedesktop.UDisks2.Filesystem.Mount" - options = string.format("{'as-user': <%q>}", user) - elseif type == "unmount" then - method = "org.freedesktop.UDisks2.Filesystem.Unmount" - elseif type == "power-off" then - obj, err = M.gdbus_resolve(obj, "org.freedesktop.UDisks2.Block.GetDrive") - if not obj then - return nil, err - end - method = "org.freedesktop.UDisks2.Drive.PowerOff" - else - return nil, Err("Unsupported UDisks operation: %s", type) - end - - return require(".sudo").run_with_sudo("gdbus", M.gdbus_args(obj, method, options)) -end - ---- @param type "mount"|"unmount"|"power-off" ---- @param src string ---- @return Output? output ---- @return Error? err -function M.udisksctl_interactive(type, src) - local permit = ui.hide() - local output, err = Command("udisksctl"):arg({ type, "-b", src }):stdin(Command.INHERIT):output() - permit:drop() - return output, err -end - ---- @param src string ---- @return Output? output ---- @return Error? err -function M.eject(src) return Command("eject"):arg({ "--traytoggle", src }):output() end - -function M.fail(...) ya.notify { title = "Mount", content = string.format(...), timeout = 10, level = "error" } end - ---- @param obj string ---- @param method string ---- @param ... string ---- @return string? obj ---- @return Error? err -function M.gdbus_resolve(obj, method, ...) - local output, err = Command("gdbus"):arg(M.gdbus_args(obj, method, ...)):output() - if not output or err then - return nil, err - elseif not output.status.success then - return nil, Err("%s", output.stderr) - else - local result = output.stdout:match("objectpath '([^']+)'") - return result, result and nil or Err("Unexpected `gdbus` response: %s", output.stdout) - end -end - ---- @param obj string ---- @param method string ---- @param ... string ---- @return string[] args -function M.gdbus_args(obj, method, ...) - return { "call", "--system", "--dest", "org.freedesktop.UDisks2", "--object-path", obj, "--method", method, ... } -end - -return M diff --git a/yazi_1/.config/yazi/plugins/mount.yazi/main.lua b/yazi_1/.config/yazi/plugins/mount.yazi/main.lua deleted file mode 100644 index 266d6c9..0000000 --- a/yazi_1/.config/yazi/plugins/mount.yazi/main.lua +++ /dev/null @@ -1,291 +0,0 @@ ---- @since 25.12.29 - -local toggle_ui = ya.sync(function(self) - if self.children then - Modal:children_remove(self.children) - self.children = nil - else - self.children = Modal:children_add(self, 10) - end - ui.render() -end) - -local subscribe = ya.sync(function(self) - ps.unsub("mount") - ps.sub("mount", function() ya.emit("plugin", { self._id, "refresh" }) end) -end) - -local update_partitions = ya.sync(function(self, partitions) - self.partitions = partitions - self.cursor = math.max(0, math.min(self.cursor or 0, #self.partitions - 1)) - ui.render() -end) - -local active_partition = ya.sync(function(self) return self.partitions[self.cursor + 1] end) - -local update_cursor = ya.sync(function(self, cursor) - if #self.partitions == 0 then - self.cursor = 0 - else - self.cursor = ya.clamp(0, self.cursor + cursor, #self.partitions - 1) - end - ui.render() -end) - -local M = { - keys = { - { on = "q", run = "quit" }, - { on = "", run = "quit" }, - { on = "", run = { "enter", "quit" } }, - - { on = "k", run = "up" }, - { on = "j", run = "down" }, - { on = "l", run = { "enter", "quit" } }, - - { on = "", run = "up" }, - { on = "", run = "down" }, - { on = "", run = { "enter", "quit" } }, - - { on = "m", run = "mount" }, - { on = "u", run = "unmount" }, - { on = "e", run = "eject" }, - }, -} - -function M:new(area) - self:layout(area) - return self -end - -function M:layout(area) - local chunks = ui.Layout() - :constraints({ - ui.Constraint.Percentage(10), - ui.Constraint.Percentage(80), - ui.Constraint.Percentage(10), - }) - :split(area) - - local chunks = ui.Layout() - :direction(ui.Layout.HORIZONTAL) - :constraints({ - ui.Constraint.Percentage(10), - ui.Constraint.Percentage(80), - ui.Constraint.Percentage(10), - }) - :split(chunks[2]) - - self._area = chunks[2] -end - -function M:entry(job) - if job.args[1] == "refresh" then - return update_partitions(self.obtain()) - end - - toggle_ui() - update_partitions(self.obtain()) - subscribe() - - local tx1, rx1 = ya.chan("mpsc") - local tx2, rx2 = ya.chan("mpsc") - function producer() - while true do - local cand = self.keys[ya.which { cands = self.keys, silent = true }] or { run = {} } - for _, r in ipairs(type(cand.run) == "table" and cand.run or { cand.run }) do - tx1:send(r) - if r == "quit" then - toggle_ui() - return - end - end - end - end - - function consumer1() - repeat - local run = rx1:recv() - if run == "quit" then - tx2:send(run) - break - elseif run == "up" then - update_cursor(-1) - elseif run == "down" then - update_cursor(1) - elseif run == "enter" then - local active = active_partition() - if active and active.dist then - ya.emit("cd", { active.dist }) - end - else - tx2:send(run) - end - until not run - end - - function consumer2() - repeat - local run = rx2:recv() - if run == "quit" then - break - elseif run == "mount" then - self.operate("mount") - elseif run == "unmount" then - self.operate("unmount") - elseif run == "eject" then - self.operate("eject") - end - until not run - end - - ya.join(producer, consumer1, consumer2) -end - -function M:reflow() return { self } end - -function M:redraw() - local rows = {} - for _, p in ipairs(self.partitions or {}) do - if not p.sub then - rows[#rows + 1] = ui.Row { p.main } - elseif p.sub == "" then - rows[#rows + 1] = ui.Row { p.main, p.label or "", p.dist or "", p.fstype or "" } - else - rows[#rows + 1] = ui.Row { " " .. p.sub, p.label or "", p.dist or "", p.fstype or "" } - end - end - - return { - ui.Clear(self._area), - ui.Border(ui.Edge.ALL) - :area(self._area) - :type(ui.Border.ROUNDED) - :style(ui.Style():fg("blue")) - :title(ui.Line("Mount"):align(ui.Align.CENTER)), - ui.Table(rows) - :area(self._area:pad(ui.Pad(1, 2, 1, 2))) - :header(ui.Row({ "Src", "Label", "Dist", "FSType" }):style(ui.Style():bold())) - :row(self.cursor) - :row_style(ui.Style():fg("blue"):underline()) - :widths { - ui.Constraint.Length(20), - ui.Constraint.Length(20), - ui.Constraint.Percentage(70), - ui.Constraint.Length(10), - }, - } -end - -function M.obtain() - local tbl = {} - local last - for _, p in ipairs(fs.partitions()) do - local main, sub = M.split(p.src) - if main and last ~= main then - if p.src == main then - last, p.main, p.sub, tbl[#tbl + 1] = p.src, p.src, "", p - else - last, tbl[#tbl + 1] = main, { src = main, main = main, sub = "" } - end - end - if sub then - if tbl[#tbl].sub == "" and tbl[#tbl].main == main then - tbl[#tbl].sub = nil - end - p.main, p.sub, tbl[#tbl + 1] = main, sub, p - end - end - table.sort(M.fillin(tbl), function(a, b) - if a.main == b.main then - return (a.sub or "") < (b.sub or "") - else - return a.main > b.main - end - end) - return tbl -end - -function M.split(src) - local pats = { - { "^/dev/sd[a-z]", "%d+$" }, -- /dev/sda1 - { "^/dev/nvme%d+n%d+", "p%d+$" }, -- /dev/nvme0n1p1 - { "^/dev/mmcblk%d+", "p%d+$" }, -- /dev/mmcblk0p1 - { "^/dev/disk%d+", ".+$" }, -- /dev/disk1s1 - { "^/dev/sr%d+", ".+$" }, -- /dev/sr0 - } - for _, p in ipairs(pats) do - local main = src:match(p[1]) - if main then - return main, src:sub(#main + 1):match(p[2]) - end - end -end - -function M.fillin(tbl) - if ya.target_os() ~= "linux" then - return tbl - end - - local sources, indices = {}, {} - for i, p in ipairs(tbl) do - if p.sub and not p.fstype then - sources[#sources + 1], indices[p.src] = p.src, i - end - end - if #sources == 0 then - return tbl - end - - local output, err = Command("lsblk"):arg({ "-p", "-o", "name,fstype", "-J" }):arg(sources):output() - if err then - ya.dbg("Failed to fetch filesystem types for unmounted partitions: " .. err) - return tbl - end - - local t = ya.json_decode(output and output.stdout or "") - for _, p in ipairs(t and t.blockdevices or {}) do - tbl[indices[p.name]].fstype = p.fstype - end - return tbl -end - -function M.operate(type) - local active = active_partition() - if not active then - return - elseif not active.sub then - return -- TODO: mount/unmount main disk - end - - local output, err - if ya.target_os() == "macos" then - output, err = Command("diskutil"):arg({ type, active.src }):output() - end - if ya.target_os() == "linux" then - if type == "eject" and active.src:match("^/dev/sr%d+") then - Command("udisksctl"):arg({ "unmount", "-b", active.src }):status() - output, err = Command("eject"):arg({ "--traytoggle", active.src }):output() - elseif type == "eject" then - Command("udisksctl"):arg({ "unmount", "-b", active.src }):status() - output, err = Command("udisksctl"):arg({ "power-off", "-b", active.src }):output() - else - output, err = Command("udisksctl"):arg({ type, "-b", active.src }):output() - end - end - - if not output then - M.fail("Failed to %s `%s`: %s", type, active.src, err) - elseif not output.status.success then - M.fail("Failed to %s `%s`: %s", type, active.src, output.stderr) - end -end - -function M.fail(...) ya.notify { title = "Mount", content = string.format(...), timeout = 10, level = "error" } end - -function M:click() end - -function M:scroll() end - -function M:touch() end - -return M diff --git a/yazi_1/.config/yazi/plugins/mount.yazi/sudo.lua b/yazi_1/.config/yazi/plugins/mount.yazi/sudo.lua deleted file mode 100644 index 3a62fcc..0000000 --- a/yazi_1/.config/yazi/plugins/mount.yazi/sudo.lua +++ /dev/null @@ -1,65 +0,0 @@ -local M = {} - ---- Verify if `sudo` is already authenticated ---- @return boolean ---- @return Error? -function M.sudo_already() - local status, err = Command("sudo"):arg({ "--validate", "--non-interactive" }):status() - return status and status.success or false, err -end - ---- Authenticate `sudo` through Yazi's input component ---- @param program string ---- @return boolean authenticated ---- @return Error? err -function M.authenticate(program) - if M.sudo_already() then - return true - end - - local value, event = ya.input { - pos = { "top-center", y = 3, w = 40 }, - title = string.format("Password for `sudo %s`:", program), - obscure = true, - } - if not value or event ~= 1 then - return false, Err("Sudo password input cancelled") - end - - local child, err = Command("sudo") - :arg({ "--stdin", "--validate" }) - :stdin(Command.PIPED) - :stdout(Command.PIPED) - :stderr(Command.PIPED) - :spawn() - if not child or err then - return false, err - end - - child:write_all(value .. "\n") - child:flush() - local output, err = child:wait_with_output() - if not output or err then - return false, err - elseif not output.status.success then - return false, Err("Incorrect sudo password") - else - return true - end -end - ---- Run a program with `sudo` privilege ---- @param program string ---- @param args table ---- @return Output? output ---- @return Error? err -function M.run_with_sudo(program, args) - local authenticated, err = M.authenticate(program) - if authenticated then - return Command("sudo"):arg({ "--non-interactive", "--", program }):arg(args):output() - else - return nil, err - end -end - -return M diff --git a/yazi_1/.config/yazi/plugins/omp.yazi b/yazi_1/.config/yazi/plugins/omp.yazi deleted file mode 160000 index 7a0624c..0000000 --- a/yazi_1/.config/yazi/plugins/omp.yazi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7a0624c23b544469dc5a7800fa87fdf9b0880b2e diff --git a/yazi_1/.config/yazi/plugins/open-git-remote.yazi/LICENSE b/yazi_1/.config/yazi/plugins/open-git-remote.yazi/LICENSE deleted file mode 100644 index 2720559..0000000 --- a/yazi_1/.config/yazi/plugins/open-git-remote.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Ou - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/open-git-remote.yazi/README.md b/yazi_1/.config/yazi/plugins/open-git-remote.yazi/README.md deleted file mode 100644 index c6fcbcf..0000000 --- a/yazi_1/.config/yazi/plugins/open-git-remote.yazi/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# open-git-remote.yazi -Plugin for [Yazi](https://github.com/sxyazi/yazi) to open git repos's remote url quickly with a shortcut. -Jump to the github page from yazi! - -Inspired by [Sylvan Franklin](https://www.youtube.com/watch?v=YDd0MYtfIp8&t=153s) -## Dependencies -- Git -- A web browser -- A browser opener: - - `open` (macOS) - - `xdg-open` (Linux) - - `start` (Windows/Git Bash) - - `wslview` (WSL) - - [GitHub CLI (`gh`)](https://cli.github.com/) - (**and/or** - just opens github links) - - - -## Installation - -### Using `ya pkg` -``` - ya pkg add larry-oates/open-git-remote -``` - -### Manual -**Linux/macOS** -``` -git clone https://github.com/larry-oates/open-git-remote.yazi.git ~/.config/yazi/plugins/open-git-remote.yazi -``` -**Windows** -``` -git clone https://github.com/larry-oates/open-git-remote.yazi.git %AppData%\yazi\config\plugins\open-git-remote.yazi -``` -## Configuration -add this to your **keymap.toml** file: -```toml -[[mgr.prepend_keymap]] -on = [ "g", "l" ] -run = "plugin open-git-remote" -desc = "open git remote url" -``` -I use g then l for "Git Link" but you can customize the keybinding however you like. Please refer to the [keymap.toml](https://yazi-rs.github.io/docs/configuration/keymap) documentation - diff --git a/yazi_1/.config/yazi/plugins/open-git-remote.yazi/main.lua b/yazi_1/.config/yazi/plugins/open-git-remote.yazi/main.lua deleted file mode 100644 index 4240e1c..0000000 --- a/yazi_1/.config/yazi/plugins/open-git-remote.yazi/main.lua +++ /dev/null @@ -1,58 +0,0 @@ --- ~/.config/yazi/plugins/git-open.yazi/init.lua --- Plugin to open Git remote URL in browser - -return { - entry = function() - ya.emit("shell", { - [[ - # Check if we're in a git repository - if ! git rev-parse --git-dir >/dev/null 2>&1; then - echo "Not in a Git repository" >&2 - exit 1 - fi - - # Try gh browse first (best option for GitHub repos) - if command -v gh >/dev/null 2>&1; then - if gh browse 2>/dev/null; then - echo "Opened with gh browse" - exit 0 - fi - fi - - # Fallback: Get remote URL and open manually - remote_url=$(git remote get-url origin 2>/dev/null) || { - echo "No remote 'origin' found" >&2 - exit 1 - } - - # Convert SSH URL to HTTPS - browser_url=$(echo "$remote_url" | sed -E ' - s|^https?://(.+)\.git$|https://\1|; - s|^https?://(.+)$|https://\1|; - s|^git@([^:]+):(.+)\.git$|https://\1/\2|; - s|^git@([^:]+):(.+)$|https://\1/\2|; - s|^ssh://git@([^/]+)/(.+)\.git$|https://\1/\2|; - s|^ssh://git@([^/]+)/(.+)$|https://\1/\2| - ') - - # Open in browser - if command -v open >/dev/null 2>&1; then - open "$browser_url" - elif command -v xdg-open >/dev/null 2>&1; then - xdg-open "$browser_url" - elif command -v start >/dev/null 2>&1; then - start "$browser_url" - elif command -v wslview >/dev/null 2>&1; then - wslview "$browser_url" - else - echo "No browser opener found" >&2 - exit 1 - fi - - echo "Opened: $browser_url" - ]], - confirm = false, - orphan = true, - }) - end, -} diff --git a/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/LICENSE b/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/LICENSE deleted file mode 100644 index 0399f1c..0000000 --- a/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2024 Lauri Niskanen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/README.md b/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/README.md deleted file mode 100644 index ffef1cd..0000000 --- a/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/README.md +++ /dev/null @@ -1,25 +0,0 @@ -# open-with-cmd.yazi - -This is a Yazi plugin for opening files with a prompted command. - -## Installation - -Install the plugin: - -``` -ya pkg add Ape/open-with-cmd -``` - -Create `~/.config/yazi/keymap.toml` and add: - -``` -[[manager.prepend_keymap]] -on = "o" -run = "plugin open-with-cmd -- block" -desc = "Open with command in the terminal" - -[[manager.prepend_keymap]] -on = "O" -run = "plugin open-with-cmd" -desc = "Open with command" -``` diff --git a/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/main.lua b/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/main.lua deleted file mode 100644 index 7233873..0000000 --- a/yazi_1/.config/yazi/plugins/open-with-cmd.yazi/main.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - entry = function(_, job) - local block = job.args[1] and job.args[1] == "block" - - local value, event = ya.input({ - title = block and "Open with (block):" or "Open with:", - pos = { "hovered", y = 1, w = 50 }, - }) - - if event == 1 then - local s = ya.target_family() == "windows" and " %*" or ' "$@"' - ya.mgr_emit("shell", { - value .. s, - block = block, - orphan = not block, - }) - end - end, -} diff --git a/yazi_1/.config/yazi/plugins/ouch.yazi/LICENSE b/yazi_1/.config/yazi/plugins/ouch.yazi/LICENSE deleted file mode 100644 index 3f9d766..0000000 --- a/yazi_1/.config/yazi/plugins/ouch.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 ndtoan96 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/ouch.yazi/README.md b/yazi_1/.config/yazi/plugins/ouch.yazi/README.md deleted file mode 100644 index 027f0d1..0000000 --- a/yazi_1/.config/yazi/plugins/ouch.yazi/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# ouch.yazi - -[ouch](https://github.com/ouch-org/ouch) plugin for [Yazi](https://github.com/sxyazi/yazi). - -![ouch.yazi](https://github.com/ndtoan96/ouch.yazi/assets/33489972/946397ec-b37b-4bf4-93f1-c676fc8e59f2) - -## Features -- Archive preview -- Compression - -## Installation - -### Yazi package manager -```bash -ya pkg add ndtoan96/ouch -``` - -### Git -```bash -# Linux/macOS -git clone https://github.com/ndtoan96/ouch.yazi.git ~/.config/yazi/plugins/ouch.yazi - -# Windows with cmd -git clone https://github.com/ndtoan96/ouch.yazi.git %AppData%\yazi\config\plugins\ouch.yazi - -# Windows with powershell -git clone https://github.com/ndtoan96/ouch.yazi.git "$($env:APPDATA)\yazi\config\plugins\ouch.yazi" -``` - -Make sure you have [ouch](https://github.com/ouch-org/ouch) installed and in your `PATH`. - -## Usage - -### Preview -For archive preview, add this to your `yazi.toml`: - -```toml -[[plugin.prepend_previewers]] -mime = "application/{*zip,tar,bzip2,7z*,rar,xz,zstd,java-archive}" -run = "ouch" -``` - -Now go to an archive on Yazi, you should see the archive's content in the preview pane. You can use `J` and `K` to roll up and down the preview. - -#### Customization - -Previews can be customized by adding extra arguments in the `run` string: - -```toml -[plugin] -prepend_previewers = [ - # Change the top-level archive icon - { ..., run = "ouch --archive-icon='đŸ—„ïž '" }, - # Or remove it by setting it to '' - { ..., run = "ouch --archive-icon=''" }, - - # Enable file icons - { ..., run = "ouch --show-file-icons" }, - - # Disable tree view - { ..., run = "ouch --list-view" }, - - # These can be combined - { ..., run = "ouch --archive-icon='đŸ—„ïž ' --show-file-icons --list-view" }, -] -``` - -### Compression -For compession, add this to your `keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = ["C"] -run = "plugin ouch" -desc = "Compress with ouch" -``` - -The plugin uses `zip` format by default. You can change the format when you name the output file, `ouch` will detect format based on file extension. - -And, for example, if you would like to set `7z` as default format, you can use `plugin ouch 7z`. - -### Decompression -This plugin does not provide a decompression feature because it already is supported by Yazi. -To decompress with `ouch`, configure the opener in `yazi.toml`. - -```toml -[opener] -extract = [ - { run = 'ouch d -y %*', desc = "Extract here with ouch", for = "windows" }, - { run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" }, -] -``` diff --git a/yazi_1/.config/yazi/plugins/ouch.yazi/main.lua b/yazi_1/.config/yazi/plugins/ouch.yazi/main.lua deleted file mode 100644 index a45ad3e..0000000 --- a/yazi_1/.config/yazi/plugins/ouch.yazi/main.lua +++ /dev/null @@ -1,195 +0,0 @@ -local M = {} - --- Extract the tree prefix (if any) from a line -local function get_tree_prefix(line) - local _, prefix_len = line:find("─ ", 1, true) - if prefix_len then - return line:sub(1, prefix_len) - else - return "" - end -end - --- Add a filetype icon to a line -local function line_with_icon(line) - line = line:gsub("[\r\n]+$", "") -- Trailing newlines mess with filetype detection - - local tree_prefix = get_tree_prefix(line) - local url = line:sub(#tree_prefix + 1) - local icon = File({ - url = Url(url), - cha = Cha { - mode = tonumber(url:sub(-1) == "/" and "40700" or "100644", 8), - kind = url:sub(-1) == "/" and 1 or 0, -- For Yazi <25.9.x compatibility - } - }):icon() - - if icon then - line = ui.Line { tree_prefix, ui.Span(icon.text .. " "):style(icon.style), url } - end - - return line -end - -function M:peek(job) - local cmd = Command("ouch"):arg("l") - if not job.args.list_view then - cmd:arg("-t") - end - cmd:arg({ "-y", tostring(job.file.url) }) - :stdout(Command.PIPED) - :stderr(Command.PIPED) - - local child = cmd:spawn() - local limit = job.area.h - local archive_icon = job.args.archive_icon or "\u{1f4c1} " - local file_name = string.match(tostring(job.file.url), ".*[/\\](.*)") - local lines = { string.format(" %s%s", archive_icon, file_name) } - local num_skip = 0 - repeat - local line, event = child:read_line() - if event == 1 then - ya.err(tostring(event)) - elseif event ~= 0 then - break - end - - if line:find('Archive', 1, true) ~= 1 and line:find('[INFO]', 1, true) ~= 1 then - if num_skip >= job.skip then - if job.args.show_file_icons then - if line:find ('[ERROR]', 1, true) == 1 then - -- On error, disable file icons for the rest of the output - job.args.show_file_icons = false - elseif line:find ('[WARNING]', 1, true) ~= 1 then - -- Show icons for non-warning lines only - line = line_with_icon(line) - end - end - - line = ui.Line { " ", line } -- One space padding - table.insert(lines, line) - else - num_skip = num_skip + 1 - end - end - until #lines >= limit - - child:start_kill() - if job.skip > 0 and #lines < limit then - ya.emit( - "peek", - { tostring(math.max(0, job.skip - (limit - #lines))), only_if = tostring(job.file.url), upper_bound = "" } - ) - else - ya.preview_widget(job, { ui.Text(lines):area(job.area) }) - end -end - -function M:seek(job) - local h = cx.active.current.hovered - if h and h.url == job.file.url then - local step = math.floor(job.units * job.area.h / 10) - ya.emit("peek", { - math.max(0, cx.active.preview.skip + step), - only_if = tostring(job.file.url), - }) - end -end - --- Check if file exists -local function file_exists(name) - local f = io.open(name, "r") - if f ~= nil then - io.close(f) - return true - else - return false - end -end - --- Get the files that need to be compressed and infer a default archive name -local get_compression_target = ya.sync(function() - local tab = cx.active - local default_name - local paths = {} - if #tab.selected == 0 then - if tab.current.hovered then - local name = tab.current.hovered.name - default_name = name - table.insert(paths, name) - else - return - end - else - default_name = tab.current.cwd.name - for _, url in pairs(tab.selected) do - table.insert(paths, tostring(url)) - end - -- The compression targets are aquired, now unselect them - ya.emit("escape", {}) - end - return paths, default_name -end) - -local function invoke_compress_command(paths, name) - local cmd_output, err_code = Command("ouch") - :arg({ "c", "-y" }) - :arg(paths) - :arg(name) - :stderr(Command.PIPED) - :output() - if err_code ~= nil then - ya.notify({ - title = "Failed to run ouch command", - content = "Status: " .. err_code, - timeout = 5.0, - level = "error", - }) - elseif not cmd_output.status.success then - ya.notify({ - title = "Compression failed: status code " .. cmd_output.status.code, - content = cmd_output.stderr, - timeout = 5.0, - level = "error", - }) - end -end - -function M:entry(job) - local default_fmt = job.args[1] - if default_fmt == nil then - default_fmt = "zip" - end - - ya.emit("escape", { visual = true }) - - -- Get the files that need to be compressed and infer a default archive name - local paths, default_name = get_compression_target() - - -- Get archive name from user - local output_name, name_event = ya.input({ - title = "Create archive:", - value = default_name .. "." .. default_fmt, - position = { "top-center", y = 3, w = 40 }, - pos = { "top-center", y = 3, w = 40 }, - }) - if name_event ~= 1 then - return - end - - -- Get confirmation if file exists - if file_exists(output_name) then - local confirm, confirm_event = ya.input({ - title = "Overwrite " .. output_name .. "? (y/N)", - position = { "top-center", y = 3, w = 40 }, - pos = { "top-center", y = 3, w = 40 }, - }) - if not (confirm_event == 1 and confirm:lower() == "y") then - return - end - end - - invoke_compress_command(paths, output_name) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/piper.yazi/LICENSE b/yazi_1/.config/yazi/plugins/piper.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/piper.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/piper.yazi/README.md b/yazi_1/.config/yazi/plugins/piper.yazi/README.md deleted file mode 100644 index 3bebcf2..0000000 --- a/yazi_1/.config/yazi/plugins/piper.yazi/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# piper.yazi - -Pipe any shell command as a previewer. - -## Installation - -```sh -ya pkg add yazi-rs/plugins:piper -``` - -## Usage - -Piper is a general-purpose previewer - you can pass any shell command to `piper` and it will use the command's output as the preview content. - -It accepts a string parameter, which is the shell command to be executed, for example: - -```toml -# ~/.config/yazi/yazi.toml -[[plugin.prepend_previewers]] -url = "*" -run = 'piper -- echo "$1"' -``` - -This will set `piper` as the previewer for all file types and use `$1` (file path) as the preview content. - -## Variables - -Available variables: - -- `$w`: the width of the preview area. -- `$h`: the height of the preview area. -- `$1`: the path to the file being previewed. - -## Examples - -Here are some configuration examples: - -### Preview tarballs with [`tar`](https://man7.org/linux/man-pages/man1/tar.1.html) - -```toml -[[plugin.prepend_previewers]] -url = "*.tar*" -run = 'piper --format=url -- tar tf "$1"' -``` - -In this example, `--format=url` tells `piper` to parse the `tar` output as file URLs, so you'll be able to get a list of files with icons. - -### Preview CSV with [`bat`](https://github.com/sharkdp/bat) - -```toml -[[plugin.prepend_previewers]] -url = "*.csv" -run = 'piper -- bat -p --color=always "$1"' -``` - -Note that certain distributions might use a different name for `bat`, like Debian and Ubuntu uses `batcat` instead, so please adjust accordingly. - -### Preview Markdown with [`glow`](https://github.com/charmbracelet/glow) - -```toml -[[plugin.prepend_previewers]] -url = "*.md" -run = 'piper -- CLICOLOR_FORCE=1 glow -w=$w -s=dark "$1"' -``` - -Note that there's [a bug in Glow v2.0](https://github.com/charmbracelet/glow/issues/440#issuecomment-2307992634) that causes slight color differences between tty and non-tty environments. - -### Preview directory tree with [`eza`](https://github.com/eza-community/eza) - -```toml -[[plugin.prepend_previewers]] -url = "*/" -run = 'piper -- eza -TL=3 --color=always --icons=always --group-directories-first --no-quotes "$1"' -``` - -### Preview the schema of a SQLite database - -```toml -[[plugin.prepend_previewers]] -mime = "application/sqlite3" -run = 'piper -- sqlite3 "$1" ".schema --indent"' -``` - -### Use [`hexyl`](https://github.com/sharkdp/hexyl) as fallback previewer - -Yazi defaults to using [`file -bL "$1"`](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/file.lua) if there's no matched previewer. - -This example uses `hexyl` as a fallback previewer instead of `file`. - -```toml -[[plugin.append_previewers]] -url = "*" -run = 'piper -- hexyl --border=none --terminal-width=$w "$1"' -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/piper.yazi/main.lua b/yazi_1/.config/yazi/plugins/piper.yazi/main.lua deleted file mode 100644 index 1b5f9fc..0000000 --- a/yazi_1/.config/yazi/plugins/piper.yazi/main.lua +++ /dev/null @@ -1,71 +0,0 @@ ---- @since 25.9.15 - -local M = {} - -local function fail(job, s) ya.preview_widget(job, ui.Text.parse(s):area(job.area):wrap(ui.Wrap.YES)) end - -function M:peek(job) - local child, err = Command("sh") - -- TODO: use `job.file.path` instead - :arg({ "-c", job.args[1], "sh", tostring(job.file.cache or job.file.url) }) - :env("w", job.area.w) - :env("h", job.area.h) - :stdout(Command.PIPED) - :stderr(Command.PIPED) - :spawn() - - if not child then - return fail(job, "sh: " .. err) - end - - local limit = job.area.h - local i, outs, errs = 0, {}, {} - repeat - local next, event = child:read_line() - if event == 1 then - errs[#errs + 1] = next - elseif event ~= 0 then - break - end - - i = i + 1 - if i > job.skip then - outs[#outs + 1] = next - end - until i >= job.skip + limit - - child:start_kill() - if #errs > 0 then - fail(job, table.concat(errs, "")) - elseif job.skip > 0 and i < job.skip + limit then - ya.emit("peek", { math.max(0, i - limit), only_if = job.file.url, upper_bound = true }) - else - ya.preview_widget(job, M.format(job, outs)) - end -end - -function M:seek(job) require("code"):seek(job) end - -function M.format(job, lines) - local format = job.args.format - if format ~= "url" then - local s = table.concat(lines, ""):gsub("\r", ""):gsub("\t", string.rep(" ", rt.preview.tab_size)) - return ui.Text.parse(s):area(job.area) - end - - for i = 1, #lines do - lines[i] = lines[i]:gsub("[\r\n]+$", "") - - local icon = File({ - url = Url(lines[i]), - cha = Cha { mode = tonumber(lines[i]:sub(-1) == "/" and "40700" or "100644", 8) }, - }):icon() - - if icon then - lines[i] = ui.Line { ui.Span(" " .. icon.text .. " "):style(icon.style), lines[i] } - end - end - return ui.Text(lines):area(job.area) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/projects.yazi/LICENSE b/yazi_1/.config/yazi/plugins/projects.yazi/LICENSE deleted file mode 100644 index 0c6d609..0000000 --- a/yazi_1/.config/yazi/plugins/projects.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 MasouShizuka - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/projects.yazi/README.md b/yazi_1/.config/yazi/plugins/projects.yazi/README.md deleted file mode 100644 index 0746d50..0000000 --- a/yazi_1/.config/yazi/plugins/projects.yazi/README.md +++ /dev/null @@ -1,214 +0,0 @@ -# projects.yazi - -A [Yazi](https://github.com/sxyazi/yazi) plugin that adds the functionality to save, load and merge projects. -A project means all `tabs` and their status, including `cwd` and so on. - -> [!NOTE] -> The latest release of Yazi is required at the moment. - -https://github.com/MasouShizuka/projects.yazi/assets/44764707/79c3559a-7776-48cd-8317-dd1478314eed - -## Features - -- Save/load projects -- Load last project -- Projects persistence -- Merge a project or its current tab to other projects - -## Installation - -```sh -ya pkg add MasouShizuka/projects -``` - -or - -```sh -# Windows -git clone https://github.com/MasouShizuka/projects.yazi.git %AppData%\yazi\config\plugins\projects.yazi - -# Linux/macOS -git clone https://github.com/MasouShizuka/projects.yazi.git ~/.config/yazi/plugins/projects.yazi -``` - -## Keymap - -Add this to your `keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = [ "P", "s" ] -run = "plugin projects save" -desc = "Save current project" - -[[mgr.prepend_keymap]] -on = [ "P", "l" ] -run = "plugin projects load" -desc = "Load project" - -[[mgr.prepend_keymap]] -on = [ "P", "P" ] -run = "plugin projects load_last" -desc = "Load last project" - -[[mgr.prepend_keymap]] -on = [ "P", "d" ] -run = "plugin projects delete" -desc = "Delete project" - -[[mgr.prepend_keymap]] -on = [ "P", "D" ] -run = "plugin projects delete_all" -desc = "Delete all projects" - -[[mgr.prepend_keymap]] -on = [ "P", "m" ] -run = "plugin projects 'merge current'" -desc = "Merge current tab to other projects" - -[[mgr.prepend_keymap]] -on = [ "P", "M" ] -run = "plugin projects 'merge all'" -desc = "Merge current project to other projects" -``` - -### Load project by name or key - -If you want to load a specific project with a keybinding (you can use either the key or the name of the project): - -```toml -[[mgr.prepend_keymap]] -on = [ "P", "p" ] -run = "plugin projects 'load SomeProject'" -desc = "Load the 'SomeProject' project" -``` - -You can also load a specific project by using the below Bash/Zsh function (uses the "official" [shell wrapper](https://yazi-rs.github.io/docs/quick-start/#shell-wrapper), but you can also replace `y` with `yazi`): - -```bash -function yap() { - local yaziProject="$1" - shift - if [ -z "$yaziProject" ]; then - >&2 echo "ERROR: The first argument must be a project" - return 64 - fi - - # Generate random Yazi client ID (DDS / `ya emit` uses `YAZI_ID`) - local yaziId=$RANDOM - - # Use Yazi's DDS to run a plugin command after Yazi has started - # (the nested subshell is only to suppress "Done" output for the job) - ( (sleep 0.1; YAZI_ID=$yaziId ya emit plugin projects "load $yaziProject") &) - - # Run Yazi with the generated client ID - y --client-id $yaziId "$@" || return $? -} -``` - -With the above function you can open a specific project by running e.g. `yap SomeProject` - -## Config - -Don't forget to add the plugin's `setup` function in Yazi's `init.lua`, i.e. `~/.config/yazi/init.lua`. -The following are the default configurations: - -```lua -require("projects"):setup({ - event = { - save = { - enable = true, - name = "project-saved", - }, - load = { - enable = true, - name = "project-loaded", - }, - delete = { - enable = true, - name = "project-deleted", - }, - delete_all = { - enable = true, - name = "project-deleted-all", - }, - merge = { - enable = true, - name = "project-merged", - }, - }, - save = { - method = "yazi", -- yazi | lua - yazi_load_event = "@projects-load", -- event name when loading projects in `yazi` method - lua_save_path = "", -- path of saved file in `lua` method, comment out or assign explicitly - -- default value: - -- windows: "%APPDATA%/yazi/state/projects.json" - -- unix: "~/.local/state/yazi/projects.json" - }, - last = { - update_after_save = true, - update_after_load = true, - update_before_quit = false, - load_after_start = false, - }, - merge = { - event = "projects-merge", - quit_after_merge = false, - }, - notify = { - enable = true, - title = "Projects", - timeout = 3, - level = "info", - }, -}) -``` - -> [!NOTE] -> Settings that are not set will use the default value. - -### `event` - -The corresponding event will be sent when the corresponding function is executed. - -For specific usage, please refer to [#5](https://github.com/MasouShizuka/projects.yazi/issues/5) and [#12](https://github.com/MasouShizuka/projects.yazi/issues/12). - -### `save` - -> [!NOTE] -> Yazi's api sometimes doesn't work on Windows, which is why the `lua` method is proposed - -`method`: the method of saving projects: -- `yazi`: using `yazi` api to save to `.dds` file -- `lua`: using `lua` api to save - -`yazi_load_event`: event name when loading projects in `yazi` method - -`lua_save_path`: path of saved file in `lua` method, the defalut value is -- `Windows`: `%APPDATA%/yazi/state/projects.json` -- `Unix`: `~/.local/state/yazi/projects.json` - -### `last` - -The last project is loaded by `load_last` command. - -`update_after_save`: the saved project will be saved to last project. - -`update_after_load`: the loaded project will be saved to last project. - -`update_before_quit`: the current project will be saved to last project before quit. - -`load_after_start`: the last project will be loaded after starting. -- Only work with `lua` method, please refer to [#2](https://github.com/MasouShizuka/projects.yazi/issues/2) - -### `merge` - -`event`: the name of event used by merge feature. - -`quit_after_merge`: the merged project will be exited after merging. - -### `notify` - -When enabled, notifications are displayed when actions are performed. - -`title`, `timeout`, `level` are the same as [ya.notify](https://yazi-rs.github.io/docs/plugins/utils/#ya.notify). diff --git a/yazi_1/.config/yazi/plugins/projects.yazi/json.lua b/yazi_1/.config/yazi/plugins/projects.yazi/json.lua deleted file mode 100644 index 47b91d6..0000000 --- a/yazi_1/.config/yazi/plugins/projects.yazi/json.lua +++ /dev/null @@ -1,386 +0,0 @@ --- --- json.lua --- --- Copyright (c) 2020 rxi --- --- Permission is hereby granted, free of charge, to any person obtaining a copy of --- this software and associated documentation files (the "Software"), to deal in --- the Software without restriction, including without limitation the rights to --- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies --- of the Software, and to permit persons to whom the Software is furnished to do --- so, subject to the following conditions: --- --- The above copyright notice and this permission notice shall be included in all --- copies or substantial portions of the Software. --- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --- SOFTWARE. --- - -local json = { _version = "0.1.2" } - -------------------------------------------------------------------------------- --- Encode -------------------------------------------------------------------------------- - -local encode - -local escape_char_map = { - ["\\"] = "\\", - ["\""] = "\"", - ["\b"] = "b", - ["\f"] = "f", - ["\n"] = "n", - ["\r"] = "r", - ["\t"] = "t", -} - -local escape_char_map_inv = { ["/"] = "/" } -for k, v in pairs(escape_char_map) do - escape_char_map_inv[v] = k -end - - -local function escape_char(c) - return "\\" .. (escape_char_map[c] or string.format("u%04x", c:byte())) -end - - -local function encode_nil(val) - return "null" -end - - -local function encode_table(val, stack) - local res = {} - stack = stack or {} - - -- Circular reference? - if stack[val] then error("circular reference") end - - stack[val] = true - - if rawget(val, 1) ~= nil or next(val) == nil then - -- Treat as array -- check keys are valid and it is not sparse - local n = 0 - for k in pairs(val) do - if type(k) ~= "number" then - error("invalid table: mixed or invalid key types") - end - n = n + 1 - end - if n ~= #val then - error("invalid table: sparse array") - end - -- Encode - for i, v in ipairs(val) do - table.insert(res, encode(v, stack)) - end - stack[val] = nil - return "[" .. table.concat(res, ",") .. "]" - else - -- Treat as an object - for k, v in pairs(val) do - if type(k) ~= "string" then - error("invalid table: mixed or invalid key types") - end - table.insert(res, encode(k, stack) .. ":" .. encode(v, stack)) - end - stack[val] = nil - return "{" .. table.concat(res, ",") .. "}" - end -end - - -local function encode_string(val) - return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"' -end - - -local function encode_number(val) - -- Check for NaN, -inf and inf - if val ~= val or val <= -math.huge or val >= math.huge then - error("unexpected number value '" .. tostring(val) .. "'") - end - return string.format("%.14g", val) -end - - -local type_func_map = { - ["nil"] = encode_nil, - ["table"] = encode_table, - ["string"] = encode_string, - ["number"] = encode_number, - ["boolean"] = tostring, -} - - -encode = function(val, stack) - local t = type(val) - local f = type_func_map[t] - if f then - return f(val, stack) - end - error("unexpected type '" .. t .. "'") -end - - -function json.encode(val) - return (encode(val)) -end - -------------------------------------------------------------------------------- --- Decode -------------------------------------------------------------------------------- - -local parse - -local function create_set(...) - local res = {} - for i = 1, select("#", ...) do - res[select(i, ...)] = true - end - return res -end - -local space_chars = create_set(" ", "\t", "\r", "\n") -local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",") -local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u") -local literals = create_set("true", "false", "null") - -local literal_map = { - ["true"] = true, - ["false"] = false, - ["null"] = nil, -} - - -local function next_char(str, idx, set, negate) - for i = idx, #str do - if set[str:sub(i, i)] ~= negate then - return i - end - end - return #str + 1 -end - - -local function decode_error(str, idx, msg) - local line_count = 1 - local col_count = 1 - for i = 1, idx - 1 do - col_count = col_count + 1 - if str:sub(i, i) == "\n" then - line_count = line_count + 1 - col_count = 1 - end - end - error(string.format("%s at line %d col %d", msg, line_count, col_count)) -end - - -local function codepoint_to_utf8(n) - -- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa - local f = math.floor - if n <= 0x7f then - return string.char(n) - elseif n <= 0x7ff then - return string.char(f(n / 64) + 192, n % 64 + 128) - elseif n <= 0xffff then - return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128) - elseif n <= 0x10ffff then - return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128, - f(n % 4096 / 64) + 128, n % 64 + 128) - end - error(string.format("invalid unicode codepoint '%x'", n)) -end - - -local function parse_unicode_escape(s) - local n1 = tonumber(s:sub(1, 4), 16) - local n2 = tonumber(s:sub(7, 10), 16) - -- Surrogate pair? - if n2 then - return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000) - else - return codepoint_to_utf8(n1) - end -end - - -local function parse_string(str, i) - local res = "" - local j = i + 1 - local k = j - - while j <= #str do - local x = str:byte(j) - - if x < 32 then - decode_error(str, j, "control character in string") - elseif x == 92 then -- `\`: Escape - res = res .. str:sub(k, j - 1) - j = j + 1 - local c = str:sub(j, j) - if c == "u" then - local hex = str:match("^[dD][89aAbB]%x%x\\u%x%x%x%x", j + 1) - or str:match("^%x%x%x%x", j + 1) - or decode_error(str, j - 1, "invalid unicode escape in string") - res = res .. parse_unicode_escape(hex) - j = j + #hex - else - if not escape_chars[c] then - decode_error(str, j - 1, "invalid escape char '" .. c .. "' in string") - end - res = res .. escape_char_map_inv[c] - end - k = j + 1 - elseif x == 34 then -- `"`: End of string - res = res .. str:sub(k, j - 1) - return res, j + 1 - end - - j = j + 1 - end - - decode_error(str, i, "expected closing quote for string") -end - - -local function parse_number(str, i) - local x = next_char(str, i, delim_chars) - local s = str:sub(i, x - 1) - local n = tonumber(s) - if not n then - decode_error(str, i, "invalid number '" .. s .. "'") - end - return n, x -end - - -local function parse_literal(str, i) - local x = next_char(str, i, delim_chars) - local word = str:sub(i, x - 1) - if not literals[word] then - decode_error(str, i, "invalid literal '" .. word .. "'") - end - return literal_map[word], x -end - - -local function parse_array(str, i) - local res = {} - local n = 1 - i = i + 1 - while 1 do - local x - i = next_char(str, i, space_chars, true) - -- Empty / end of array? - if str:sub(i, i) == "]" then - i = i + 1 - break - end - -- Read token - x, i = parse(str, i) - res[n] = x - n = n + 1 - -- Next token - i = next_char(str, i, space_chars, true) - local chr = str:sub(i, i) - i = i + 1 - if chr == "]" then break end - if chr ~= "," then decode_error(str, i, "expected ']' or ','") end - end - return res, i -end - - -local function parse_object(str, i) - local res = {} - i = i + 1 - while 1 do - local key, val - i = next_char(str, i, space_chars, true) - -- Empty / end of object? - if str:sub(i, i) == "}" then - i = i + 1 - break - end - -- Read key - if str:sub(i, i) ~= '"' then - decode_error(str, i, "expected string for key") - end - key, i = parse(str, i) - -- Read ':' delimiter - i = next_char(str, i, space_chars, true) - if str:sub(i, i) ~= ":" then - decode_error(str, i, "expected ':' after key") - end - i = next_char(str, i + 1, space_chars, true) - -- Read value - val, i = parse(str, i) - -- Set - res[key] = val - -- Next token - i = next_char(str, i, space_chars, true) - local chr = str:sub(i, i) - i = i + 1 - if chr == "}" then break end - if chr ~= "," then decode_error(str, i, "expected '}' or ','") end - end - return res, i -end - - -local char_func_map = { - ['"'] = parse_string, - ["0"] = parse_number, - ["1"] = parse_number, - ["2"] = parse_number, - ["3"] = parse_number, - ["4"] = parse_number, - ["5"] = parse_number, - ["6"] = parse_number, - ["7"] = parse_number, - ["8"] = parse_number, - ["9"] = parse_number, - ["-"] = parse_number, - ["t"] = parse_literal, - ["f"] = parse_literal, - ["n"] = parse_literal, - ["["] = parse_array, - ["{"] = parse_object, -} - - -parse = function(str, idx) - local chr = str:sub(idx, idx) - local f = char_func_map[chr] - if f then - return f(str, idx) - end - decode_error(str, idx, "unexpected character '" .. chr .. "'") -end - - -function json.decode(str) - if type(str) ~= "string" then - error("expected argument of type string, got " .. type(str)) - end - local res, idx = parse(str, next_char(str, 1, space_chars, true)) - idx = next_char(str, idx, space_chars, true) - if idx <= #str then - decode_error(str, idx, "trailing garbage") - end - return res -end - -return { - encode = json.encode, - decode = json.decode, -} diff --git a/yazi_1/.config/yazi/plugins/projects.yazi/main.lua b/yazi_1/.config/yazi/plugins/projects.yazi/main.lua deleted file mode 100644 index ed73574..0000000 --- a/yazi_1/.config/yazi/plugins/projects.yazi/main.lua +++ /dev/null @@ -1,652 +0,0 @@ -local SUPPORTED_KEYS_MAP = { - ["0"] = 1, - ["1"] = 2, - ["2"] = 3, - ["3"] = 4, - ["4"] = 5, - ["5"] = 6, - ["6"] = 7, - ["7"] = 8, - ["8"] = 9, - ["9"] = 10, - ["A"] = 11, - ["B"] = 12, - ["C"] = 13, - ["D"] = 14, - ["E"] = 15, - ["F"] = 16, - ["G"] = 17, - ["H"] = 18, - ["I"] = 19, - ["J"] = 20, - ["K"] = 21, - ["L"] = 22, - ["M"] = 23, - ["N"] = 24, - ["O"] = 25, - ["P"] = 26, - ["Q"] = 27, - ["R"] = 28, - ["S"] = 29, - ["T"] = 30, - ["U"] = 31, - ["V"] = 32, - ["W"] = 33, - ["X"] = 34, - ["Y"] = 35, - ["Z"] = 36, - ["a"] = 37, - ["b"] = 38, - ["c"] = 39, - ["d"] = 40, - ["e"] = 41, - ["f"] = 42, - ["g"] = 43, - ["h"] = 44, - ["i"] = 45, - ["j"] = 46, - ["k"] = 47, - ["l"] = 48, - ["m"] = 49, - ["n"] = 50, - ["o"] = 51, - ["p"] = 52, - ["q"] = 53, - ["r"] = 54, - ["s"] = 55, - ["t"] = 56, - ["u"] = 57, - ["v"] = 58, - ["w"] = 59, - ["x"] = 60, - ["y"] = 61, - ["z"] = 62, -} - -local SUPPORTED_KEYS = { - { on = "0" }, - { on = "1" }, - { on = "2" }, - { on = "3" }, - { on = "4" }, - { on = "5" }, - { on = "6" }, - { on = "7" }, - { on = "8" }, - { on = "9" }, - { on = "A" }, - { on = "B" }, - { on = "C" }, - { on = "D" }, - { on = "E" }, - { on = "F" }, - { on = "G" }, - { on = "H" }, - { on = "I" }, - { on = "J" }, - { on = "K" }, - { on = "L" }, - { on = "M" }, - { on = "N" }, - { on = "O" }, - { on = "P" }, - { on = "Q" }, - { on = "R" }, - { on = "S" }, - { on = "T" }, - { on = "U" }, - { on = "V" }, - { on = "W" }, - { on = "X" }, - { on = "Y" }, - { on = "Z" }, - { on = "a" }, - { on = "b" }, - { on = "c" }, - { on = "d" }, - { on = "e" }, - { on = "f" }, - { on = "g" }, - { on = "h" }, - { on = "i" }, - { on = "j" }, - { on = "k" }, - { on = "l" }, - { on = "m" }, - { on = "n" }, - { on = "o" }, - { on = "p" }, - { on = "q" }, - { on = "r" }, - { on = "s" }, - { on = "t" }, - { on = "u" }, - { on = "v" }, - { on = "w" }, - { on = "x" }, - { on = "y" }, - { on = "z" }, -} - -local _notify = ya.sync(function(state, message) - ya.notify({ - title = state.notify.title, - content = message, - timeout = state.notify.timeout, - level = state.notify.level, - }) -end) - -local _get_default_projects = ya.sync(function(state) - return { - list = {}, - last = nil, - } -end) - -local _get_projects = ya.sync(function(state) - return not state.projects and _get_default_projects() or state.projects -end) - -local _get_real_idx = ya.sync(function(state, idx) - for real_idx, value in ipairs(_get_projects().list) do - if value.on == SUPPORTED_KEYS[idx].on then - return real_idx - end - end - return nil -end) - -local _get_current_project = ya.sync(function(state) - local tabs = cx.tabs - - -- TODO: add more tab properties - local project = { - active_idx = tonumber(tabs.idx), - tabs = {}, - } - - for index, tab in ipairs(tabs) do - project.tabs[#project.tabs + 1] = { - idx = index, - cwd = tostring(tab.current.cwd):gsub("\\", "/"), - } - end - - return project -end) - -local _save_projects = ya.sync(function(state, projects) - state.projects = projects - - if state.save.method == "yazi" then - ps.pub_to(0, state.save.yazi_load_event, projects) - elseif state.save.method == "lua" then - local f = io.open(state.save.lua_save_path, "w") - if not f then - return - end - f:write(state.json.encode(projects)) - io.close(f) - end -end) - -local save_project = ya.sync(function(state, idx, desc) - local projects = _get_projects() - - local real_idx = _get_real_idx(idx) - if not real_idx then - real_idx = #projects.list + 1 - end - - local project = _get_current_project() - projects.list[real_idx] = { - on = SUPPORTED_KEYS[idx].on, - desc = desc, - project = project, - } - - if state.last.update_after_save then - projects.last = project - end - - _save_projects(projects) - - if state.event.save.enable then - ps.pub_to(0, state.event.save.name, project) - end - - if state.notify.enable then - local message = string.format("Project saved to %s", state.projects.list[real_idx].on) - _notify(message) - end -end) - -local load_project = ya.sync(function(state, project, desc) - -- TODO: add more tab properties to restore - - -- when cx is nil, it is called in setup - if cx then - for _ = 1, #cx.tabs - 1 do - ya.emit("tab_close", { 0 }) - end - end - - local sorted_tabs = {} - for _, tab in pairs(project.tabs) do - sorted_tabs[tonumber(tab.idx)] = tab - end - for _, tab in pairs(sorted_tabs) do - ya.emit("tab_create", { tab.cwd }) - end - - ya.emit("tab_close", { 0 }) - ya.emit("tab_switch", { project.active_idx - 1 }) - - if state.last.update_after_load then - local projects = _get_projects() - projects.last = project - _save_projects(projects) - end - - if state.event.load.enable then - ps.pub_to(0, state.event.load.name, project) - end - - if state.notify.enable then - local message - if desc then - message = string.format([["%s" loaded]], desc) - else - message = string.format([[Last project loaded]], desc) - end - _notify(message) - end -end) - -local _load_projects = ya.sync(function(state) - if state.save.method == "yazi" then - ps.sub_remote(state.save.yazi_load_event, function(body) - state.projects = body - end) - elseif state.save.method == "lua" then - local f = io.open(state.save.lua_save_path, "r") - if f then - state.projects = state.json.decode(f:read("*a")) - io.close(f) - end - end - - if not state.projects then - state.projects = _get_default_projects() - end - - if state.last.load_after_start then - local last_project = _get_projects().last - if last_project then - load_project(last_project) - end - end -end) - -local delete_all_projects = ya.sync(function(state) - _save_projects(_get_default_projects()) - - local msg = "All projects deleted" - - if state.event.delete_all.enable then - ps.pub_to(0, state.event.delete_all.name, msg) - end - - if state.notify.enable then - _notify(msg) - end -end) - -local delete_project = ya.sync(function(state, idx) - local projects = _get_projects() - - local message = string.format([["%s" deleted]], tostring(projects.list[idx].desc)) - - local deleted_project = projects.list[idx] - table.remove(projects.list, idx) - _save_projects(projects) - - if state.event.delete.enable then - ps.pub_to(0, state.event.delete.name, deleted_project) - end - - if state.notify.enable then - _notify(message) - end -end) - -local merge_project = ya.sync(function(state, opt) - local project = _get_current_project() - project.opt = opt or "all" - ps.pub_to(0, state.merge.event, project) - - if state.event.merge.enable then - ps.pub_to(0, state.event.merge.name, project) - end - - if state.merge.quit_after_merge then - ya.emit("quit", {}) - end -end) - -local _merge_tab = ya.sync(function(state, tab) - ya.emit("tab_create", { tab.cwd }) -end) - -local _merge_event = ya.sync(function(state) - ps.sub_remote(state.merge.event, function(body) - if body then - local active_idx = tonumber(cx.tabs.idx) - - local opt = body.opt - if opt == "all" then - local sorted_tabs = {} - for _, tab in pairs(body.tabs) do - sorted_tabs[tonumber(tab.idx)] = tab - end - - for _, tab in ipairs(sorted_tabs) do - _merge_tab(tab) - end - - if state.notify.enable then - local message = "A project is merged" - _notify(message) - end - elseif opt == "current" then - local tab = body.tabs[tonumber(body.active_idx)] - _merge_tab(tab) - - if state.notify.enable then - local message = "A tab is merged" - _notify(message) - end - end - - ya.emit("tab_switch", { active_idx - 1 }) - end - end) -end) - -local _find_project_index = ya.sync(function(state, list, search_term) - if not search_term then - return nil - end - - for i, project in ipairs(list) do - -- Match the project by the "on" key or by "desc" - if project.on == search_term or project.desc == search_term then - return i - end - end - - return nil -end) - -local _load_config = ya.sync(function(state, opts) - state.event = { - save = { - enable = true, - name = "project-saved", - }, - load = { - enable = true, - name = "project-loaded", - }, - delete = { - enable = true, - name = "project-deleted", - }, - delete_all = { - enable = true, - name = "project-deleted-all", - }, - merge = { - enable = true, - name = "project-merged", - }, - } - if type(opts.event) == "table" then - if type(opts.event.save) == "table" then - if type(opts.event.save.enable) == "boolean" then - state.event.save.enable = opts.event.save.enable - end - if type(opts.event.save.name) == "string" then - state.event.save.name = opts.event.save.name - end - elseif type(opts.event.save) == "boolean" then - state.event.save.enable = opts.event.save - end - if type(opts.event.load) == "table" then - if type(opts.event.load.enable) == "boolean" then - state.event.load.enable = opts.event.load.enable - end - if type(opts.event.load.name) == "string" then - state.event.load.name = opts.event.load.name - end - elseif type(opts.event.load) == "boolean" then - state.event.load.enable = opts.event.load - end - if type(opts.event.delete) == "table" then - if type(opts.event.delete.enable) == "boolean" then - state.event.delete.enable = opts.event.delete.enable - end - if type(opts.event.delete.name) == "string" then - state.event.delete.name = opts.event.delete.name - end - elseif type(opts.event.delete) == "boolean" then - state.event.delete.enable = opts.event.delete - end - if type(opts.event.delete_all) == "table" then - if type(opts.event.delete_all.enable) == "boolean" then - state.event.delete_all.enable = opts.event.delete_all.enable - end - if type(opts.event.delete_all.name) == "string" then - state.event.delete_all.name = opts.event.delete_all.name - end - elseif type(opts.event.delete_all) == "boolean" then - state.event.delete_all.enable = opts.event.delete_all - end - if type(opts.event.merge) == "table" then - if type(opts.event.merge.enable) == "boolean" then - state.event.merge.enable = opts.event.merge.enable - end - if type(opts.event.merge.name) == "string" then - state.event.merge.name = opts.event.merge.name - end - elseif type(opts.event.merge) == "boolean" then - state.event.merge.enable = opts.event.merge - end - end - - state.save = { - method = "yazi", - yazi_load_event = "@projects-load", - lua_save_path = "", - } - if type(opts.save) == "table" then - if type(opts.save.method) == "string" then - state.save.method = opts.save.method - end - if type(opts.save.yazi_load_event) == "string" then - state.save.yazi_load_event = opts.save.yazi_load_event - end - if type(opts.save.lua_save_path) == "string" then - state.save.lua_save_path = opts.save.lua_save_path - else - local lua_save_path - local appdata = os.getenv("APPDATA") - if appdata then - lua_save_path = appdata:gsub("\\", "/") .. "/yazi/state/projects.json" - else - lua_save_path = os.getenv("HOME") .. "/.local/state/yazi/projects.json" - end - - state.save.lua_save_path = lua_save_path - end - end - - state.last = { - update_after_save = true, - update_after_load = true, - update_before_quit = false, - load_after_start = false, - } - if type(opts.last) == "table" then - if type(opts.last.update_after_save) == "boolean" then - state.last.update_after_save = opts.last.update_after_save - end - if type(opts.last.update_after_load) == "boolean" then - state.last.update_after_load = opts.last.update_after_load - end - if type(opts.last.update_before_quit) == "boolean" then - state.last.update_before_quit = opts.last.update_before_quit - end - if type(opts.last.load_after_start) == "boolean" then - state.last.load_after_start = opts.last.load_after_start - end - end - if state.last.update_before_quit then - ps.sub("key-quit", function(body) - local projects = _get_projects() - local current_project = _get_current_project() - projects.last = current_project - _save_projects(projects) - - if state.event.save.enable then - ps.pub_to(0, state.event.save.name, current_project) - end - - ya.emit("quit", {}) - return true - end) - end - - state.merge = { - event = "projects-merge", - quit_after_merge = false, - } - if type(opts.merge) == "table" then - if type(opts.merge.event) == "string" then - state.merge.event = opts.merge.event - end - if type(opts.merge.quit_after_merge) == "boolean" then - state.merge.quit_after_merge = opts.merge.quit_after_merge - end - end - - state.notify = { - enable = true, - title = "Projects", - timeout = 3, - level = "info", - } - if type(opts.notify) == "table" then - if type(opts.notify.enable) == "boolean" then - state.notify.enable = opts.notify.enable - end - if type(opts.notify.title) == "string" then - state.notify.title = opts.notify.title - end - if type(opts.notify.timeout) == "number" then - state.notify.timeout = opts.notify.timeout - end - if type(opts.notify.level) == "string" then - state.notify.level = opts.notify.level - end - end -end) - -return { - setup = function(state, opts) - state.json = require(".json") - _load_config(opts) - _load_projects() - _merge_event() - end, - entry = function(_, job) - local action = job.args[1] - if not action then - return - end - - if action == "delete_all" then - delete_all_projects() - return - end - - if action == "merge" then - local opt = job.args[2] - merge_project(opt) - return - end - - local projects = _get_projects() - - if action == "load_last" then - local last_project = projects.last - if last_project then - load_project(last_project) - end - return - end - - local list = projects.list - - if action == "save" then - -- load the desc of saved projects - for _, value in pairs(list) do - local idx = SUPPORTED_KEYS_MAP[value.on] - if idx then - SUPPORTED_KEYS[idx].desc = value.desc - end - end - - local idx = ya.which({ cands = SUPPORTED_KEYS, silent = false }) - if not idx then - return - end - - -- if target is not empty, use the saved desc as default desc - local default_desc = SUPPORTED_KEYS[idx].desc or string.format("Project %s", SUPPORTED_KEYS[idx].on) - local value, event = ya.input({ - pos = { "center", w = 40 }, - title = "Project name:", - value = default_desc, - }) - if event ~= 1 then - return - end - - local desc - if value ~= "" then - desc = value - else - desc = default_desc - end - - save_project(idx, desc) - return - end - - -- Search for the project, if an argument was given - -- Or ask interactively - local selected_idx = _find_project_index(list, job.args[2]) or ya.which({ cands = list, silent = false }) - if not selected_idx then - return - end - - if action == "load" then - local selected = list[selected_idx] - load_project(selected.project, selected.desc) - elseif action == "delete" then - delete_project(selected_idx) - end - end, -} diff --git a/yazi_1/.config/yazi/plugins/recycle-bin.yazi/LICENSE b/yazi_1/.config/yazi/plugins/recycle-bin.yazi/LICENSE deleted file mode 100644 index ef3a9f3..0000000 --- a/yazi_1/.config/yazi/plugins/recycle-bin.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Robert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/recycle-bin.yazi/README.md b/yazi_1/.config/yazi/plugins/recycle-bin.yazi/README.md deleted file mode 100644 index 88c486f..0000000 --- a/yazi_1/.config/yazi/plugins/recycle-bin.yazi/README.md +++ /dev/null @@ -1,183 +0,0 @@ -

- Trash emoji -

-

recycle-bin.yazi

- -

- - Yazi 0.25+ - - - -

- -

-A blazing fast, minimal Recycle Bin for the Yazi terminal file‑manager. -

- -## đŸ•¶ïž What does it do? - -Browse, restore, or permanently delete trashed files without leaving your terminal. Includes age-based cleanup and bulk actions. - - - -> [!NOTE] -> -> **Cross-Platform Support** -> -> This plugin supports Linux and macOS systems. - -## 🧠 What it does under the hood - -This plugin serves as a wrapper for the [trash-cli](https://github.com/andreafrancia/trash-cli) command, integrating it seamlessly with Yazi. - -## ✹ Features - -- **📂 Browse trash**: Navigate to trash directory directly in Yazi -- **🔄 Restore files**: Bulk restore selected files from trash to their original locations - - **⚠ Conflict resolution**: Intelligent handling when restored files already exist at destination - - **đŸ›Ąïž Safety dialogs**: Preview conflicts with skip/overwrite options before restoration -- **đŸ—‘ïž Empty trash**: Clear entire trash with detailed file previews and confirmation dialog -- **📅 Empty by days**: Remove trash items older than specified number of days with size information -- **❌ Permanent delete**: Bulk delete selected files from trash permanently -- **🔧 Configurable**: Customize trash directory - -## 📋 Requirements - -| Software | Minimum | Notes | -| --------- | ----------- | ----------------------------------------------------------------------------------------- | -| Yazi | `>=25.5.31` | untested on 25.6+ | -| trash-cli | any | **Linux**: `sudo dnf/apt/pacman install trash-cli`
**macOS**: `brew install trash-cli` | - -The plugin uses the following trash-cli commands: `trash-list`, `trash-empty`, `trash-restore`, and `trash-rm`. - -## 📩 Installation - -Install the plugin via Yazi's package manager: - -```sh -# via Yazi’s package manager -ya pkg add uhs-robert/recycle-bin -``` - -Then add the following to your `~/.config/yazi/init.lua` to enable the plugin with default settings: - -```lua -require("recycle-bin"):setup() -``` - -## ⚙ Configuration - -The plugin automatically discovers your system's trash directories using `trash-list --trash-dirs`. If you need to customize the behavior, you can pass a config table to `setup()`: - -```lua -require("recycle-bin"):setup({ - -- Optional: Override automatic trash directory discovery - -- trash_dir = "~/.local/share/Trash/", -- Uncomment to use specific directory -}) -``` - -> [!NOTE] -> The plugin supports multiple trash directories and will prompt you to choose which one to use if multiple are found. - -## đŸŽč Key Mapping - -### đŸ—ïž Recommended: Preset - -Add this to your `~/.config/yazi/keymap.toml` (substitute `on = ["R","b"]` with your keybind preference): - -```toml -[mgr] -prepend_keymap = [ - { on = ["R","b"], run = "plugin recycle-bin", desc = "Open Recycle Bin menu" }, -] -``` - -The `R b` menu provides access to all trash management functions: - -- `o` → Open Trash -- `r` → Restore from Trash -- `d` → Delete from Trash -- `e` → Empty Trash -- `D` → Empty by Days - -> [!TIP] -> `recycle-bin.yazi` uses the [array form for its keymap example](https://yazi-rs.github.io/docs/configuration/keymap). -> You must pick **only one style** per file; mixing with `[[mgr.prepend_keymap]]` will fail. -> -> **Also note:** some plugins may suggest binding a bare key like `on = "R"`, -> which blocks all `R ` chords (including `R b`). Change those to chords -> (e.g. `["R","r"]`) or choose a different non-conflicting prefix. - ---- - -### đŸ› ïž Alternative: Custom direct keybinds - -If you prefer direct keybinds, you may also set your own using our API. Here are the available options: - -```toml -[mgr] -prepend_keymap = [ - { on = ["R","o"], run = "plugin recycle-bin -- open", desc = "Open Trash" }, - { on = ["R","e"], run = "plugin recycle-bin -- empty", desc = "Empty Trash" }, - { on = ["R","D"], run = "plugin recycle-bin -- emptyDays", desc = "Empty by days deleted" }, - { on = ["R","d"], run = "plugin recycle-bin -- delete", desc = "Delete from Trash" }, - { on = ["R","r"], run = "plugin recycle-bin -- restore", desc = "Restore from Trash" }, -] -``` - -> [!IMPORTANT] -> Remember that you are the only one who is responsible for managing and resolving your keybind conflicts. - -## 🚀 Usage - -### 📝 Example using the recommended preset - -- **Recycle Bin Menu (`R b`):** Opens an interactive menu with all trash management options - - **Open Trash (`o`):** Navigate to trash directory directly in Yazi - - **Restore from Trash (`r`):** Bulk restore selected files from trash to their original locations. The plugin automatically detects conflicts when files already exist at the original location and prompts you to skip or overwrite conflicting files with detailed information. - - **Delete from Trash (`d`):** Permanently delete selected files from trash. Shows confirmation dialog before deletion. - - **Empty Trash (`e`):** Clear entire trash with detailed file previews including names, sizes, and deletion dates before confirmation. - - **Empty by Days (`D`):** Remove trash items older than specified number of days (defaults to 30 days). Displays filtered list with file details and total size information. - -> [!TIP] -> Use Yazi's visual selection (`v` or `V` followed by `ESC` to select items) or toggle select (press `Space` on individual files) to select multiple files from the Trash before restoring or deleting -> -> The plugin will show a confirmation dialog for destructive operations - -## đŸ› ïž Troubleshooting - -### Common Issues - -**"trashcli not found" error:** - -- Ensure trash-cli is installed: `sudo dnf/apt/pacman install trash-cli` -- Verify installation: `trash-list --version` -- Check if trash-cli commands are in your PATH - -**"Trash directory not found" error:** - -- The plugin automatically discovers trash directories using `trash-list --trash-dirs` -- If no directories are found, create the standard location: - - **Linux**: `mkdir -p ~/.local/share/Trash/{files,info}` - - **macOS**: `mkdir -p ~/.Trash` -- You can also specify a custom path in your configuration - -**"No files selected" warning:** - -- Make sure you have files selected in Yazi before running restore/delete operations -- Use `Space` to select files or `v`/`V` for visual selection mode - -## 💡 Recommendations - -### Companion Plugin - -For an even better trash management experience, pair this plugin with: - -**[restore.yazi](https://github.com/boydaihungst/restore.yazi)** - Undo your delete history by your latest deleted files/folders - -This companion plugin adds an "undo" feature that lets you press `u` to instantly restore the last deleted file. You can keep hitting `u` repeatedly to step through your entire delete history, making accidental deletions a thing of the past. - -**Perfect combination:** Use `restore.yazi` for quick single-file undos and `recycle-bin.yazi` for comprehensive trash management and bulk operations. diff --git a/yazi_1/.config/yazi/plugins/recycle-bin.yazi/main.lua b/yazi_1/.config/yazi/plugins/recycle-bin.yazi/main.lua deleted file mode 100644 index ed6a8bb..0000000 --- a/yazi_1/.config/yazi/plugins/recycle-bin.yazi/main.lua +++ /dev/null @@ -1,1469 +0,0 @@ --- main.lua --- Trash management system for Yazi - ---=========== Plugin Settings ================================================= -local isDebugEnabled = false -local M = {} -local PLUGIN_NAME = "recycle-bin" -local USER_ID = ya.uid() -local XDG_RUNTIME_DIR = os.getenv("XDG_RUNTIME_DIR") or ("/run/user/" .. USER_ID) - ---=========== Compiled Patterns (Performance Optimization) ================== --- Pre-compiled string patterns for better performance -local PATTERNS = { - filename = "([^/]+)$", - trash_list = "^(%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d) (.+)$", - line_break = "[^\n]+", - line_break_crlf = "[^\r\n]+", - size_info = "^(%S+)", - whitespace_cleanup = "[\r\n]+", - trailing_space = "%s+$", - first_word = "%l", - upper_first = "^%l", -} - ---=========== Plugin State =========================================================== ----@enum -local STATE_KEY = { - CONFIG = "CONFIG", -} - ---================= Notify / Logger =========================================== -local TIMEOUTS = { - error = 8, - warn = 8, - info = 3, -} -local Notify = {} ----@param level "info"|"warn"|"error"|nil ----@param s string ----@param ... any -function Notify._send(level, s, ...) - debug(s, ...) - local content = Notify._parseContent(s, ...) - local entry = { - title = PLUGIN_NAME, - content = content, - timeout = TIMEOUTS[level] or 3, - level = level, - } - ya.notify(entry) -end - -function Notify._parseContent(s, ...) - local ok, content = pcall(string.format, s, ...) - if not ok then content = s end - content = tostring(content):gsub(PATTERNS.whitespace_cleanup, " "):gsub(PATTERNS.trailing_space, "") - return content -end - -function Notify.error(...) - ya.err(...) - Notify._send("error", ...) -end -function Notify.warn(...) - Notify._send("warn", ...) -end -function Notify.info(...) - Notify._send("info", ...) -end -function debug(...) - if isDebugEnabled then - local msg = Notify._parseContent(...) - ya.dbg(msg) - end -end - ---========= Run terminal commands ======================================================= ----@param cmd string ----@param args? string[] ----@param input? string -- optional stdin input (e.g., password) ----@param is_silent? boolean ----@return string|nil, Output|nil -local function run_command(cmd, args, input, is_silent) - debug("Executing command: " .. cmd .. (args and #args > 0 and (" " .. table.concat(args, " ")) or "")) - local msgPrefix = "Command: " .. cmd .. " - " - local cmd_obj = Command(cmd) - - -- Add arguments - if type(args) == "table" and #args > 0 then - for _, arg in ipairs(args) do - cmd_obj:arg(arg) - end - end - - -- Set stdin mode if input is provided - if input then - cmd_obj:stdin(Command.PIPED) - else - cmd_obj:stdin(Command.INHERIT) - end - - -- Set other streams - cmd_obj:stdout(Command.PIPED):stderr(Command.PIPED):env("XDG_RUNTIME_DIR", XDG_RUNTIME_DIR) - - local child, cmd_err = cmd_obj:spawn() - if not child then - if not is_silent then Notify.error(msgPrefix .. "Failed to start. Error: %s", tostring(cmd_err)) end - return cmd_err and tostring(cmd_err), nil - end - - -- Send stdin input if available - if input then - local ok, err = child:write_all(input) - if not ok then - if not is_silent then Notify.error(msgPrefix .. "Failed to write, stdin: %s", tostring(err)) end - return err and tostring(err), nil - end - - local flushed, flush_err = child:flush() - if not flushed then - if not is_silent then Notify.error(msgPrefix .. "Failed to flush, stdin: %s", tostring(flush_err)) end - return flush_err and tostring(flush_err), nil - end - end - - -- Read output - local output, out_err = child:wait_with_output() - if not output then - if not is_silent then Notify.error(msgPrefix .. "Failed to get output, error: %s", tostring(out_err)) end - return out_err and tostring(out_err), nil - end - - -- Log outputs - if output.stdout ~= "" and not is_silent then debug(msgPrefix .. "stdout: %s", output.stdout) end - if output.status and output.status.code ~= 0 and not is_silent then - debug(msgPrefix .. "Error code `%s`, success: `%s`", output.status.code, tostring(output.status.success)) - end - - -- Handle child output error - if output.stderr ~= "" then - if not is_silent then debug(msgPrefix .. "stderr: %s", output.stderr) end - -- Only treat stderr as error if command actually failed - if output.status and not output.status.success then return output.stderr, output end - end - - return nil, output -end - ---========= Sync helpers ======================================================= -local set_state = ya.sync(function(state, key, value) - state[key] = value -end) - -local get_state = ya.sync(function(state, key) - return state[key] -end) - ---- Get and return string of the pwd/cwd ----@return string -- the current working directory -local get_cwd = ya.sync(function() - return tostring(cx.active.current.cwd) -end) - ----Get selected files from Yazi ----@return string[] -local get_selected_files = ya.sync(function() - local tab, paths = cx.active, {} - for _, u in pairs(tab.selected) do - paths[#paths + 1] = tostring(u) - end - if #paths == 0 and tab.current.hovered then paths[1] = tostring(tab.current.hovered.url) end - return paths -end) - ----Clear the current selection in Yazi -local function clear_selection() - -- Use Yazi's manager_emit to properly clear all selections - ya.manager_emit("select_all", { state = false }) -end - ---=========== Utils ================================================= ---- Deep merge two tables: overrides take precedence ----@param defaults table ----@param overrides table|nil ----@return table -local function deep_merge(defaults, overrides) - if type(overrides) ~= "table" then return defaults end - - local result = {} - - for k, v in pairs(defaults) do - if type(v) == "table" and type(overrides[k]) == "table" then - result[k] = deep_merge(v, overrides[k]) - else - result[k] = overrides[k] ~= nil and overrides[k] or v - end - end - - -- Include any keys in overrides not in defaults - for k, v in pairs(overrides) do - if result[k] == nil then result[k] = v end - end - - return result -end - ----Show an input box. ----@param title string ----@param is_password boolean? ----@param value string? ----@return string|nil -local function prompt(title, is_password, value) - debug("Prompting user for `%s`, is password: `%s`", title, is_password) - local input_value, input_event = ya.input({ - title = title, - value = value or "", - obscure = is_password or false, - pos = { "center", y = 3, w = 60 }, - }) - - if input_event ~= 1 then return nil end - - return input_value -end - ----Create standardized ui.Text with common styling ----@param lines string|string[] Single line or array of lines ----@return table ui.Text object with standard alignment and wrapping -local function create_ui_list(lines) - local line_objects = {} - if type(lines) == "string" then - table.insert(line_objects, ui.Line(lines)) - else - for _, line in ipairs(lines) do - table.insert(line_objects, ui.Line(line)) - end - end - return ui.Text(line_objects):align(ui.Align.LEFT):wrap(ui.Wrap.YES) -end - ----Show a confirmation box. ----@param title string|table Confirmation title (string or structured ui.Line) ----@param body string|string[]|table? Confirmation body (string, string array, or structured ui.Text) ----@param posOpts ui.Pos? A table of position options (e.g. {"center", w = 70, h = 40, x = 0, y = 0}) ----@return boolean -local function confirm(title, body, posOpts) - local title_str = type(title) == "string" and title or tostring(title) - debug("Confirming user action for `%s`", title_str) - local pos = { - posOpts and posOpts[1] or "center", - w = posOpts and posOpts.w or 70, - h = posOpts and posOpts.h or 40, - x = posOpts and posOpts.x or 0, - y = posOpts and posOpts.y or 0, - } - - local confirmation_data = { - title = type(title) == "string" and ui.Line(title) or title, - pos = pos, - } - - if body then - -- Handle different body types - if type(body) == "string" then - confirmation_data.content = create_ui_list(body) - confirmation_data.body = create_ui_list(body) - elseif type(body) == "table" and body[1] and type(body[1]) == "string" then - -- Array of strings - confirmation_data.content = create_ui_list(body) - confirmation_data.body = create_ui_list(body) - else - -- Structured UI component (ui.Text) - confirmation_data.content = body - confirmation_data.body = body - end - end - - local answer = ya.confirm(confirmation_data) - return answer -end - ----Present a simple which‑key style selector and return the chosen item (Max: 36 options). ----@param title string ----@param items string[] ----@return string|nil -local function choose_which(title, items) - local keys = "1234567890abcdefghijklmnopqrstuvwxyz" - local candidates = {} - for i, item in ipairs(items) do - if i > #keys then break end - candidates[#candidates + 1] = { on = keys:sub(i, i), desc = item } - end - - local idx = ya.which({ title = title, cands = candidates }) - return idx and items[idx] -end - ---============== File helpers ==================================== ----Check if a path exists and is a directory ----@param url Url ----@return boolean -local function is_dir(url) - local cha, _ = fs.cha(url) - return cha and cha.is_dir or false -end - ----Get file size in bytes using fs.cha() ----@param file_path string Absolute path to the file ----@return integer|nil, string|nil -- size_in_bytes, error_message -local function get_file_size(file_path) - local url = Url(file_path) - local cha, err = fs.cha(url) - - if not cha then - local error_msg = string.format("Failed to get file info for %s: %s", file_path, err or "unknown error") - debug(error_msg) - return nil, error_msg - end - - if not cha.len then - local error_msg = string.format("File size not available for %s", file_path) - debug(error_msg) - return nil, error_msg - end - - return cha.len, nil -end - ----Format bytes into human-readable format (B, KB, MB, GB, TB) ----@param bytes integer|nil Number of bytes to format ----@return string Formatted size string -local function format_file_size(bytes) - if not bytes or bytes < 0 then return "0 B" end - - local units = { "B", "KB", "MB", "GB", "TB" } - local size = bytes - local unit_index = 1 - - -- Convert to larger units while size >= 1024 and we have larger units - while size >= 1024 and unit_index < #units do - size = size / 1024 - unit_index = unit_index + 1 - end - - -- Format with appropriate decimal places - if unit_index == 1 then - -- Bytes - no decimal places - return string.format("%d %s", size, units[unit_index]) - elseif size >= 100 then - -- >= 100 units - no decimal places (e.g., "156 MB") - return string.format("%.0f %s", size, units[unit_index]) - elseif size >= 10 then - -- >= 10 units - one decimal place (e.g., "15.6 MB") - return string.format("%.1f %s", size, units[unit_index]) - else - -- < 10 units - two decimal places (e.g., "1.56 MB") - return string.format("%.2f %s", size, units[unit_index]) - end -end - ----Get file objects with size information for multiple files ----@param file_paths string[] Array of file paths/names to process ----@param base_dir string Base directory where files are located (e.g., "~/.local/share/Trash/files/") ----@return {name: string, size: string}[] Array of file objects with name and size -local function get_files_with_sizes(file_paths, base_dir) - debug("Getting file sizes for %d files from base directory: %s", #file_paths, base_dir) - - local file_objects = {} - - -- Ensure base_dir ends with a slash for proper path construction - local normalized_base_dir = base_dir - if not normalized_base_dir:match("/$") then normalized_base_dir = normalized_base_dir .. "/" end - - for i, file_path in ipairs(file_paths) do - -- Extract filename from the path - local filename = file_path:match(PATTERNS.filename) or file_path - - -- Construct full path to the file in the base directory - local full_path = normalized_base_dir .. filename - - -- Get file size using existing utility function - local bytes, size_err = get_file_size(full_path) - local formatted_size - - if size_err then - -- Log the error but continue processing other files - debug("Could not get size for file %s: %s", filename, size_err) - formatted_size = "unknown size" - else - -- Format the size using existing utility function - formatted_size = format_file_size(bytes) - end - - -- Create file object with name and size - file_objects[i] = { - name = filename, - size = formatted_size, - } - end - - debug("Successfully processed %d file objects", #file_objects) - return file_objects -end - ---=========== Trash helpers ================================================= ----Get available trash directories from trash-cli ----@return string[], string|nil -- trash_dirs, error -local function get_trash_directories() - local err, output = run_command("trash-list", { "--trash-dirs" }, nil, true) - if err then return {}, err end - - local directories = {} - if output and output.stdout ~= "" then - for line in output.stdout:gmatch(PATTERNS.line_break) do - local trimmed = line:gsub("^%s*(.-)%s*$", "%1") -- trim whitespace - if trimmed ~= "" then - -- Ensure directory path ends with / - if not trimmed:match("/$") then trimmed = trimmed .. "/" end - table.insert(directories, trimmed) - end - end - end - - debug("Found %d trash directories: %s", #directories, table.concat(directories, ", ")) - return directories, nil -end - ----Get the correct trash files directory path based on OS ----@param config table Configuration object containing trash_dir and os ----@return string -- trash_files_directory_path -local function get_trash_files_dir(config) - local trash_files_dir = config.trash_dir - -- On Linux, trash files are in a 'files' subdirectory - if config.os ~= "macos" then - -- Ensure trash_dir ends with / before adding 'files' - if not trash_files_dir:match("/$") then trash_files_dir = trash_files_dir .. "/" end - trash_files_dir = trash_files_dir .. "files" - end - return trash_files_dir -end - ----Verify trash dir exists ----@param config table | nil -local function check_has_trash_directory(config) - -- Get Config - if not config then config = get_state(STATE_KEY.CONFIG) end - -- Verify trash dir - local trash_dir = config.trash_dir - local trash_url = Url(trash_dir) - - if not is_dir(trash_url) then - Notify.error("Trash directory not found: %s. Please check your configuration.", trash_dir) - return false - end - - return true -end - ----Select trash directory from available options ----@param directories string[] Array of trash directory paths ----@return string|nil -- selected_directory -local function select_trash_directory(directories) - if #directories == 0 then return nil end - - -- If only one directory, use it automatically - if #directories == 1 then - debug("Using single trash directory: %s", directories[1]) - return directories[1] - end - - -- Multiple directories - present user with selection - debug("Multiple trash directories found, prompting user selection") - local selected_dir = choose_which("Select trash directory:", directories) - - if selected_dir then - debug("User selected trash directory: %s", selected_dir) - else - debug("User cancelled trash directory selection") - end - - return selected_dir -end - ----Ensure trash directory is set, prompting user if needed ----@param config table ----@return boolean -- true if trash directory is available, false if cancelled or error -local function ensure_trash_directory(config) - -- If trash directory is already set and exists, we're good - if config.trash_dir and check_has_trash_directory(config) then return true end - - -- Get available trash directories - local directories, dir_err = get_trash_directories() - if dir_err then - Notify.error( - "Failed to discover trash directories: %s. Try 'trash-list --trash-dirs' manually to verify trash directories", - dir_err - ) - return false - end - - if #directories == 0 then - Notify.error("No trash directories found. Please check trash-cli installation.") - return false - end - - -- Let user select which trash directory to use - local selected_dir = select_trash_directory(directories) - if not selected_dir then - Notify.info("Trash directory selection cancelled") - return false - end - - -- Save the selected trash directory to config for this session - config.trash_dir = selected_dir - set_state(STATE_KEY.CONFIG, config) - debug("Updated trash_dir for this session: %s", selected_dir) - - return true -end - ----Get mapping of filenames to original paths from trash-list ----@return table, string|nil -- filename_to_path_map, error -local function get_trash_file_mappings() - local err, output = run_command("trash-list", {}) - if err then return {}, err end - - local mappings = {} - if output and output.stdout ~= "" then - for line in output.stdout:gmatch(PATTERNS.line_break) do - local timestamp, original_path = line:match(PATTERNS.trash_list) - if timestamp and original_path then - local filename = original_path:match(PATTERNS.filename) or original_path - mappings[filename] = original_path - end - end - end - - debug("Created %d trash file mappings", #mappings) - return mappings, nil -end - ----Get all files in trash with their sizes for display ----@param config table Configuration object ----@return {name: string, size: string}[], string|nil -- file_objects, error -local function get_trash_files_with_sizes(config) - -- Get all files from trash-list - local err, output = run_command("trash-list", {}) - if err then return {}, err end - - local file_names = {} - if output and output.stdout ~= "" then - for line in output.stdout:gmatch(PATTERNS.line_break) do - local timestamp, original_path = line:match(PATTERNS.trash_list) - if timestamp and original_path then - local filename = original_path:match(PATTERNS.filename) or original_path - table.insert(file_names, filename) - end - end - end - - if #file_names == 0 then return {}, nil end - - -- Get file objects with sizes using existing function - local trash_files_dir = get_trash_files_dir(config) - local file_objects = get_files_with_sizes(file_names, trash_files_dir) - - debug("Retrieved %d trash files with sizes", #file_objects) - return file_objects, nil -end - ----Get trash files older than specified days with their sizes for display ----@param config table Configuration object ----@param days integer Number of days - files older than this will be included ----@return {name: string, size: string, deleted_date: string}[], string|nil -- file_objects, error -local function get_trash_files_older_than_days(config, days) - -- Get all files from trash-list - local err, output = run_command("trash-list", {}) - if err then return {}, err end - - -- Calculate cutoff time (days ago from now) - local current_time = os.time() - local cutoff_time = current_time - (days * 24 * 60 * 60) -- days * hours * minutes * seconds - - local old_files = {} - if output and output.stdout ~= "" then - for line in output.stdout:gmatch(PATTERNS.line_break) do - local timestamp, original_path = line:match(PATTERNS.trash_list) - if timestamp and original_path then - -- Parse timestamp: "2025-08-28 20:27:38" format - local year, month, day, hour, min, sec = timestamp:match("(%d+)-(%d+)-(%d+) (%d+):(%d+):(%d+)") - if year and month and day and hour and min and sec then - local file_time = os.time({ - year = tonumber(year), - month = tonumber(month), - day = tonumber(day), - hour = tonumber(hour), - min = tonumber(min), - sec = tonumber(sec), - }) - - -- If file is older than cutoff, include it - if file_time < cutoff_time then - local filename = original_path:match(PATTERNS.filename) or original_path - table.insert(old_files, { - filename = filename, - deleted_date = timestamp, - }) - end - end - end - end - end - - if #old_files == 0 then return {}, nil end - - -- Get file objects with sizes using existing function - local trash_files_dir = get_trash_files_dir(config) - local file_names = {} - for _, file_info in ipairs(old_files) do - table.insert(file_names, file_info.filename) - end - local file_objects = get_files_with_sizes(file_names, trash_files_dir) - - -- Add deleted date information to file objects - for i, file_obj in ipairs(file_objects) do - file_obj.deleted_date = old_files[i].deleted_date - end - - debug("Retrieved %d trash files older than %d days", #file_objects, days) - return file_objects, nil -end - ---- Go to the trash directory -local function open_trash(config) - -- Ensure we have a trash directory selected - if not ensure_trash_directory(config) then return end - - local trash_files_dir = get_trash_files_dir(config) - local trash_files_url = Url(trash_files_dir) - - -- Go to trash files directory if exists, fallback to trash root if not - if is_dir(trash_files_url) then - ya.emit("cd", { trash_files_url }) - else - local trash_root_url = Url(config.trash_dir) - if is_dir(trash_root_url) then - ya.emit("cd", { trash_root_url }) - Notify.info("Trash files directory not found, navigated to trash root: %s", config.trash_dir) - else - Notify.error("Trash directory not found: %s", config.trash_dir) - end - end -end - ----Offer to open trash directory when user attempts operations outside trash ----@param config table ----@return boolean -- true if user chose to navigate to trash and succeeded, false otherwise -local function offer_to_open_trash(config) - local user_wants_to_navigate = confirm("Not in Trash Directory", { - "This command can only be run from within a Trash directory.", - "Would you like to open the Trash now?", - }, { w = 70, h = 10, x = 0, y = 0 }) - - if not user_wants_to_navigate then - Notify.info("Operation cancelled") - return false - end - - -- Try to open trash directory - open_trash(config) - - -- Check if we successfully navigated to a trash directory - local current_dir = get_cwd() - local trash_dirs, dir_err = get_trash_directories() - if dir_err then - Notify.error("Failed to verify navigation: %s", dir_err) - return false - end - - for _, trash_dir in ipairs(trash_dirs) do - if current_dir:find(trash_dir, 1, true) == 1 then return true end - end - - Notify.error("Failed to navigate to trash directory") - return false -end - ----Resolve a path that might be a symlink to its real path using realpath command ----@param path string The path to resolve ----@return string -- The resolved path (or original if resolution fails) -local function resolve_symlink(path) - -- Use realpath command to resolve symlinks - local err, output = run_command("realpath", { path }, nil, true) - - if not err and output and output.stdout then - -- Remove trailing newline and return resolved path - local resolved = output.stdout:gsub("[\r\n]+$", "") - if resolved ~= "" then - debug("Resolved symlink: %s -> %s", path, resolved) - return resolved - end - end - - -- If resolution failed, return original path - debug("Could not resolve symlink for %s, using original path", path) - return path -end - ----Check if current working directory is within a valid trash directory ----If not, offer to navigate to trash directory ----@param config table ----@return boolean -- true if in trash directory or successfully navigated to trash, false otherwise -local is_current_dir_in_trash = function(config) - local current_dir = get_cwd() - -- Resolve symlinks in the current directory path - local resolved_dir = resolve_symlink(current_dir) - - local trash_dirs, dir_err = get_trash_directories() - if dir_err then - Notify.error( - "Failed to find trash directories: %s. Check trash-cli installation with 'trash-list --version'", - dir_err - ) - return false - end - - -- Check if already in trash directory (check both original and resolved paths) - for _, trash_dir in ipairs(trash_dirs) do - if current_dir:find(trash_dir, 1, true) == 1 or resolved_dir:find(trash_dir, 1, true) == 1 then return true end - end - - -- Not in trash directory - offer to navigate there - offer_to_open_trash(config) - return false -end - ----Get count of items in trash ----@return integer, string|nil -- count, error -local function get_trash_item_count() - local err, output = run_command("trash-list", {}) - if err then return 0, err end - - local item_count = 0 - if output and output.stdout ~= "" then - _, item_count = output.stdout:gsub(PATTERNS.line_break, "") - end - - return item_count, nil -end - ----Get size of trash files directory ----@param config table ----@return string, string|nil -- size_string, error -local function get_trash_size(config) - local trash_files_dir = get_trash_files_dir(config) - - local err, output = run_command("du", { "-sh", trash_files_dir }, nil, true) - if err or not output or output.stdout == "" then return "unknown size", err end - - local size_info = output.stdout:match(PATTERNS.size_info) - return size_info or "unknown size", nil -end - ----Get size of trash files directory ----@param config table ----@return {count: integer, size: string}|table, {type: string, msg: string}|nil -local function get_trash_data(config) - -- Default values - local count = 0 - local size = "0M" - - -- Get trash info - local item_count, count_err = get_trash_item_count() - if count_err then - return { count, size }, { type = "error", msg = string.format("Failed to get trash contents: %s", count_err) } - end - - if item_count == 0 then return { count, size }, { type = "info", msg = "Trash is already empty" } end - - local size_info, size_err = get_trash_size(config) - if size_err then debug("Failed to get trash size: %s", size_err) end - - return { - count = item_count, - size = size_info, - }, nil -end - ---=========== Conflict Resolution ================================================= ----Handle restore conflicts by checking if files exist at original locations ----@param restore_items table[] Array of restore items with original_path, filename, and size ----@return table[] non_conflicted_items, table[] conflicted_items -local function detect_restore_conflicts(restore_items) - local conflicts = {} - local non_conflicted_items = {} - - for _, item in ipairs(restore_items) do - local original_url = Url(item.original_path) - local cha, _ = fs.cha(original_url) - - if cha then -- File exists at original location - table.insert(conflicts, { - filename = item.filename, - original_path = item.original_path, - size = item.size, - }) - else - table.insert(non_conflicted_items, item) - end - end - - return non_conflicted_items, conflicts -end - ----Create overwrite warning dialog and get user confirmation ----@param conflicts table[] Array of conflicted items ----@return boolean true if user confirms overwrite, false otherwise -local function create_overwrite_warning_dialog(conflicts) - local overwrite_warning = { - "⚠ DESTRUCTIVE ACTION WARNING ⚠", - "", - "You are about to PERMANENTLY OVERWRITE existing files:", - } - for _, conflict in ipairs(conflicts) do - table.insert(overwrite_warning, string.format(" ‱ %s", conflict.original_path)) - end - table.insert(overwrite_warning, "") - table.insert(overwrite_warning, "The existing files will be LOST FOREVER!") - table.insert(overwrite_warning, "This action CANNOT BE UNDONE!") - - -- Create warning dialog with red styling - local warning_components = {} - for i, line in ipairs(overwrite_warning) do - if i == 1 then - -- Main warning title in red - table.insert(warning_components, ui.Line(line):style(th.notify.title_error)) - elseif line:match("^ ‱") then - -- File paths - table.insert(warning_components, ui.Line(line):style(th.notify.content)) - elseif line:match("LOST FOREVER") or line:match("CANNOT BE UNDONE") then - -- Critical warnings in red - table.insert(warning_components, ui.Line(line):style(th.notify.title_error)) - else - table.insert(warning_components, ui.Line(line)) - end - end - - local warning_body = ui.Text(warning_components):align(ui.Align.LEFT):wrap(ui.Wrap.YES) - return confirm(" CONFIRM DESTRUCTIVE ACTION ", warning_body, { w = 80, h = 20, x = 0, y = 0 }) -end - ----Handle overwrite choice confirmation ----@param conflicts table[] Array of conflicted items ----@return string "cancel"|"overwrite" User's final choice for overwrite action -local function handle_overwrite_choice(conflicts) - local confirmed = create_overwrite_warning_dialog(conflicts) - return confirmed and "overwrite" or "cancel" -end - ----Present conflict resolution dialog to user and return their choice ----@param conflicts table[] Array of conflicted items ----@param non_conflicted_count integer Number of non-conflicted items ----@return string "cancel"|"skip"|"overwrite" User's choice -local function prompt_conflict_resolution(conflicts, non_conflicted_count) - if non_conflicted_count > 0 then - -- Offer choice between cancel, skip conflicts, or overwrite all - local choices = { - "Cancel restore", - "Skip conflicts and restore others", - "⚠ Do not skip conflicts, restore ALL and OVERWRITE any conflicts", - } - local choice = choose_which("Resolve File Conflicts", choices) - - if choice == "Cancel restore" then - return "cancel" - elseif choice == "Skip conflicts and restore others" then - return "skip" - elseif choice == "⚠ Do not skip conflicts, restore ALL and OVERWRITE any conflicts" then - return handle_overwrite_choice(conflicts) - else - return "cancel" -- Default to cancel if no choice made - end - else - -- All files have conflicts - offer overwrite option - local choices = { "Cancel restore", "⚠ Do not skip conflicts, restore ALL and OVERWRITE any conflicts" } - local choice = choose_which("All Files Have Conflicts", choices) - - if choice == "⚠ Do not skip conflicts, restore ALL and OVERWRITE any conflicts" then - return handle_overwrite_choice(conflicts) - else - return "cancel" - end - end -end - ----Delete a single conflicting file or directory at its original location ----@param original_path string The path to the conflicting file/directory ----@return boolean success, string|nil error_message -local function delete_conflict_file(original_path) - local original_url = Url(original_path) - - -- Check if it's a file or directory to use the correct removal type - local cha, cha_err = fs.cha(original_url) - if not cha then - local error_msg = string.format("Cannot access conflicting item %s: %s", original_path, cha_err or "unknown error") - return false, error_msg - end - - local remove_type = cha.is_dir and "dir_all" or "file" - local delete_success, delete_err = fs.remove(remove_type, original_url) - - if delete_success then - debug("Successfully deleted conflicting %s: %s", cha.is_dir and "directory" or "file", original_path) - return true, nil - else - local error_msg = string.format( - "Failed to delete existing %s %s: %s", - cha.is_dir and "directory" or "file", - original_path, - delete_err or "unknown error" - ) - return false, error_msg - end -end - ----Handle restore conflicts and return filtered items based on user choice ----@param restore_items table[] Original restore items ----@return table[]|nil filtered_items (nil if user cancelled) -local function handle_restore_conflicts(restore_items) - local non_conflicted_items, conflicts = detect_restore_conflicts(restore_items) - - -- No conflicts found, proceed with all items - if #conflicts == 0 then return restore_items end - - -- Present conflict resolution dialog - local user_choice = prompt_conflict_resolution(conflicts, #non_conflicted_items) - - if user_choice == "cancel" then - return nil - elseif user_choice == "skip" then - if #non_conflicted_items == 0 then - Notify.info("No files to restore after skipping all conflicts") - return nil - end - Notify.info("Skipping %d conflicted files, proceeding with %d files", #conflicts, #non_conflicted_items) - return non_conflicted_items - elseif user_choice == "overwrite" then - -- Mark items that need overwrite and return all items - -- The actual deletion will happen when user confirms the restore operation - Notify.info("Selected overwrite option for %d conflicting files", #conflicts) - - -- Add overwrite metadata to restore items that have conflicts - for _, item in ipairs(restore_items) do - for _, conflict in ipairs(conflicts) do - if item.original_path == conflict.original_path then - item.needs_overwrite = true - break - end - end - end - - return restore_items -- Return all items, with overwrite flags set - end - - -- Fallback to cancel - return nil -end - ---=========== File Selection ================================================= ----Validates file selection and extracts filenames ----@param operation_name string The name of the operation (for logging/notifications) ----@return string[]|nil -- selected_paths -local function validate_and_get_selection(operation_name) - -- Get selected files from Yazi - local selected_paths = get_selected_files() - if #selected_paths == 0 then - Notify.warn("No files selected for " .. operation_name) - return nil - end - debug("Selected paths for %s: %s", operation_name, table.concat(selected_paths, ", ")) - return selected_paths -end - ---=========== Batch Operations ================================================= ----Shows standardized confirmation dialog for batch operations ----@param verb string Action verb (e.g., "delete", "restore") ----@param items {name: string, size: string, needs_overwrite: boolean?}[] List of file objects with name, size, and optional overwrite flag ----@param warning string|nil Optional warning message ----@return boolean -local function confirm_batch_operation(verb, items, warning) - local title = string.format("%s the following %d file(s):", verb:gsub(PATTERNS.upper_first, string.upper), #items) - - -- Create structured UI components for proper alignment and styling - local body_components = {} - - -- Add each item as a formatted line with proper left alignment showing "fileName (size)" - -- Show overwrite warning for files that will overwrite existing files - local overwrite_count = 0 - for _, item in ipairs(items) do - local display_text = string.format("%s (%s)", item.name, item.size) - if item.needs_overwrite then - overwrite_count = overwrite_count + 1 - -- Mark files that will overwrite with warning styling - table.insert( - body_components, - ui.Line({ - ui.Span(" ⚠ "), - ui.Span(display_text .. " [WILL OVERWRITE]"), - }):style(th.notify.title_warn) - ) - else - table.insert(body_components, ui.Line({ ui.Span(" "), ui.Span(display_text) }):align(ui.Align.LEFT)) - end - end - - -- Add overwrite warning if any files need overwriting - if overwrite_count > 0 then - table.insert(body_components, ui.Line("")) - table.insert( - body_components, - ui.Line(string.format("⚠ %d existing file(s) will be permanently deleted!", overwrite_count)) - :style(th.notify.title_error) - ) - end - - -- Add warning if provided with styling - if warning then - table.insert(body_components, ui.Line("")) - table.insert(body_components, ui.Line(warning):style(th.notify.title_warn)) - end - - local structured_body = ui.Text(body_components):align(ui.Align.LEFT):wrap(ui.Wrap.YES) - local confirmation = confirm(title, structured_body) - if not confirmation then - Notify.info(verb:gsub(PATTERNS.upper_first, string.upper) .. " cancelled") - return false - end - - return true -end - ----Shows confirmation dialog for batch operations with deletion dates ----@param verb string Action verb (e.g., "delete") ----@param items {name: string, size: string, deleted_date: string}[] List of file objects with name, size, and deletion date ----@param days integer Number of days used for filtering ----@param warning string|nil Optional warning message ----@return boolean -local function confirm_batch_operation_with_dates(verb, items, days, warning) - local title = string.format( - "%s the following %d file(s) older than %d days:", - verb:gsub(PATTERNS.upper_first, string.upper), - #items, - days - ) - - -- Create structured UI components for proper alignment and styling - local body_components = {} - - -- Add each item as a formatted line showing "fileName (size) - deleted: date" - for _, item in ipairs(items) do - local display_text = string.format("%s (%s) - deleted: %s", item.name, item.size, item.deleted_date) - table.insert(body_components, ui.Line({ ui.Span(" "), ui.Span(display_text) }):align(ui.Align.LEFT)) - end - - -- Add warning if provided with styling - if warning then - table.insert(body_components, ui.Line("")) - table.insert(body_components, ui.Line(warning):style(th.notify.title_warn)) - end - - local structured_body = ui.Text(body_components):align(ui.Align.LEFT):wrap(ui.Wrap.YES) - local confirmation = confirm(title, structured_body) - if not confirmation then - Notify.info(verb:gsub(PATTERNS.upper_first, string.upper) .. " cancelled") - return false - end - - return true -end - ----Executes batch operation with progress tracking and error handling ----@param items table[] Array of items to process (can be strings, file objects, or restore items) ----@param operation_name string Name of operation for notifications ----@param operation_func function Function that takes an item and returns error_string|nil ----@return integer, integer -- success_count, failed_count -local function execute_batch_operation(items, operation_name, operation_func) - local success_count = 0 - local failed_count = 0 - - for _, item in ipairs(items) do - local err = operation_func(item) - if err then - failed_count = failed_count + 1 - else - success_count = success_count + 1 - end - end - - return success_count, failed_count -end - ----Reports standardized operation results ----@param operation_name string Name of the operation ----@param success_count integer Number of successful operations ----@param failed_count integer Number of failed operations -local function report_operation_results(operation_name, success_count, failed_count) - local past_tense = operation_name == "deleting" and "deleted" - or operation_name == "restoring" and "restored" - or operation_name .. "d" - - if success_count > 0 and failed_count == 0 then - Notify.info("Successfully %s %d file(s)", past_tense, success_count) - elseif success_count > 0 and failed_count > 0 then - Notify.warn( - "%s %d file(s), failed %d", - past_tense:gsub(PATTERNS.upper_first, string.upper), - success_count, - failed_count - ) - else - Notify.error("Failed to %s any files", operation_name:gsub("ing$", "")) - end -end - ---=========== api actions ================================================= -local function cmd_open_trash(config) - open_trash(config) -end - -local function cmd_empty_trash(config) - -- Ensure we have a trash directory selected - if not ensure_trash_directory(config) then return end - - -- Get trash data - local data, data_err = get_trash_data(config) - if data_err then - Notify[data_err.type](data_err.msg) - return - end - - -- Get all trash files with their sizes for detailed display - local file_objects, file_err = get_trash_files_with_sizes(config) - if file_err then - Notify.error("Failed to get trash file list: %s", file_err) - return - end - - -- If no files found, show simple message - if #file_objects == 0 then - Notify.info("Trash is already empty") - return - end - - -- Show detailed confirmation dialog with file list and sizes - if not confirm_batch_operation("permanently delete", file_objects, "This action cannot be undone!") then return end - - -- Execute trash-empty command - local err, _ = run_command("trash-empty", {}, "y\n") - if err then - Notify.error("Failed to empty trash: %s. Try 'trash-empty' manually to debug", err) - return - end - Notify.info("Trash emptied successfully (%d items, %s freed)", data.count, data.size) -end - -local function cmd_empty_trash_by_days(config) - -- Ensure we have a trash directory selected - if not ensure_trash_directory(config) then return end - - -- Get trash data prior to the operation to calculate difference - local begin_data, begin_err = get_trash_data(config) - if begin_err then - Notify[begin_err.type](begin_err.msg) - return - end - - -- Prompt user for number of days - local days_input = prompt("Delete trash items older than (days)", false, "30") - if not days_input then - Notify.info("Empty trash by days cancelled") - return - end - - -- Validate input is a positive integer - local days = tonumber(days_input) - if not days or days <= 0 or math.floor(days) ~= days then - Notify.error("Invalid input: please enter a positive integer for days") - return - end - - -- Get files older than specified days with sizes and deletion dates - local file_objects, file_err = get_trash_files_older_than_days(config, days) - if file_err then - Notify.error("Failed to get trash file list: %s", file_err) - return - end - - -- If no files found that are older than the specified days - if #file_objects == 0 then - Notify.info("No items found that are older than %d days", days) - return - end - - -- Show detailed confirmation dialog with file list, sizes, and deletion dates - if - not confirm_batch_operation_with_dates("permanently delete", file_objects, days, "This action cannot be undone!") - then - return - end - - -- Execute trash-empty command with days parameter - local err, _ = run_command("trash-empty", { tostring(days) }, "y\n") - if err then - Notify.error("Failed to empty trash by days: %s", err) - return - end - - -- Get trash data after the operation to calculate difference - local end_data, end_err = get_trash_data(config) - if end_err then - Notify[end_err.type](end_err.msg) - return - end - - -- Calculate items deleted - local items_deleted = begin_data.count - end_data.count - if items_deleted > 0 then - Notify.info("Successfully removed %d trash items older than %d days", items_deleted, days) - else - Notify.info("No items found that are older than %d days", days) - end -end - -local function cmd_delete_selection(config) - -- Ensure we have a trash directory selected - if not ensure_trash_directory(config) then return end - - -- Check if current directory is within a valid trash directory - if not is_current_dir_in_trash(config) then return end - - -- Validate selection and get filenames - local selected_paths, _ = validate_and_get_selection("deletion") - if not selected_paths then return end - - -- Get file objects with sizes for confirmation dialog - local trash_files_dir = get_trash_files_dir(config) - -- Ensure it ends with / for get_files_with_sizes - if not trash_files_dir:match("/$") then trash_files_dir = trash_files_dir .. "/" end - local file_objects = get_files_with_sizes(selected_paths, trash_files_dir) - - -- Confirm deletion from trash with warning - if not confirm_batch_operation("permanently delete", file_objects, "This action cannot be undone!") then return end - - -- Create operation function for delete - local function delete_operation(path) - local filename = path:match(PATTERNS.filename) or path - - -- Use trash-rm with the filename as pattern - -- trash-rm uses fnmatch patterns, so we pass the filename directly - local delete_err, _ = run_command("trash-rm", { filename }) - if delete_err then - Notify.error("Failed to delete %s: %s", filename, delete_err) - return delete_err - else - return nil - end - end - - -- Execute batch operation - local success_count, failed_count = execute_batch_operation(selected_paths, "permanently deleting", delete_operation) - - -- Clear selection after successful delete to prevent stale selections - if success_count > 0 then clear_selection() end - - -- Report results - report_operation_results("deleting", success_count, failed_count) -end - -local function cmd_restore_selection(config) - -- Ensure we have a trash directory selected - if not ensure_trash_directory(config) then return end - - -- Check if current directory is within a valid trash directory - if not is_current_dir_in_trash(config) then return end - - -- Validate selection and get filenames - local selected_paths, _ = validate_and_get_selection("restoration") - if not selected_paths then return end - - -- Get trash file mappings from trash-list - local trash_mappings, mapping_err = get_trash_file_mappings() - if mapping_err then - Notify.error("Failed to get trash mappings: %s. Try 'trash-list' manually to verify trash contents", mapping_err) - return - end - - -- Prepare restore items with original paths and size information - local restore_items = {} - local trash_files_dir = get_trash_files_dir(config) - local normalized_trash_files_dir = trash_files_dir - if not normalized_trash_files_dir:match("/$") then normalized_trash_files_dir = normalized_trash_files_dir .. "/" end - - for _, path in ipairs(selected_paths) do - local filename = path:match(PATTERNS.filename) or path - local original_path = trash_mappings[filename] - - if original_path then - -- Get file size from trash files directory - local full_path = normalized_trash_files_dir .. filename - local bytes, size_err = get_file_size(full_path) - local formatted_size = size_err and "unknown size" or format_file_size(bytes) - - restore_items[#restore_items + 1] = { - filename = filename, - original_path = original_path, - name = filename, - size = formatted_size, - } - else - Notify.warn("Could not find original path for file: %s", filename) - end - end - - if #restore_items == 0 then - Notify.info("No files to restore in current trash directory") - return - end - - -- Handle potential conflicts at original file locations - local filtered_items = handle_restore_conflicts(restore_items) - if not filtered_items then - -- User cancelled or no valid items after conflict resolution - return - end - - -- Update restore_items to use filtered list - restore_items = filtered_items - - -- Confirm restoration - if not confirm_batch_operation("restore", restore_items, nil) then return end - - -- Create operation function for restore using original paths - local function restore_operation(item) - debug("Restoring %s from original path: %s", item.filename, item.original_path) - - -- If this item needs overwrite, delete the existing file/directory first - if item.needs_overwrite then - local delete_success, delete_error = delete_conflict_file(item.original_path) - if not delete_success then - Notify.error(delete_error) - return delete_error - end - end - - -- Use trash-restore with the original file path as argument and auto-select first match - local restore_err, _ = run_command("trash-restore", { item.original_path }, "0\n") - if restore_err then - Notify.error("Failed to restore %s: %s", item.name, restore_err) - return restore_err - else - return nil - end - end - - -- Execute batch operation - local success_count, failed_count = execute_batch_operation(restore_items, "restoring", restore_operation) - - -- Clear selection after successful restore to prevent stale selections - if success_count > 0 then clear_selection() end - - -- Report results - report_operation_results("restoring", success_count, failed_count) -end - -local function cmd_show_menu(config) - local choice = ya.which({ - title = "Recycle Bin Menu", - cands = { - { on = "o", desc = "Open Trash" }, - { on = "r", desc = "Restore from Trash" }, - { on = "d", desc = "Delete from Trash" }, - { on = "e", desc = "Empty Trash" }, - { on = "D", desc = "Empty by Days" }, - }, - }) - - if choice == 1 then - cmd_open_trash(config) - elseif choice == 2 then - cmd_restore_selection(config) - elseif choice == 3 then - cmd_delete_selection(config) - elseif choice == 4 then - cmd_empty_trash(config) - elseif choice == 5 then - cmd_empty_trash_by_days(config) - end -end - ---=========== init requirements ================================================ ----Verify all dependencies -local function check_dependencies() - -- Check for trash-cli - local trashcli_err, _ = run_command("trash-list", { "--version" }, nil, true) - if trashcli_err then - local path = os.getenv("PATH") or "(unset)" - Notify.error("trashcli not found. Is it installed and in PATH? PATH=" .. path) - return false - end - return true -end - ----Initialize the plugin and verify dependencies -local function init() - local initialized = get_state("is_initialized") - if not initialized then - if not check_dependencies() then return false end - initialized = true - set_state("is_initialized", true) - end - return initialized -end - ---=========== Plugin start ================================================= --- Default configuration -local default_config = { - trash_dir = nil, -- Will be auto-discovered from trash-list --trash-dirs - os = ya.target_os(), -} - ----Merges user‑provided configuration options into the defaults. ----@param user_config table|nil -local function set_plugin_config(user_config) - local config = deep_merge(default_config, user_config or {}) - set_state(STATE_KEY.CONFIG, config) -end - ----Setup -function M:setup(cfg) - set_plugin_config(cfg) -end - ----Entry -function M:entry(job) - if not init() then return end - - -- Cache config to avoid multiple state access calls - local config = get_state(STATE_KEY.CONFIG) - local action = job.args[1] - - -- Pass config to functions that need it to avoid additional state calls - if action == "menu" or not action then - cmd_show_menu(config) - elseif action == "open" then - cmd_open_trash(config) - elseif action == "delete" then - cmd_delete_selection(config) - elseif action == "restore" then - cmd_restore_selection(config) - elseif action == "emptyDays" then - cmd_empty_trash_by_days(config) - elseif action == "empty" then - cmd_empty_trash(config) - else - Notify.error("Unknown action '%s'. Valid actions: menu, open, delete, restore, empty, emptyDays", tostring(action)) - end -end - -return M diff --git a/yazi_1/.config/yazi/plugins/rich-preview.yazi/LICENSE b/yazi_1/.config/yazi/plugins/rich-preview.yazi/LICENSE deleted file mode 100644 index ea3f779..0000000 --- a/yazi_1/.config/yazi/plugins/rich-preview.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Anirudh Gupta - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/rich-preview.yazi/README.md b/yazi_1/.config/yazi/plugins/rich-preview.yazi/README.md deleted file mode 100644 index 4557fc1..0000000 --- a/yazi_1/.config/yazi/plugins/rich-preview.yazi/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# rich-preview.yazi - -Preview file types using `rich` command in Yazi. This plugin allows preview for various filetypes including - - -- Markdown -- Jupyter notebook -- JSON -- CSV -- RestructuredText - -## Previews/Screenshots - -[rich-preview1.webm](https://github.com/user-attachments/assets/580e36a8-249f-48a8-95fc-8c3d60e6a7d7) - -## Requirements - -- [Yazi](https://github.com/sxyazi/yazi) v25.4.8 or higher. -- [rich-cli](https://github.com/Textualize/rich-cli) v13.7.1 or higher. - -## Installation - -To install this plugin, simply run- - -```bash -ya pkg add AnirudhG07/rich-preview -## For linux and MacOS -git clone https://github.com/AnirudhG07/rich-preview.yazi.git ~/.config/yazi/plugins/rich-preview.yazi - -## For Windows -git clone https://github.com/AnirudhG07/rich-preview.yazi.git %AppData%\yazi\config\plugins\rich-preview.yazi -``` - -## Usages - -The `rich` commands automatically detects if the file is markdown, csv, json, etc. files and accordingly the preview is viewed. - -Add the below to your `yazi.toml` file to allow the respective file to previewed using `rich`. - -```toml -[plugin] - -prepend_previewers = [ - { url = "*.csv", run = "rich-preview"}, # for csv files - { url = "*.md", run = "rich-preview" }, # for markdown (.md) files - { url = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files - { url = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb) - { url = "*.json", run = "rich-preview"}, # for json (.json) files -# { url = "*.lang_type", run = "rich-preview"} # for particular language files eg. .py, .go., .lua, etc. -] -``` - -## Configurations - -If you would like to use `rich` with more configurations, you can go to `init.lua` and edit the arguments in the code with your preferences. You can view the options using `rich --help`. - -```lua --- init.lua -"-j", -"--left", -"--line-numbers", -"--force-terminal", -"--panel=rounded", -"--guides", -"--max-width" -- to area of preview -``` - -You can add more, remove and choose themes as you wish. You can set styles or Themes(as mentioned in `rich --help`) by `--theme=your_theme` and similarly for style. - -## Notes - -Currently the colors maynot be uniformly present, along with weird lines here and there. This is due to `"--force-terminal"` option. You can disable it if you find it annoying. Work is in progress to possibly fix the issue. - -## Using piper.yazi - -[piper.yazi](https://github.com/yazi-rs/plugins/tree/main/piper.yazi) is a general-purpose previewer - you can pass any shell command to piper and it will use the command's output as the preview content. - -To use `rich` with piper, you can add this in your `yazi.toml` file: - -```toml -[[plugin.prepend_previewers]] -url = "*.md" -run = 'piper -- rich -j --left --panel=rounded --guides --line-numbers --force-terminal "$1"' -``` - -Note you can also add other filetypes as mentioned above in the same format. - -# Explore Yazi - -Yazi is an amazing, blazing fast terminal file manager, with a variety of plugins, flavors and themes. Check them out at [awesome-yazi](https://github.com/AnirudhG07/awesome-yazi) and the official [yazi webpage](https://yazi-rs.github.io/). diff --git a/yazi_1/.config/yazi/plugins/rich-preview.yazi/main.lua b/yazi_1/.config/yazi/plugins/rich-preview.yazi/main.lua deleted file mode 100644 index a75003f..0000000 --- a/yazi_1/.config/yazi/plugins/rich-preview.yazi/main.lua +++ /dev/null @@ -1,56 +0,0 @@ -local M = {} - -function M:peek(job) - local child = Command("rich") - :arg({ - "-j", - "--left", - "--line-numbers", - "--force-terminal", - "--panel=rounded", - "--guides", - "--max-width", - tostring(job.area.w), - tostring(job.file.url), - }) - :stdout(Command.PIPED) - :stderr(Command.PIPED) - :spawn() - - if not child then - return require("code"):peek(job) - end - - local limit = job.area.h - local i, lines = 0, "" - repeat - local next, event = child:read_line() - if event == 1 then - return require("code"):peek(job) - elseif event ~= 0 then - break - end - - i = i + 1 - if i > job.skip then - lines = lines .. next - end - until i >= job.skip + limit - - child:start_kill() - if job.skip > 0 and i < job.skip + limit then - ya.emit("peek", { math.max(0, i - limit), only_if = job.file.url, upper_bound = true }) - else - lines = lines:gsub("\t", string.rep(" ", rt.preview.tab_size)) - ya.preview_widget( - job, - ui.Text.parse(lines):area(job.area):wrap(rt.preview.wrap == "yes" and ui.Wrap.YES or ui.Wrap.NO) - ) - end -end - -function M:seek(job) - require("code"):seek(job) -end - -return M diff --git a/yazi_1/.config/yazi/plugins/rsync.yazi/LICENSE b/yazi_1/.config/yazi/plugins/rsync.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/rsync.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/rsync.yazi/README.md b/yazi_1/.config/yazi/plugins/rsync.yazi/README.md deleted file mode 100644 index b651e6a..0000000 --- a/yazi_1/.config/yazi/plugins/rsync.yazi/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# rsync.yazi - -A [yazi](https://yazi-rs.github.io/) plugin for simple rsync copying locally and up to remote servers. - -![Demo](assets/demo.gif) -Thanks to [chrissabug](https://x.com/chrissabug) for creating lovely art! - -## Pre-reqs - -1. yazi 3.0+ -2. rsync -3. passwordless authentication if copying to a remote server - -## Installation - -```sh -ya pkg add GianniBYoung/rsync -``` - -## Usage - -Add the binds to your `~/.config/yazi/keymap.toml` - -**WARNING:** Make sure the chosen binding isn't already in use!! - -```toml -[[mgr.prepend_keymap]] -on = [ "R" ] -run = "plugin rsync" -desc = "Copy files using rsync" -``` - -### Specify Default Remote Server - -```toml -[[mgr.prepend_keymap]] -on = [ "R" ] -run = "plugin rsync 'user@server.com'" -desc = "Copy files using rsync to default location" -``` - -## Troubleshooting - -Basic logging information is sent to `~/.local/state/yazi/yazi.log` - -*Note: This plugin has only been tested on linux - -## Contributing - -Run into a bug or want a certain feature added? Submit an issue! - -PRs welcome :) - -Please keep in mind the yazi plugin system is still very new - as more features are added - -more possibilities will open up for this plugin! diff --git a/yazi_1/.config/yazi/plugins/rsync.yazi/assets/demo.gif b/yazi_1/.config/yazi/plugins/rsync.yazi/assets/demo.gif deleted file mode 100644 index e51aa96..0000000 Binary files a/yazi_1/.config/yazi/plugins/rsync.yazi/assets/demo.gif and /dev/null differ diff --git a/yazi_1/.config/yazi/plugins/rsync.yazi/assets/demo.webm b/yazi_1/.config/yazi/plugins/rsync.yazi/assets/demo.webm deleted file mode 100644 index ab7d3d1..0000000 Binary files a/yazi_1/.config/yazi/plugins/rsync.yazi/assets/demo.webm and /dev/null differ diff --git a/yazi_1/.config/yazi/plugins/rsync.yazi/main.lua b/yazi_1/.config/yazi/plugins/rsync.yazi/main.lua deleted file mode 100644 index e59b1b2..0000000 --- a/yazi_1/.config/yazi/plugins/rsync.yazi/main.lua +++ /dev/null @@ -1,117 +0,0 @@ --- function borrowed from chmod.yazi plugin -local selected_or_hovered = ya.sync(function() - local tab = cx.active - local paths = {} - - -- count up selected files - for _, url in pairs(tab.selected) do - paths[#paths + 1] = tostring(url) - end - - -- if no files are selected use the hovered file - -- a tab has folders which have files which have urls - if #paths == 0 and tab.current.hovered then - -- lua so we are 1 indexed - paths[1] = tostring(tab.current.hovered.url) - end - return paths -end) - --- Helper function to expand tilde (~) in a path -local function expand_tilde(path) - if not path then - return nil - end - - if path:sub(1, 1) == "~" then - local home = os.getenv("HOME") -- Get HOME environment variable - if not home then - -- Fallback for Windows-specific environment variables - home = os.getenv("USERPROFILE") -- Primary user profile directory on Windows - end - if home then - return home .. path:sub(2) -- Concatenate home path with the rest of the path - else - -- Fallback if HOME is not set - ya.notify({ - title = "Rsync Plugin", - content = "Could not expand '~': HOME environment variable not set.", - level = "warn", - timeout = 5, - }) - return path -- Return original path if home cannot be determined - end - end - return path -- Return original path if no tilde -end - -return { - entry = function(_, job) - ya.mgr_emit("escape", { visual = true }) - local remote_target = job.args and #job.args >= 1 and job.args[1] or nil - - local files = selected_or_hovered() - if #files == 0 then - return ya.notify({ title = "Rsync", content = "No files selected", level = "warn", timeout = 3 }) - end - - local default_dest = "" - if #files == 1 and remote_target ~= nil then - local base_name = files[1]:match("([^/]+)$") - default_dest = remote_target .. ":" .. base_name - ya.err({ default_dest = default_dest }) - end - - local dest, ok = ya.input({ - title = "Rsync - [user]@[remote]:", - value = default_dest or nil, - pos = { "top-center", y = 3, w = 45 }, - }) - if ok ~= 1 then - return - end - - -- Only expand tilde if it's a local path (doesn't contain ':') - if not dest:match(":") then - dest = expand_tilde(dest) - if not dest then - return - end -- If expand_tilde failed and returned nil - end - - -- local cmd, err = Command("rsync"):args(files):arg(dest):stderr(Command.PIPED):output() - local cmd, err = Command("rsync") - :arg({ "-ahP", "--no-motd" }) - :arg(files) - :arg(dest) - :stdout(Command.PIPED) - :stderr(Command.PIPED) - :output() - local stderr = cmd.stderr - local stdout = cmd.stdout - local return_code = cmd.status.code - ya.err({ - stderr = stderr, - stdout = stdout, - err = err, - res = cmd.status.success, - return_code = return_code, - default_dest = default_dest, - }) - - if return_code ~= 0 then - ya.notify({ - title = "Rsync Plugin", - content = string.format("stderr below, exit code %s\n\n%s", cmd.status.code, stderr), - level = "error", - timeout = 10, - }) - else - ya.notify({ - title = "Rsync Plugin", - content = "Rsync Completed!", - timeout = 3, - }) - end - end, -} diff --git a/yazi_1/.config/yazi/plugins/simple-tag.yazi/LICENSE b/yazi_1/.config/yazi/plugins/simple-tag.yazi/LICENSE deleted file mode 100644 index ab4d6da..0000000 --- a/yazi_1/.config/yazi/plugins/simple-tag.yazi/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2025 boydaihungst - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/simple-tag.yazi/README.md b/yazi_1/.config/yazi/plugins/simple-tag.yazi/README.md deleted file mode 100644 index 63d5927..0000000 --- a/yazi_1/.config/yazi/plugins/simple-tag.yazi/README.md +++ /dev/null @@ -1,424 +0,0 @@ -# simple-tag - - - -- [simple-tag](#simple-tag) - - [Overview](#overview) - - [Features](#features) - - [Requirements](#requirements) - - [Installation](#installation) - - [Previews](#previews) - - [Configuration](#configuration) - - [Add setup function in `yazi/init.lua`.](#add-setup-function-in-yaziinitlua) - - [Fetcher Configuration in `yazi.toml`](#fetcher-configuration-in-yazitoml) - - [Keybindings in `keymap.toml`](#keybindings-in-keymaptoml) - - [Customizing the Theme for tag hints window](#customizing-the-theme-for-tag-hints-window) - - [For Developers](#for-developers) - - -## Overview - -simple-tag is a Yazi plugin that allows you to add tags to files and folders. Each tag is associated with a unique key. - -> Disclaimer: This is not mactag and does not utilize mactag. - -## Features - -- Toggle, Add, Remove, Replace, Clear, Edit Tag(s). Supported input multiple tags. -- Filter Files/Folders by Tag(s). -- Visual Selection files/folders by Tag(s) (Replace, Unite, Subtract, Intersect, Exclude). Undo/Redo visual selection. -- Change Tag Icon/Text/Hidden Indicator. -- Tag Hints, will show up whenever you need to input or select tag(s). -- Automatically transfer tags after moving/renaming/bulk-renaming files/folders. -- Automatically clear tags when files/folders are deleted or trashed. - -## Requirements - -> [!IMPORTANT] -> Minimum supported version: Yazi v25.5.31. - -- [Yazi](https://github.com/sxyazi/yazi) -- Tested on Linux and Windows - -## Installation - -Install the plugin: - -```sh -ya pkg add boydaihungst/simple-tag -``` - -> [!IMPORTANT] -> Tags are automatically cleared when files/folders are deleted or moved to trash within Yazi. -> However, if deleted outside Yazi and then recreated, their tags will be restored. -> It also apply with renaming and moving files/folders. - -## Previews - -- Tag Hints, will show up whenever you need to input or select tag(s). - Only custom Icons or colors are shown. - - ![image](https://github.com/user-attachments/assets/5b5b9baa-044d-4fe8-a09a-46ec915b94c3) - -- Tag Icon/Text/Hidden Indicator: - - ![Recording 2025-03-29 at 20 49 49](https://github.com/user-attachments/assets/261bfd3f-3249-45b0-a59a-10e2f44a70eb) - -- Toggle Tag(s): - - ![Recording 2025-03-29 at 21 10 38](https://github.com/user-attachments/assets/8cdf108c-8951-4da6-a9f4-b542ab0ce8d4) - -- Add, Remove, Replace, Edit Tag(s): - - ![Recording 2025-03-29 at 21 30 13](https://github.com/user-attachments/assets/2c5bef3b-cb9f-49ca-976f-fb5bad5bc323) - -- Filter Files by Tag(s) and Modes: - In all of examples below, I didn't use fixed tag keys with `--keys`/`--key`/`--tag`/`--tags` - - Mode = and (Default), match all of the selected tags: - - ![Recording 2025-03-29 at 20 56 47](https://github.com/user-attachments/assets/e7619681-7ab8-4e2c-b8ea-ea4aeb8c22db) - - - Mode = or, match at least one of the selected tags: - - ![Recording 2025-03-29 at 21 01 39](https://github.com/user-attachments/assets/cf9e757f-d910-4dca-aec5-cf9c36e54f34) - -- Visual Selection Modes: - In all of examples below, I didn't use fixed tag keys with `--keys`/`--key`/`--tag`/`--tags` - - ![image](https://github.com/user-attachments/assets/6efabb8a-0022-4aa3-ba20-04127e3c58c1) - - Replace selection: - - ![Recording 2025-03-29 at 23 30 56](https://github.com/user-attachments/assets/364c07a7-c1ef-4323-8e92-ccb795233fd7) - - - Unite selection: - - ![Recording 2025-03-29 at 23 36 59](https://github.com/user-attachments/assets/915ed231-f553-4eec-aaf0-5c0f0f56b729) - - - Subtract selection: - - ![Recording 2025-03-29 at 23 45 42](https://github.com/user-attachments/assets/fac67ebb-2a77-49a6-955b-ab4e08ee4066) - - - Intersect selection: - - ![Recording 2025-03-29 at 23 51 17](https://github.com/user-attachments/assets/6f46e221-d43e-49b7-8e9c-6f4aa1317e3b) - - - Exclude selection: - - ![Recording 2025-08-06 at 16 31 31](https://github.com/user-attachments/assets/c8124b16-803d-48a4-9d44-e345060629d6) - - - Undo selection: - - ![Recording 2025-03-29 at 23 54 55](https://github.com/user-attachments/assets/abf7ccc7-7591-4683-84f9-53e8cb9a280e) - -## Configuration - -### Add setup function in `yazi/init.lua`. - -The setup function is required, while preferences are optional. - -```lua -require("simple-tag"):setup({ - -- UI display mode (icon, text, hidden) - ui_mode = "icon", -- (Optional) - - -- Disable tag key hints (popup in bottom right corner) - hints_disabled = false, -- (Optional) - - -- linemode order: adjusts icon/text position. For example, if you want icon to be on the most left of linemode then set linemode_order larger than 1000. - -- More info: https://github.com/sxyazi/yazi/blob/077faacc9a84bb5a06c5a8185a71405b0cb3dc8a/yazi-plugin/preset/components/linemode.lua#L4-L5 - linemode_order = 500, -- (Optional) - - -- You can backup/restore this folder within the same OS (Linux, windows, or MacOS). - -- But you can't restore backed up folder in the different OS because they use difference absolute path. - -- save_path = -- full path to save tags folder (Optional) - -- - Linux/MacOS: os.getenv("HOME") .. "/.config/yazi/tags" - -- - Windows: os.getenv("APPDATA") .. "\\yazi\\config\\tags" - - -- Set tag colors - colors = { -- (Optional) - -- Set this same value with `theme.toml` > [mgr] > hovered > reversed - -- Default theme use "reversed = true". - -- More info: https://github.com/sxyazi/yazi/blob/077faacc9a84bb5a06c5a8185a71405b0cb3dc8a/yazi-config/preset/theme-dark.toml#L25 - reversed = true, -- (Optional) - - -- More colors: https://yazi-rs.github.io/docs/configuration/theme#types.color - -- format: [tag key] = "color" - ["*"] = "#bf68d9", -- (Optional) - ["$"] = "green", - ["!"] = "#cc9057", - ["1"] = "cyan", - ["p"] = "red", - }, - - -- Set tag icons. Only show when ui_mode = "icon". - -- Any text or nerdfont icons should work as long as you use nerdfont to render yazi. - -- Default icon from mactag.yazi: ●; Some generic icons: ï€Ź, , 󱈀 - -- More icon from nerd fonts: https://www.nerdfonts.com/cheat-sheet - icons = { -- (Optional) - -- default icon - default = "󰚋", - - -- format: [tag key] = "tag icon" - ["*"] = "*", - ["$"] = "", - ["!"] = "", - ["p"] = "", - }, - -}) -``` - -### Fetcher Configuration in `yazi.toml` - -Use one of the following methods: - -> [!IMPORTANT] -> -> For yazi before v25.12.29 replace `url` with `name` - -```toml -[plugin] - - fetchers = [ - { id = "simple-tag", url = "*", run = "simple-tag" }, - { id = "simple-tag", url = "*/", run = "simple-tag" }, - ] -# or - prepend_fetchers = [ - { id = "simple-tag", url = "*", run = "simple-tag" }, - { id = "simple-tag", url = "*/", run = "simple-tag" }, - ] -# or - append_fetchers = [ - { id = "simple-tag", url = "*", run = "simple-tag" }, - { id = "simple-tag", url = "*/", run = "simple-tag" }, - ] -``` - -### Keybindings in `keymap.toml` - -> [!IMPORTANT] -> Ensure there are no conflicts with [default Keybindings](https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/keymap-default.toml). - -Since Yazi prioritizes the first matching key, `prepend_keymap` takes precedence over defaults. -Or you can use `keymap` to replace all other keys - -```toml -[mgr] - prepend_keymap = [ - # Tagging plugin - - #─────────────────────────── TOGGLE TAG(S) ──────────────────────────── - # Toggle a tag (press any tag key) - # A tag hint window will show up. - # Simply press any tag key to toggle that tag for selected or hovered files/folders. - { on = [ "t", "t", "k" ], run = "plugin simple-tag -- toggle-tag", desc = "Toggle a tag (press any key)" }, - - # Fast Toggle tag(s) with fixed keys=!1q. key=!1q tag=!1q or tags=!1q also work - # NOTE: For key=" (Quotation mark), then use key=\" (Backslash + Quotation mark) instead. - { on = [ "`" ], run = "plugin simple-tag -- toggle-tag --keys=!1q", desc = "Toggle tag(s) with fixed tag key(s) = (! and 1 and q)" }, - { on = [ "`" ], run = "plugin simple-tag -- toggle-tag --keys=*", desc = "Toggle tag with fixed tag key = *" }, - { on = [ "`" ], run = "plugin simple-tag -- toggle-tag --key=*", desc = "Toggle tag with fixed tag key = *" }, - - # Toggle tag(s) with value from input box. - # A tag hint window and an input box will show up. - # Simply input tag key(s) to toggle that tags for selected or hovered files/folders. - # Do not input any delimiter. - { on = [ "t", "t", "i" ], run = "plugin simple-tag -- toggle-tag --input", desc = "Toggle tag(s) with value from (input box)" }, - - - #─────────────────────────── ADD TAG(S) ─────────────────────────────── - # Add a tag (press any tag key) - # A tag hint window will show up. - # Simply press any new tag key to add to selected or hovered files/folders. - { on = [ "t", "a", "k" ], run = "plugin simple-tag -- add-tag", desc = "Add a tag (press any key)" }, - - # Fast Add tag(s) with fixed keys=!1q. key=!1q tag=!1q or tags=!1q also work - { on = [ "t", "a", "f" ], run = "plugin simple-tag -- add-tag --keys=!1q", desc = "Add tag(s) with fixed tag keys = (! and 1 and q)" }, - { on = [ "t", "a", "f" ], run = "plugin simple-tag -- add-tag --keys=*", desc = "Add tag with fixed tag key = *" }, - { on = [ "t", "a", "f" ], run = "plugin simple-tag -- add-tag --key=*", desc = "Add tag with fixed tag key = *" }, - - # Add tag(s) with value from input box. - # A tag hint window and an input box will show up. - # Simply input new tag key(s) to add to selected or hovered files/folders. - # Do not input any delimiter. - { on = [ "t", "a", "i" ], run = "plugin simple-tag -- add-tag --input", desc = "Add tag(s) with value from (input box)" }, - - - #─────────────────────────── REMOVE/DELETE TAG(S) ─────────────────────────── - # Remove a tag (press any tag key) - # A tag hint window will show up. - # Simply press any tag key to be removed from selected or hovered files/folders. - { on = [ "t", "d", "k" ], run = "plugin simple-tag -- remove-tag", desc = "Remove a tag (press any key)" }, - - # Fast Remove tag(s) with fixed keys=!1q. key=!1q tag=!1q or tags=!1q also work - { on = [ "t", "d", "f" ], run = "plugin simple-tag -- remove-tag --keys=!1q", desc = "Remove tag(s) with fixed tag keys = (! and 1 and q)" }, - { on = [ "t", "d", "f" ], run = "plugin simple-tag -- remove-tag --keys=*", desc = "Remove tag with fixed tag key = *" }, - { on = [ "t", "d", "f" ], run = "plugin simple-tag -- remove-tag --key=*", desc = "Remove tag with fixed tag key = *" }, - - # Remove tag(s) with value from input box. - # A tag hint window and an input box will show up. - # Simply input tag key(s) to be removed from selected or hovered files/folders. - # Do not input any delimiter. - { on = [ "t", "d", "i" ], run = "plugin simple-tag -- remove-tag --input", desc = "Remove tag(s) with value from (input box)" }, - - - #─────────────────────────── REPLACE ALL OLD TAG(S) WITH NEW TAG(S) ─────────────────────────── - # Replace a tag (press any tag key) - # A tag hint window will show up. - # Simply press any new tag key for selected or hovered files/folders. - { on = [ "t", "r", "k" ], run = "plugin simple-tag -- replace-tag", desc = "Replace with a new tag (press any key)" }, - - # Fast Replace tag(s) with fixed keys=!1q. key=!1q tag=!1q or tags=!1q also work - { on = [ "t", "r", "f" ], run = "plugin simple-tag -- replace-tag --keys=!1q", desc = "Replace tag(s) with fixed tag keys = (! and 1 and q)" }, - { on = [ "t", "r", "f" ], run = "plugin simple-tag -- replace-tag --keys=*", desc = "Replace tag(s) with fixed tag key = *" }, - { on = [ "t", "r", "f" ], run = "plugin simple-tag -- replace-tag --key=*", desc = "Replace tag(s) with fixed tag key = *" }, - - # Replace tag(s) with value from input box. - # A tag hint window and an input box will show up. - # Simply input new tag key(s) for selected or hovered files/folders. - # Do not input any delimiter. - { on = [ "t", "r", "i" ], run = "plugin simple-tag -- replace-tag --input", desc = "Replace tag(s) with value from (input box)" }, - - - #─────────────────────────── EDIT TAG(S) ─────────────────────────── - # Edit a tag for hovered or selected files/folders - # An input box with current tagged keys and a tag hint window will show up for each hovered or selected files/folders. - # Simply edit tag key(s) for selected or hovered files/folders. - # If you cancel any input box, all changes will be discarded. - { on = [ "t", "e" ], run = "plugin simple-tag -- edit-tag ", desc = "Edit tag(s) (input box)" }, - - - # ───────────────────────────── CLEAR TAG(S) ───────────────────────────── - # Clear all tags from selected or hovered files/folders - { on = [ "t", "c" ], run = "plugin simple-tag -- clear", desc = "Clear all tags from selected or hovered files" }, - - - # ───────────────────────────── CHANGE UI ───────────────────────────── - # Switch tag indicator between icon > tag key > hidden. - # Useful when u don't remember the tag key - { on = [ "t", "u", "s" ], run = "plugin simple-tag -- toggle-ui", desc = "Toggle tag indicator (icon > tag key > hidden)" }, - - # Fixed tag indicator mode = hidden (Available modes: hidden|icon|text) - { on = [ "t", "u", "h" ], run = "plugin simple-tag -- toggle-ui --mode=hidden", desc = "Hide all tags indicator" }, - - # ─────────────────────── FILTER FILES/FOLDERS BY TAGS: ─────────────────────── - # Available filter modes: - # and → Filter files which contain all of selected tags (Default if mode isn't specified). - # or → Filter files which contain at least one of selected tags. - - # NOTE: Not available in vfs mode (Remote Virtual Filesystem) - - # Filter files/folders by tags - - # Filter files/folders by a tag (press any tag key) - # A tag hint window will show up. - # Simply press any new tag key to filter files/folders containing that tag in current directory. - { on = [ "t", "f" ], run = "plugin simple-tag -- filter", desc = "Filter files/folders by a tag (press any key)" }, - - # Fast Filter files/folders with fixed keys=!1q. key=!1q tag=!1q or tags=!1q also work - # { on = [ "t", "f" ], run = "plugin simple-tag -- filter --key=!", desc = "Filter files/folders by a fixed tag = !" }, - # { on = [ "t", "f" ], run = "plugin simple-tag -- filter --keys=!1q", desc = "Filter files/folders by multiple fixed tag(s) (! and 1 and q)" }, - - # Filter files/folders by tag(s) with value from input box. - # An input box and a tag hint window will show up. - # Simply input tag key(s) to filter files/folders of current directory. - # Do not input any delimiter. - # For example: Input value or --keys=!1q -> filter any files/folders contain all of these tags (! and 1 and q) in current directory. - { on = [ "t", "F" ], run = "plugin simple-tag -- filter --input", desc = "Filter files/folders by tag(s) (input box)" }, - - # Filter files/folders by tag(s) with --mode=or. - # --mode=or -> Input value or --keys = !1q -> filter any files/folders contain at least one of these tags (! or 1 or q) - { on = [ "t", "F" ], run = "plugin simple-tag -- filter --input --mode=or", desc = "Filter files/folders by contain tags (input box)" }, - # { on = [ "t", "F" ], run = "plugin simple-tag -- filter --keys=!1q --mode=or", desc = "Filter files/folders by multiple fixed tag(s) (! or 1 or q)" }, - - - # ─────────────────────── VISUAL SELECT FILES/FOLDERS BY TAGS: ─────────────────────── - - # Available selection actions: - # replace → Replaces the current selection list with files/folders that have the selected tag. - # unite → Combines the currently selected files/folders with those that have the selected tag. - # intersect → Keeps only the files/folders that are present in both the current selection and the tagged items. - # subtract → Deselects files/folders that have the selected tag from the current selection. - # exclude → Combines the currently selected files/folders with the tagged items, then deselects any overlapping items between the current selection and the tagged items. - # undo → Undos or redoes the last selection action. - - # which_key will popup to choose selection mode - # And a tag hint window will show up. - # Simply select a selection mode then press any tag key to select files/folders - { on = [ "t", "s", "t" ], run = "plugin simple-tag -- toggle-select", desc = "Select a selection action then select a tag key (toggle-select)" }, - # fixed tag(s). --keys=!1q or --key=!1q or --tag=!1q or --tags=!1q. They are the same. - { on = [ "t", "s", "t" ], run = "plugin simple-tag -- toggle-select --keys=!1q", desc = "" }, - - # Run action on files/folders by a tag. - # A tag hint window will show up. - # Simply press any tag key to do the following action: - { on = [ "t", "s", "r" ], run = "plugin simple-tag -- replace-select", desc = "replace-select" }, - { on = [ "t", "s", "u" ], run = "plugin simple-tag -- unite-select", desc = "unite-select" }, - { on = [ "t", "s", "i" ], run = "plugin simple-tag -- intersect-select", desc = "intersect-select" }, - { on = [ "t", "s", "s" ], run = "plugin simple-tag -- subtract-select", desc = "subtract-select" }, - { on = [ "t", "s", "e" ], run = "plugin simple-tag -- exclude-select", desc = "exclude-select" }, - # Run action on files/folders by fixed tag(s). --keys=!1q or --key=!1q or --tag=!1q or --tags=!1q. They are the same. - { on = [ "t", "s", "e" ], run = "plugin simple-tag -- replace-select --keys=!1q", desc = "Replaces the current selection list with files/folders that have (! and 1 and q) tag(s)" }, - - # Run action on files/folders by tag(s) with value from input box. - # A tag hint window will show up. - # Simply input tag key(s) to do the following action: - { on = [ "t", "s", "R" ], run = "plugin simple-tag -- replace-select --input", desc = "replace-select --input" }, - { on = [ "t", "s", "U" ], run = "plugin simple-tag -- unite-select --input", desc = "unite-select --input" }, - { on = [ "t", "s", "I" ], run = "plugin simple-tag -- intersect-select --input", desc = "intersect-select --input" }, - { on = [ "t", "s", "S" ], run = "plugin simple-tag -- subtract-select --input", desc = "subtract-select --input" }, - { on = [ "t", "s", "E" ], run = "plugin simple-tag -- exclude-select --input", desc = "exclude-select --input" }, - # it also support --mode=or when using with --input or --keys=!1q or --key=!1q or --tag=!1q or --tags=!1q - { on = [ "t", "s", "R" ], run = "plugin simple-tag -- replace-select --input --mode=or", desc = "replace-select --input --mode=or" }, - { on = [ "t", "s", "R" ], run = "plugin simple-tag -- replace-select --keys=!1q --mode=or", desc = "replace-select --keys=!1q --mode=or" }, - - # Undo/Redo selection (only works after using 5 modes above) - { on = [ "t", "s", "u" ], run = "plugin simple-tag -- undo-select", desc = "Undos/Redos the last selection action" }, -] -``` - -### Customizing the Theme for tag hints window - -To modify the tag hints window appearance, edit `.../yazi/theme.toml`: -You can also use Flavors file instead. - -```toml - -[spot] - border = { fg = "#4fa6ed" } - title = { fg = "#4fa6ed" } -``` - -## For Developers - -You can trigger this plugin programmatically: - -```lua --- In your plugin: - local simple_tag = require("simple-tag") --- Available actions: toggle-tag, toggle-ui, clear, toggle-select, filter, add-tag, remove-tag, replace-tag, edit-tag - local action = "toggle-select" - local args = ya.quote(action) - args = args .. " " .. ya.quote("--mode=unite") --- another arguments --- args = args .. " " .. ya.quote("--tag=q") - ya.emit("plugin", { - simple_tag._id, - args, - }) - - --- Special action: "files-deleted" -> clear all tags from these files/folders - local args = ya.quote("files-deleted") --- A array of string url - local files_to_clear_tags = selected_or_hovered_files() - for _, url in ipairs(files_to_clear_tags) do - args = args .. " " .. ya.quote(url) - end - ya.emit("plugin", { - simple_tag._id, - args, - }) - -``` diff --git a/yazi_1/.config/yazi/plugins/simple-tag.yazi/main.lua b/yazi_1/.config/yazi/plugins/simple-tag.yazi/main.lua deleted file mode 100644 index 416168b..0000000 --- a/yazi_1/.config/yazi/plugins/simple-tag.yazi/main.lua +++ /dev/null @@ -1,1186 +0,0 @@ ---- @since 25.5.31 - -local PackageName = "simple-tag" -local M = {} - --- ╭─────────────────────────────────────────────────────────╼ --- │ ENUM │ --- ╰─────────────────────────────────────────────────────────╯ - -local TARGET_FAMILY = ya.target_family() - -local path_separator = package.config:sub(1, 1) --- stylua: ignore -local CAND_TAG_KEYS = { - -- number + special characters - { on = "0" }, { on = "1" }, { on = "2" }, { on = "3" }, { on = "4" }, - { on = "5" }, { on = "6" }, { on = "7" }, { on = "8" }, { on = "9" }, - { on = "-" }, { on = "=" }, { on = "!" }, { on = "@" }, { on = "#" }, - { on = "$" }, { on = "%" }, { on = "^" }, { on = "&" }, { on = "*" }, - { on = "(" }, { on = ")" }, { on = "_" }, { on = "+" }, { on = "`" }, - { on = "~" }, { on = "[" }, { on = "{" }, { on = "]" }, { on = "}" }, - { on = "\\" }, { on = "|" }, { on = ";" }, { on = ":" }, { on = "'" }, - { on = "\"" }, { on = "," }, { on = "<" }, { on = "." }, { on = ">" }, - { on = "/" }, { on = "?" }, - -- word - { on = "q" }, { on = "w" }, { on = "e" }, { on = "r" }, { on = "t" }, - { on = "y" }, { on = "u" }, { on = "i" }, { on = "o" }, { on = "p" }, - { on = "a" }, { on = "s" }, { on = "d" }, { on = "f" }, { on = "g" }, - { on = "h" }, { on = "j" }, { on = "k" }, { on = "l" }, { on = "z" }, - { on = "x" }, { on = "c" }, { on = "v" }, { on = "b" }, { on = "n" }, - { on = "m" } -} - -local CAND_SELECTION_ACTION = { - -- number + special characters - { on = "1", desc = "Select Only tagged files" }, - { on = "2", desc = "Select tagged files (Unite mode)" }, - { on = "3", desc = "Select tagged files (Subtract mode)" }, - { on = "4", desc = "Select tagged files (Intersect mode)" }, - { on = "5", desc = "Select tagged files (Exclude mode)" }, - { on = "6", desc = "Select tagged files (Undo mode)" }, -} -local DEFAULT_TAG_ICON = "󰚋" -local DEFAULT_LINEMODE_ORDER = 500 - -local STATE_KEY = { - ui_mode = "ui_mode", - preserve_selected_files = "preserve_selected_files", - colors = "colors", - save_path = "save_path", - tags_database = "tags_database", - icons = "icons", - hints_table = "hints_table", - hints_disabled = "hints_disabled", - linemode_order = "linemode_order", - tasks_write_tags_db = "tasks_write_tags_db", - tasks_delete_tags = "tasks_delete_tags", - tasks_rename_tags = "tasks_rename_tags", - tasks_write_tags_db_running = "tasks_write_tags_db_running", - tasks_delete_tags_running = "tasks_delete_tags_running", - tasks_rename_tags_running = "tasks_rename_tags_running", -} - ----@enum UI_MODE -local UI_MODE = { - hidden = "hidden", - icon = "icon", - text = "text", -} - ----@enum FILTER_MODE -local FILTER_MODE = { - ["or"] = "or", - ["and"] = "and", -} - ----@enum SELECTION_MODE -local SELECTION_MODE = { - ["or"] = "or", - ["and"] = "and", -} - ----@enum ACTION_TAG_MODE -local TAG_ACTION = { - remove = "remove-tag", - add = "add-tag", - replace = "replace-tag", - toggle = "toggle-tag", - edit = "edit-tag", - clear = "clear", - toggle_ui = "toggle-ui", - - toggle_select = "toggle-select", - unite_select = "unite-select", - subtract_select = "subtract-select", - intersect_select = "intersect-select", - exclude_select = "exclude-select", - replace_select = "replace-select", - undo_select = "undo-select", - - filter = "filter", - files_deleted = "files-deleted", - files_transferred = "files-transferred", -} - -local UI_MODE_ORDERED = { - UI_MODE.hidden, - UI_MODE.icon, - UI_MODE.text, -} - ----@enum NOTIFY_MSG -local NOTIFY_MSG = { - TAG_KEY_INVALID = "Tag key should be a single character", -} - ----@enum PUBSUB_KIND -local PUBSUB_KIND = { - tags_tbl_changed = PackageName .. "-tags-changed", - -- "@" persist state - ui_mode_changed = "@" .. PackageName .. "-ui-mode-changed", - files_deleted = "delete", - files_trash = "trash", - file_renamed = "rename", - files_bulk_renamed = "bulk", - files_move = "move", - files_copy = "duplicate", -} - --- ╭─────────────────────────────────────────────────────────╼ --- │ Utilities │ --- ╰─────────────────────────────────────────────────────────╯ - --- Encode binary string to hex (e.g., "\xED" => "\\xED") -local function hex_encode(s) - return (s:gsub(".", function(c) - return string.format("\\x%02X", c:byte()) - end)) -end - --- Decode hex-encoded string (e.g., "\\xED" => "\xED") -local function hex_decode(s) - return (s:gsub("\\x(%x%x)", function(hex) - return string.char(tonumber(hex, 16)) - end)) -end - -local function hex_encode_table(t) - local out = {} - for k, v in pairs(t) do - local new_k = type(k) == "string" and hex_encode(k) or k - local new_v - if type(v) == "table" then - new_v = hex_encode_table(v) - elseif type(v) == "string" then - new_v = hex_encode(v) - else - new_v = v - end - out[new_k] = new_v - end - return out -end - -local function hex_decode_table(t) - local out = {} - for k, v in pairs(t) do - local new_k = type(k) == "string" and hex_decode(k) or k - local new_v - if type(v) == "table" then - new_v = hex_decode_table(v) - elseif type(v) == "string" then - new_v = hex_decode(v) - else - new_v = v - end - out[new_k] = new_v - end - return out -end - -local enqueue_task = ya.sync(function(state, task_name, task_data) - if not state[task_name] or type(state[task_name]) ~= "table" then - state[task_name] = {} - end - table.insert(state[task_name], task_data) -end) - -local dequeue_task = ya.sync(function(state, task_name) - if not state[task_name] or type(state[task_name]) ~= "table" then - return {} - end - return table.remove(state[task_name], 1) -end) - -local set_state = ya.sync(function(state, key, value) - state[key] = value -end) - -local get_state = ya.sync(function(state, key) - return state[key] -end) - -local function fail(s, ...) - ya.notify({ title = PackageName, content = string.format(s, ...), timeout = 3, level = "error" }) -end - -local function warn(s, ...) - ya.notify({ title = PackageName, content = string.format(s, ...), timeout = 3, level = "warn" }) -end - ---- broadcast through pub sub to other instances ----@param _ table state ----@param pubsub_kind PUBSUB_KIND ----@param data any ----@param to number default = 0 to all instances -local broadcast = ya.sync(function(_, pubsub_kind, data, to) - ps.pub_to(to or 0, pubsub_kind, data) -end) - -local function pathJoin(...) - local parts = { ... } - local filteredParts = {} - -- Remove empty strings or nil values - for _, part in ipairs(parts) do - if part and part ~= "" then - table.insert(filteredParts, part) - end - end - -- Join the remaining parts with the path_separator - local path = table.concat(filteredParts, path_separator) - -- Normalize any double separators (e.g., "folder//file" → "folder/file") - path = path:gsub(path_separator .. "+", path_separator) - - return path -end - -local function sanitize_filename_windows(s) - local pattern - pattern = '[<>:"|%?%*]' - - return ( - s:gsub(pattern, function(c) - return string.format("%%%02X", c:byte()) -- encode as %XX - end) - ) -end - -local function ordered_pairs(tbl) - local keys = {} -- Store all keys in a separate table - - for k in pairs(tbl) do - table.insert(keys, k) - end - - table.sort(keys) -- Sort keys alphabetically (or numerically) - - local i = 0 - return function() - i = i + 1 - local key = keys[i] - if key then - return key, tbl[key] - end - end -end - -local function tbl_deep_clone(original) - if type(original) ~= "table" then - return original - end - - local copy = {} - for key, value in pairs(original) do - copy[tbl_deep_clone(key)] = tbl_deep_clone(value) - end - - return copy -end - --- Helper function: Convert an array into a set (table for fast lookup) -local function tbl_to_set(array) - local set = {} - for _, v in ipairs(array) do - local _v = tostring(v) - set[_v] = true - end - return set -end - --- Unite: Combine all unique elements from both arrays -local function tbl_unite(array1, array2) - local set = tbl_to_set(array1) - for _, v in ipairs(array2) do - local _v = tostring(v) - set[_v] = true - end - local result = {} - for k in pairs(set) do - table.insert(result, k) - end - return result -end - --- Subtract: Remove elements of array2 from array1 -local function tbl_subtract(array1, array2) - local set2 = tbl_to_set(array2) - local result = {} - for _, v in ipairs(array1) do - local _v = tostring(v) - if not set2[_v] then - table.insert(result, _v) - end - end - return result -end - --- Intersect: Keep only common elements between both arrays -local function tbl_intersect(array1, array2) - local set2 = tbl_to_set(array2) - local result = {} - for _, v in ipairs(array1) do - local _v = tostring(v) - if set2[_v] then - table.insert(result, _v) - end - end - return result -end - --- Exclude: Remove common elements, keeping only unique ones from both arrays -local function tbl_exclude(array1, array2) - local set1, set2 = tbl_to_set(array1), tbl_to_set(array2) - local result = {} - - for _, v in ipairs(array1) do - local _v = tostring(v) - if not set2[_v] then - table.insert(result, _v) - end - end - for _, v in ipairs(array2) do - local _v = tostring(v) - if not set1[_v] then - table.insert(result, _v) - end - end - return result -end - -local function tbl_is_subset(small, large) - local set1 = tbl_to_set(large) - - for _, v in ipairs(small) do - if not set1[v] then - return false - end - end - - return true -end - -local function tbl_contains_any(large, small) - local set1 = tbl_to_set(large) - - for _, v in ipairs(small) do - if set1[tostring(v)] then - return true - end - end - - return false -end - -local render = ya.sync(function() - --TODO: remove this after next yazi released - (ui.render or ya.render)() -end) - -local get_cwd = ya.sync(function() - return cx.active.current.cwd -end) - -local selected_files = ya.sync(function() - local tab, raw_urls = cx.active, {} - local is_search = get_cwd().is_search - for _, u in pairs(tab.selected) do - raw_urls[#raw_urls + 1] = tostring(is_search and u.path or u) - end - return raw_urls -end) - -local selected_or_hovered_files = ya.sync(function() - local tab, raw_urls = cx.active, selected_files() - if #raw_urls == 0 and tab.current.hovered then - local is_search = get_cwd().is_search - raw_urls[1] = tostring(is_search and tab.current.hovered.url.path or tab.current.hovered.url) - end - return raw_urls -end) - --- ╭─────────────────────────────────────────────────────────╼ --- │ Database section │ --- ╰─────────────────────────────────────────────────────────╯ - ----@param tags_tbl string tags database table ----@return table<{[string]:string[]} -local function read_tags_tbl(tags_tbl) - local save_path = get_state(STATE_KEY.save_path) - local tbl = TARGET_FAMILY == "windows" and sanitize_filename_windows(tags_tbl) or tags_tbl - local tbl_saved_file = pathJoin(save_path, tbl, "tags.json") - - local file = io.open(tbl_saved_file, "r") - if file == nil then - return {} - end - local tags_tbl_records_encoded = file:read("*all") - file:close() - local tag_records = hex_decode_table(ya.json_decode(tags_tbl_records_encoded)) - return tag_records -end - --- tags_db format: { "parent_abs_path a.k.a tags_tbl" = { "filename" = [ "q", "w", ... ] } } -local function write_tags_db() - if get_state(STATE_KEY.tasks_write_tags_db_running) or #get_state(STATE_KEY.tasks_write_tags_db) == 0 then - return - end - set_state(STATE_KEY.tasks_write_tags_db_running, true) - local changed_tags_db = dequeue_task(STATE_KEY.tasks_write_tags_db) - - local save_path = get_state(STATE_KEY.save_path) - for tags_tbl, tags_tbl_records in pairs(changed_tags_db) do - local tbl = TARGET_FAMILY == "windows" and sanitize_filename_windows(tags_tbl) or tags_tbl - local tags_tbl_save_dir = pathJoin(save_path, tbl) - for fname, tags in pairs(tags_tbl_records) do - if #tags == 0 then - changed_tags_db[tags_tbl][fname] = nil - end - end - if next(changed_tags_db[tags_tbl]) == nil then - -- delete mode - fs.remove("file", Url(pathJoin(tags_tbl_save_dir, "tags.json"))) - fs.remove("dir_clean", Url(tags_tbl_save_dir)) - local save_dir_url = Url(tags_tbl_save_dir) - local tags_parent_tbl = save_dir_url.parent - if tags_parent_tbl and tags_parent_tbl ~= save_path then - fs.remove("dir_clean", tags_parent_tbl) - end - else - -- create/update mode - local _, err_create_save_dir = fs.create("dir_all", Url(tags_tbl_save_dir)) - if err_create_save_dir then - fail("Can't create save tags file: %s", tags_tbl_save_dir) - break - else - local _, err_write_tags_tbl = fs.write( - Url(pathJoin(tags_tbl_save_dir, "tags.json")), - ya.json_encode(hex_encode_table(tags_tbl_records)) - ) - if err_write_tags_tbl then - fail("Can't save tags to file: %s", tags_tbl_save_dir) - end - end - end - broadcast(PUBSUB_KIND.tags_tbl_changed, hex_encode(tags_tbl)) - end - set_state(STATE_KEY.tasks_write_tags_db_running, false) - write_tags_db() -end - --- ╭─────────────────────────────────────────────────────────╼ --- │ Exposed APIs │ --- ╰─────────────────────────────────────────────────────────╯ - -function M:fetch(job) - local tags_db = get_state(STATE_KEY.tags_database) - local is_search = get_cwd().is_search - for _, file in ipairs(job.files) do - local tags_tbl = tostring(is_search and file.url.parent.path or file.url.parent) - if tags_db[tags_tbl] == nil then - tags_db[tags_tbl] = read_tags_tbl(tags_tbl) - end - end - set_state(STATE_KEY.tags_database, tags_db) - render() - return true -end - -function M:has_tags(file, filter_tags) - local url - if type(file) == "string" then - url = Url(file) - else - url = file.url - end - local is_search = get_cwd().is_search - local tags_tbl = tostring(is_search and url.parent.path or url.parent) - local fname = tostring(url.name) - - local tags_database = get_state(STATE_KEY.tags_database) - if tags_database[tags_tbl] and tags_database[tags_tbl][fname] then - local tags = tags_database[tags_tbl][fname] or {} - return tbl_is_subset(filter_tags, tags) - end - return false -end - -local function delete_tags() - if get_state(STATE_KEY.tasks_delete_tags_running) or #get_state(STATE_KEY.tasks_delete_tags) == 0 then - return - end - set_state(STATE_KEY.tasks_delete_tags_running, true) - local files_to_clear = dequeue_task(STATE_KEY.tasks_delete_tags) - - -- get changes tags - local changed_tags_db = {} - local tags_db = get_state(STATE_KEY.tags_database) - for _, raw_url in ipairs(files_to_clear) do - local url = type(raw_url) == "string" and Url(raw_url) or raw_url - if url == nil then - goto continue - end - local tags_tbl = tostring(url.parent) - local fname = tostring(url.name) - if tags_db and tags_tbl and tags_db[tags_tbl] then - tags_db[tags_tbl][fname] = nil - changed_tags_db[tags_tbl] = tags_db[tags_tbl] - end - ::continue:: - end - enqueue_task(STATE_KEY.tasks_write_tags_db, changed_tags_db) - write_tags_db() - set_state(STATE_KEY.tasks_delete_tags_running, false) - delete_tags() -end - -function M:setup(opts) - local st = self - local save_path = pathJoin( - (TARGET_FAMILY == "windows" and os.getenv("APPDATA") .. "\\yazi\\config\\tags") - or (os.getenv("HOME") .. "/.config/yazi/tags") - ) - st[STATE_KEY.tasks_write_tags_db] = {} - st[STATE_KEY.tasks_delete_tags] = {} - st[STATE_KEY.tasks_rename_tags] = {} - st[STATE_KEY.tags_database] = {} - st[STATE_KEY.save_path] = save_path - st[STATE_KEY.ui_mode] = UI_MODE.icon - st[STATE_KEY.colors] = {} - st[STATE_KEY.icons] = { - default = DEFAULT_TAG_ICON, - } - st[STATE_KEY.linemode_order] = DEFAULT_LINEMODE_ORDER - if type(opts) == "table" then - st[STATE_KEY.ui_mode] = opts.ui_mode or st[STATE_KEY.ui_mode] - st[STATE_KEY.save_path] = pathJoin(opts.save_path or save_path) - st[STATE_KEY.colors] = opts.colors or st[STATE_KEY.colors] - st[STATE_KEY.icons] = ya.dict_merge(st[STATE_KEY.icons], opts.icons or {}) - st[STATE_KEY.linemode_order] = tonumber(opts.linemode_order) or st[STATE_KEY.linemode_order] - st[STATE_KEY.hints_disabled] = opts.hints_disabled or false - end - - st[STATE_KEY.hints_table] = ya.dict_merge(tbl_deep_clone(st[STATE_KEY.icons]), tbl_deep_clone(st[STATE_KEY.colors])) - -- render tags - Linemode:children_add(function(_self) - if st[STATE_KEY.ui_mode] == UI_MODE.hidden then - return "" - end - local is_search = get_cwd().is_search - local tags_tbl = tostring(is_search and _self._file.url.parent.path or _self._file.url.parent) - local fname = _self._file.name - local spans = {} - if st[STATE_KEY.tags_database][tags_tbl] and st[STATE_KEY.tags_database][tags_tbl][fname] then - -- default true - local is_reversed_color = not st[STATE_KEY.colors] - or st[STATE_KEY.colors].reversed == nil - or st[STATE_KEY.colors].reversed == true - if th.indicator and th.indicator.current and type(th.indicator.current.raw) == "function" then - is_reversed_color = th.indicator.current:raw().reversed - end - - local tags = st[STATE_KEY.tags_database][tags_tbl][fname] or {} - table.sort(tags) - for _, tag in ipairs(tags) do - local style = ui.Style() - if _self._file.is_hovered then - if is_reversed_color then - style:bg(st[STATE_KEY.colors][tag] and st[STATE_KEY.colors][tag] or "reset") - else - style:fg(st[STATE_KEY.colors][tag] and st[STATE_KEY.colors][tag] or "reset") - end - else - style:fg(st[STATE_KEY.colors][tag] and st[STATE_KEY.colors][tag] or "reset") - end - if st[STATE_KEY.ui_mode] == UI_MODE.icon then - spans[#spans + 1] = ui.Span(" " .. (st[STATE_KEY.icons][tag] or st[STATE_KEY.icons].default)) - :style(style) - elseif st[STATE_KEY.ui_mode] == UI_MODE.text then - spans[#spans + 1] = ui.Span(" " .. tag):style(style):bold() - end - end - end - return ui.Line(spans) - end, st[STATE_KEY.linemode_order]) - - ps.sub(PUBSUB_KIND.files_move, function(payload) - local changed_files = {} - for _, item in pairs(payload.items) do - local from = tostring(item.from) - local to = tostring(item.to) - changed_files[from] = to - end - enqueue_task(STATE_KEY.tasks_rename_tags, changed_files) - local args = ya.quote(TAG_ACTION.files_transferred) - ya.emit("plugin", { - self._id, - args, - }) - end) - - ps.sub(PUBSUB_KIND.files_copy, function(payload) - local changed_files = {} - for _, item in pairs(payload.items) do - local from = tostring(item.from) - local to = tostring(item.to) - changed_files[from] = to - end - enqueue_task(STATE_KEY.tasks_rename_tags, changed_files) - local args = ya.quote(TAG_ACTION.files_transferred) .. " " .. ya.quote("--mode=copy") - ya.emit("plugin", { - self._id, - args, - }) - end) - - ps.sub(PUBSUB_KIND.file_renamed, function(payload) - local changed_files = {} - changed_files[tostring(payload.from)] = tostring(payload.to) - enqueue_task(STATE_KEY.tasks_rename_tags, changed_files) - local args = ya.quote(TAG_ACTION.files_transferred) - ya.emit("plugin", { - self._id, - args, - }) - end) - - ps.sub(PUBSUB_KIND.files_bulk_renamed, function(payload) - local changed_files = {} - for from, to in pairs(payload) do - changed_files[tostring(from)] = tostring(to) - end - enqueue_task(STATE_KEY.tasks_rename_tags, changed_files) - local args = ya.quote(TAG_ACTION.files_transferred) - ya.emit("plugin", { - self._id, - args, - }) - end) - - ps.sub(PUBSUB_KIND.files_deleted, function(payload) - local args = ya.quote(TAG_ACTION.files_deleted) - local changed_files = {} - for _, url in ipairs(payload.urls) do - table.insert(changed_files, tostring(url)) - end - enqueue_task(STATE_KEY.tasks_delete_tags, changed_files) - ya.emit("plugin", { - self._id, - args, - }) - end) - - ps.sub(PUBSUB_KIND.files_trash, function(payload) - local args = ya.quote(TAG_ACTION.files_deleted) - local changed_files = {} - for _, url in ipairs(payload.urls) do - table.insert(changed_files, tostring(url)) - end - enqueue_task(STATE_KEY.tasks_delete_tags, changed_files) - ya.emit("plugin", { - self._id, - args, - }) - end) - - ps.sub_remote(PUBSUB_KIND.ui_mode_changed, function(mode) - set_state(STATE_KEY.ui_mode, mode) - render() - end) - - ps.sub_remote(PUBSUB_KIND.tags_tbl_changed, function(tags_tbl) - tags_tbl = hex_decode(tags_tbl) - local tags_db = get_state(STATE_KEY.tags_database) - if tags_db and tags_tbl and tags_db[tags_tbl] then - tags_db[tags_tbl] = read_tags_tbl(tags_tbl) - set_state(STATE_KEY.tags_database, tags_db) - render() - end - end) -end - -local function toggle_tag(files, new_tag_keys, mode) - local tags_db = get_state(STATE_KEY.tags_database) - local changed_tags_db = {} - for _, raw_url in ipairs(files) do - local url = Url(raw_url) - local tags_tbl = tostring(url.parent) - local fname = tostring(url.name) - if not tags_db[tags_tbl] then - tags_db[tags_tbl] = {} - end - if not tags_db[tags_tbl][fname] then - tags_db[tags_tbl][fname] = {} - end - local tags = tags_db[tags_tbl][fname] or {} - - if mode == TAG_ACTION.toggle then - local lookup = {} - - -- Convert array into a lookup table for fast searching - for i, v in ipairs(tags) do - lookup[v] = i -- Store the index of each element - end - -- Toggle each value in the values array - for _, v in ipairs(new_tag_keys) do - if lookup[v] then - -- If found, remove it - table.remove(tags, lookup[v]) - lookup = {} -- Reset lookup (indexes shift after removal) - for i, item in ipairs(tags) do - lookup[item] = i - end - else - -- If not found, add it - table.insert(tags, v) - lookup[v] = #tags -- Update lookup with new index - end - end - elseif mode == TAG_ACTION.remove then - -- remove if exist - tags = tbl_subtract(tags, new_tag_keys) - elseif mode == TAG_ACTION.add then - -- add if not exist - tags = tbl_unite(tags, new_tag_keys) - elseif mode == TAG_ACTION.replace then - -- replace if exist - tags = #new_tag_keys == 0 and nil or new_tag_keys - end - tags_db[tags_tbl][fname] = tags - changed_tags_db[tags_tbl] = tags_db[tags_tbl] - end - - enqueue_task(STATE_KEY.tasks_write_tags_db, changed_tags_db) - write_tags_db() -end - -local function show_cands_ui_modes() - local choice_action = ya.which({ cands = CAND_SELECTION_ACTION }) - if not choice_action then - return - end - local action = CAND_SELECTION_ACTION[choice_action].on - if action == "1" then - return TAG_ACTION.replace_select - elseif action == "2" then - return TAG_ACTION.unite_select - elseif action == "3" then - return TAG_ACTION.subtract_select - elseif action == "4" then - return TAG_ACTION.intersect_select - elseif action == "5" then - return TAG_ACTION.exclude_select - elseif action == "6" then - return TAG_ACTION.undo_select - end -end - --- ╭─────────────────────────────────────────────────────────╼ --- │ UI Section │ --- ╰─────────────────────────────────────────────────────────╯ - -local toggle_tags_hints = ya.sync(function(self) - if self[STATE_KEY.hints_disabled] then - return - end - if self.children then - Modal:children_remove(self.children) - self.children = nil - else - self.children = Modal:children_add(self, 20) - end - --TODO: remove this after next yazi released - (ui.render or ya.render)() -end) - -function M:new(area) - self:layout(area) - return self -end - -local function table_length(tbl) - local count = 0 - for _ in pairs(tbl) do - count = count + 1 - end - return count -end - -function M:layout(area) - local length = table_length(get_state(STATE_KEY.hints_table) or {}) - local chunks = ui.Layout() - :constraints({ - ui.Constraint.Fill(1), - ui.Constraint.Length(length + 1), - ui.Constraint.Percentage(5), - }) - :split(area) - - chunks = ui.Layout() - :direction(ui.Layout.HORIZONTAL) - :constraints({ - ui.Constraint.Fill(9), - ui.Constraint.Fill(1), - ui.Constraint.Percentage(1), - }) - :split(chunks[2]) - - self._area = chunks[2] -end - -function M:reflow() - return { self } -end - -function M:redraw() - local rows = {} - local colors = get_state(STATE_KEY.colors) or {} - local icons = get_state(STATE_KEY.icons) or {} - local rendered_tags = get_state(STATE_KEY.hints_table) - for tag, _ in ordered_pairs(rendered_tags) do - if tag ~= "default" and tag ~= "reversed" then - rows[#rows + 1] = ui.Row({ - ui.Line(ui.Span(tag):fg(colors[tag] and colors[tag] or "reset")):align(ui.Align.CENTER), - ui.Line(ui.Span(icons[tag] or icons.default):fg(colors[tag] and colors[tag] or "reset")) - :align(ui.Align.CENTER), - }) - end - end - - return { - ui.Clear(self._area), - ui.Border(ui.Edge.ALL) - :area(self._area) - :type(ui.Border.ROUNDED) - :style(th.spot.border or ui.Style():fg("blue")) - :title(ui.Line("Tags"):align(ui.Align.CENTER):style(th.spot.title or ui.Style():fg("blue"))), - ui.Table(rows) - :area(self._area:pad(ui.Pad(1, 1, 1, 1))) - :header( - ui.Row({ ui.Line("Key"):align(ui.Align.CENTER), ui.Line("Icon"):align(ui.Align.CENTER) }) - :style(ui.Style():bold()) - ) - :widths({ - ui.Constraint.Length(20), - ui.Constraint.Length(20), - ui.Constraint.Percentage(70), - ui.Constraint.Length(10), - }), - } -end - -local function show_cands_input_tags(title, input_mode, default_input_value) - local choice - if not input_mode then - toggle_tags_hints() - choice = ya.which({ cands = CAND_TAG_KEYS, silent = true }) - toggle_tags_hints() - if not choice then - return - end - return CAND_TAG_KEYS[choice].on - else - toggle_tags_hints() - local title_len = utf8.len(title) or 0 - local input_width = 50 - local max_width = 200 - if title_len > input_width then - input_width = title_len > max_width and max_width or title_len - title = title_len > input_width and (string.sub(title, 1, input_width) .. "...") or title - end - local input_value, input_event = ya.input({ - title = title, - value = default_input_value or "", - pos = { "center", w = input_width }, - -- TODO: remove this after next yazi released - position = { "center", w = input_width }, - }) - toggle_tags_hints() - if input_event == 1 and input_value then - return input_value or "" - else - return - end - end -end - -function M:entry(job) - local action = job.args[1] - ya.emit("escape", { visual = true }) - if - action == TAG_ACTION.toggle - or action == TAG_ACTION.add - or action == TAG_ACTION.remove - or action == TAG_ACTION.replace - then - local selected_tag_keys = {} - local inputted_files = selected_or_hovered_files() - local inputted_tags = job.args.tags or job.args.tags or job.args.keys or job.args.key - local input_mode = job.args.input - -- Mode: remove, add, toggle - local toggle_mode = action - local title = ( - toggle_mode == TAG_ACTION.add and "Add" - or toggle_mode == TAG_ACTION.remove and "Remove" - or toggle_mode == TAG_ACTION.replace and "Replace" - or "Toggle" - ) .. " tags:" - - if not inputted_tags then - inputted_tags = show_cands_input_tags(title, input_mode) - end - - if not inputted_tags then - return - end - for _, code in utf8.codes(inputted_tags) do - table.insert(selected_tag_keys, utf8.char(code)) - end - toggle_tag(inputted_files, selected_tag_keys, toggle_mode) - elseif action == TAG_ACTION.edit then - local files_to_update = selected_or_hovered_files() - if #files_to_update == 0 then - return - end - - local tags_db = get_state(STATE_KEY.tags_database) - local changed_tags_db = {} - for _, url_raw in ipairs(files_to_update) do - local updated_tags = {} - local url = Url(url_raw) - local tags_tbl = tostring(url.parent) - if not tags_db[tags_tbl] then - tags_db[tags_tbl] = {} - end - local fname = url.name - local title = "Edit tags (" .. fname .. "):" - local inputted_tags = show_cands_input_tags(title, true, table.concat(tags_db[tags_tbl][fname] or {})) - if inputted_tags == nil then - return - end - - for _, code in utf8.codes(inputted_tags) do - table.insert(updated_tags, utf8.char(code)) - end - tags_db[tags_tbl][fname] = #updated_tags == 0 and nil or updated_tags - changed_tags_db[tags_tbl] = tags_db[tags_tbl] - end - enqueue_task(STATE_KEY.tasks_write_tags_db, changed_tags_db) - write_tags_db() - elseif action == TAG_ACTION.clear then - enqueue_task(STATE_KEY.tasks_delete_tags, selected_or_hovered_files()) - delete_tags() - elseif action == TAG_ACTION.toggle_ui then - local ui_mode = job.args.mode - -- toggle between show icons/text keys/hidden - if not ui_mode then - local old_ui_mode = get_state(STATE_KEY.ui_mode) - for idx, m in ipairs(UI_MODE_ORDERED) do - if m == old_ui_mode then - ui_mode = UI_MODE_ORDERED[idx + 1 > #UI_MODE_ORDERED and 1 or idx + 1] - break - end - end - end - broadcast(PUBSUB_KIND.ui_mode_changed, ui_mode) - elseif - action == TAG_ACTION.toggle_select - or action == TAG_ACTION.replace_select - or action == TAG_ACTION.unite_select - or action == TAG_ACTION.subtract_select - or action == TAG_ACTION.intersect_select - or action == TAG_ACTION.exclude_select - or action == TAG_ACTION.undo_select - then - local select_mode = job.args.mode or SELECTION_MODE["and"] - local inputted_tags = job.args.tags or job.args.tags or job.args.keys or job.args.key - local input_mode = job.args.input - local selected_tag_keys = {} - -- NOTE: BACKWARD COMPATIBILITY warning - if select_mode ~= SELECTION_MODE["and"] and select_mode ~= SELECTION_MODE["or"] then - warn( - "Unsupported selection mode: %s, may be you are using an old configuration of simple-tag plugin, please check the documentation.", - select_mode - ) - end - -- NOTE: BACKWARD COMPATIBILITY warning - - local new_selected_files = {} - if action == TAG_ACTION.toggle_select then - action = show_cands_ui_modes() - if not action then - return - end - end - - -- Mode undo - if action == TAG_ACTION.undo_select then - new_selected_files = get_state(STATE_KEY.preserve_selected_files) or {} - if new_selected_files == nil then - return - end - local preserve_selected_files = selected_files() - set_state(STATE_KEY.preserve_selected_files, preserve_selected_files) - else - if not inputted_tags then - local title = "Select tags" - .. (select_mode == SELECTION_MODE["and"] and "" or ", MODE=(" .. select_mode .. ")") - .. ", ACTION=(" - .. action:gsub("%-select", "") - .. ")" - .. ":" - - if not inputted_tags then - inputted_tags = show_cands_input_tags(title, input_mode) - end - - if not inputted_tags then - return - end - end - for _, code in utf8.codes(inputted_tags) do - local key = utf8.char(code) - table.insert(selected_tag_keys, key) - end - - local cwd = get_cwd() - local tags_tbl = tostring(cwd.is_search and cwd.path or cwd) - local tags_db = get_state(STATE_KEY.tags_database) - local tagged_filenames = tags_db[tags_tbl] or {} - for fname, tags in pairs(tagged_filenames) do - if - (select_mode == SELECTION_MODE["and"] and tbl_is_subset(selected_tag_keys, tags)) - or (select_mode == SELECTION_MODE["or"] and tbl_contains_any(tags, selected_tag_keys)) - then - table.insert(new_selected_files, (tags_tbl .. path_separator .. fname)) - end - end - local preserve_selected_files = selected_files() - set_state(STATE_KEY.preserve_selected_files, preserve_selected_files) - local old_selected_files = tbl_deep_clone(preserve_selected_files) - if action == TAG_ACTION.replace_select then - -- no needs to do anything else - elseif action == TAG_ACTION.unite_select then - new_selected_files = tbl_unite(old_selected_files, new_selected_files) - elseif action == TAG_ACTION.intersect_select then - new_selected_files = tbl_intersect(old_selected_files, new_selected_files) - elseif action == TAG_ACTION.subtract_select then - new_selected_files = tbl_subtract(old_selected_files, new_selected_files) - elseif action == TAG_ACTION.exclude_select then - new_selected_files = tbl_exclude(old_selected_files, new_selected_files) - else - return - end - end - - -- clear selection - ya.emit("escape", { select = true }) - if #new_selected_files == 0 then - return - end - local valid_selected_files = {} - for _, url_raw in ipairs(new_selected_files) do - local url = Url(url_raw) - local cha = fs.cha(url, false) - if cha then - valid_selected_files[#valid_selected_files + 1] = url_raw - end - end - valid_selected_files.state = "on" - ya.emit("toggle_all", valid_selected_files) - elseif action == TAG_ACTION.filter then - local filter_tags = {} - local inputted_tags = job.args.tags or job.args.tags or job.args.keys or job.args.key - local filter_mode = job.args.mode or FILTER_MODE["and"] - local input_mode = job.args.input - local cwd = get_cwd() - local is_virtual = cwd.scheme and cwd.scheme.is_virtual - if is_virtual then - warn("Filtering by tags is not supported for virtual files") - return - end - local title = "Search tags" .. (filter_mode == FILTER_MODE["or"] and " (or)" or "") .. ":" - if not inputted_tags then - inputted_tags = show_cands_input_tags(title, input_mode) - end - - if not inputted_tags then - return - end - - for _, code in utf8.codes(inputted_tags) do - local key = utf8.char(code) - table.insert(filter_tags, key) - end - - local tags_tbl = tostring(cwd.is_search and cwd.path or cwd) - local tags_db = get_state(STATE_KEY.tags_database) - local tagged_filenames = tags_db[tags_tbl] or {} - - local id = ya.id("ft") - local filter_title = "MODE=(" .. filter_mode .. ")" .. " Tags=(" .. table.concat(filter_tags, "") .. ")" - local _cwd = cwd:into_search(filter_title) - ya.emit("cd", { Url(_cwd) }) - ya.emit("update_files", { op = fs.op("part", { id = id, url = Url(_cwd), files = {} }) }) - - local files = {} - for fname, tags in pairs(tagged_filenames) do - if - (filter_mode == FILTER_MODE["and"] and tbl_is_subset(filter_tags, tags)) - or (filter_mode == FILTER_MODE["or"] and tbl_contains_any(tags, filter_tags)) - then - -- local url = _cwd:join(fname) - -- TODO: WORKAROUND: cwd prefix `search://` can't be joined - local url = Url(tostring(_cwd.path or _cwd) .. path_separator .. tostring(fname)) - local cha = fs.cha(url, true) - if cha then - files[#files + 1] = File({ url = url, cha = cha }) - end - end - end - - ya.emit("update_files", { op = fs.op("part", { id = id, url = Url(_cwd), files = files }) }) - ya.emit("update_files", { - op = fs.op("done", { - id = id, - url = _cwd, - cha = Cha({ mode = tonumber("100644", 8) }), - }), - }) - elseif action == TAG_ACTION.files_deleted then - delete_tags() - elseif action == TAG_ACTION.files_transferred then - local mode = job.args.mode - local changes = dequeue_task(STATE_KEY.tasks_rename_tags) - if changes then - local changed_tags_db = {} - local tags_db = get_state(STATE_KEY.tags_database) - for from, to in pairs(changes) do - local from_url = Url(from) - local to_url = Url(to) - local old_tags_tbl = tostring(from_url.parent) - local new_tags_tbl = tostring(to_url.parent) - local old_fname = tostring(from_url.name) - local new_fname = tostring(to_url.name) - - if old_tags_tbl and old_fname and new_fname then - if tags_db and old_tags_tbl and tags_db[old_tags_tbl] and new_tags_tbl then - if not tags_db[new_tags_tbl] then - tags_db[new_tags_tbl] = {} - end - tags_db[new_tags_tbl][new_fname] = tags_db[old_tags_tbl][old_fname] - if mode ~= "copy" then - tags_db[old_tags_tbl][old_fname] = nil - end - changed_tags_db[old_tags_tbl] = tags_db[old_tags_tbl] - changed_tags_db[new_tags_tbl] = tags_db[new_tags_tbl] - end - end - end - enqueue_task(STATE_KEY.tasks_write_tags_db, changed_tags_db) - write_tags_db() - end - end -end - -return M diff --git a/yazi_1/.config/yazi/plugins/smart-enter.yazi/LICENSE b/yazi_1/.config/yazi/plugins/smart-enter.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/smart-enter.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/smart-enter.yazi/README.md b/yazi_1/.config/yazi/plugins/smart-enter.yazi/README.md deleted file mode 100644 index 742f2e1..0000000 --- a/yazi_1/.config/yazi/plugins/smart-enter.yazi/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# smart-enter.yazi - -[`Open`][open] files or [`enter`][enter] directories all in one key! - -## Installation - -```sh -ya pkg add yazi-rs/plugins:smart-enter -``` - -## Usage - -Bind your l key to the plugin, in your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "l" -run = "plugin smart-enter" -desc = "Enter the child directory, or open the file" -``` - -## Advanced - -By default, `--hovered` is passed to the [`open`][open] command, make the behavior consistent with [`enter`][enter] avoiding accidental triggers, -which means both will only target the currently hovered file. - -If you still want `open` to target multiple selected files, add this to your `~/.config/yazi/init.lua`: - -```lua -require("smart-enter"):setup { - open_multi = true, -} -``` - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. - -[open]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.open -[enter]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.enter diff --git a/yazi_1/.config/yazi/plugins/smart-enter.yazi/main.lua b/yazi_1/.config/yazi/plugins/smart-enter.yazi/main.lua deleted file mode 100644 index e9e2ec6..0000000 --- a/yazi_1/.config/yazi/plugins/smart-enter.yazi/main.lua +++ /dev/null @@ -1,11 +0,0 @@ ---- @since 25.5.31 ---- @sync entry - -local function setup(self, opts) self.open_multi = opts.open_multi end - -local function entry(self) - local h = cx.active.current.hovered - ya.emit(h and h.cha.is_dir and "enter" or "open", { hovered = not self.open_multi }) -end - -return { entry = entry, setup = setup } diff --git a/yazi_1/.config/yazi/plugins/smart-paste.yazi/LICENSE b/yazi_1/.config/yazi/plugins/smart-paste.yazi/LICENSE deleted file mode 100644 index ea5b606..0000000 --- a/yazi_1/.config/yazi/plugins/smart-paste.yazi/LICENSE +++ /dev/null @@ -1 +0,0 @@ -../LICENSE \ No newline at end of file diff --git a/yazi_1/.config/yazi/plugins/smart-paste.yazi/README.md b/yazi_1/.config/yazi/plugins/smart-paste.yazi/README.md deleted file mode 100644 index 5daa259..0000000 --- a/yazi_1/.config/yazi/plugins/smart-paste.yazi/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# smart-paste.yazi - -Paste files into the hovered directory or to the CWD if hovering over a file. - -https://github.com/user-attachments/assets/b3f6348e-abbe-42fe-9a67-a96e68f11255 - -## Installation - -```sh -ya pkg add yazi-rs/plugins:smart-paste -``` - -## Usage - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = "p" -run = "plugin smart-paste" -desc = "Paste into the hovered directory or CWD" -``` - -Note that, the keybindings above are just examples, please tune them up as needed to ensure they don't conflict with your other commands/plugins. - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/smart-paste.yazi/main.lua b/yazi_1/.config/yazi/plugins/smart-paste.yazi/main.lua deleted file mode 100644 index 0837a4b..0000000 --- a/yazi_1/.config/yazi/plugins/smart-paste.yazi/main.lua +++ /dev/null @@ -1,14 +0,0 @@ ---- @since 25.5.31 ---- @sync entry -return { - entry = function() - local h = cx.active.current.hovered - if h and h.cha.is_dir then - ya.emit("enter", {}) - ya.emit("paste", {}) - ya.emit("leave", {}) - else - ya.emit("paste", {}) - end - end, -} diff --git a/yazi_1/.config/yazi/plugins/toggle-pane.yazi/LICENSE b/yazi_1/.config/yazi/plugins/toggle-pane.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/toggle-pane.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/toggle-pane.yazi/README.md b/yazi_1/.config/yazi/plugins/toggle-pane.yazi/README.md deleted file mode 100644 index ba70f1f..0000000 --- a/yazi_1/.config/yazi/plugins/toggle-pane.yazi/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# toggle-pane.yazi - -Toggle the show, hide, and maximize states for different panes: parent, current, and preview. It respects the user's [`ratio` settings](https://yazi-rs.github.io/docs/configuration/yazi#mgr.ratio)! - -Assume the user's `ratio` is $$[A, B, C]$$, that is, $$\text{parent}=A, \text{current}=B, \text{preview}=C$$: - -- `min-parent`: Toggles between $$0$$ and $$A$$ - the parent is either completely hidden or showed with width $$A$$. -- `max-parent`: Toggles between $$A$$ and $$\infty$$ - the parent is either showed with width $$A$$ or fills the entire screen. -- `min-current`: Toggles between $$0$$ and $$B$$ - the current is either completely hidden or showed with width $$B$$. -- `max-current`: Toggles between $$B$$ and $$\infty$$ - the current is either showed with width $$B$$ or fills the entire screen. -- `min-preview`: Toggles between $$0$$ and $$C$$ - the preview is either completely hidden or showed with width $$C$$. -- `max-preview`: Toggles between $$C$$ and $$\infty$$ - the preview is either showed with width $$C$$ or fills the entire screen. -- `reset`: Resets to the user's configured `ratio`. - -## Installation - -```sh -ya pkg add yazi-rs/plugins:toggle-pane -``` - -## Usage - -Hide/Show preview: - -```toml -# keymap.toml -[[mgr.prepend_keymap]] -on = "T" -run = "plugin toggle-pane min-preview" -desc = "Show or hide the preview pane" -``` - -Maximize/Restore preview: - -```toml -# keymap.toml -[[mgr.prepend_keymap]] -on = "T" -run = "plugin toggle-pane max-preview" -desc = "Maximize or restore the preview pane" -``` - -You can replace `preview` with `current` or `parent` to toggle the other panes. - -Note that, the keybindings above are just examples, please tune them up as needed to ensure they don't conflict with your other commands/plugins. - -## Advanced - -In addition to triggering the plugin with a keypress, you can also trigger it in your `init.lua` file: - -```lua -if os.getenv("NVIM") then - require("toggle-pane"):entry("min-preview") -end -``` - -In the example above, when it detects that you're [using Yazi in nvim](https://yazi-rs.github.io/docs/resources#vim), the preview is hidden by default — you can always press `T` (or any key you've bound) to show it again. - -## Tips - -This plugin only maximizes the "available preview area", without actually changing the content size. - -This means that the appearance of your preview largely depends on the previewer you are using. -However, most previewers tend to make the most of the available space, so this usually isn't an issue. - -For image previews, you may want to tune up the [`max_width`][max-width] and [`max_height`][max-height] options in your `yazi.toml`: - -```toml -[preview] -# Change them to your desired values -max_width = 1000 -max_height = 1000 -``` - -[max-width]: https://yazi-rs.github.io/docs/configuration/yazi/#preview.max_width -[max-height]: https://yazi-rs.github.io/docs/configuration/yazi/#preview.max_height - -## License - -This plugin is MIT-licensed. For more information, check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/toggle-pane.yazi/main.lua b/yazi_1/.config/yazi/plugins/toggle-pane.yazi/main.lua deleted file mode 100644 index 72bbf0e..0000000 --- a/yazi_1/.config/yazi/plugins/toggle-pane.yazi/main.lua +++ /dev/null @@ -1,45 +0,0 @@ ---- @since 25.5.31 ---- @sync entry - -local function entry(st, job) - local R = rt.mgr.ratio - job = type(job) == "string" and { args = { job } } or job - - st.parent = st.parent or R.parent - st.current = st.current or R.current - st.preview = st.preview or R.preview - - local act, to = string.match(job.args[1] or "", "(.-)-(.+)") - if act == "min" then - st[to] = st[to] == R[to] and 0 or R[to] - elseif act == "max" then - local max = st[to] == 65535 and R[to] or 65535 - st.parent = st.parent == 65535 and R.parent or st.parent - st.current = st.current == 65535 and R.current or st.current - st.preview = st.preview == 65535 and R.preview or st.preview - st[to] = max - end - - if not st.old then - st.old = Tab.layout - Tab.layout = function(self) - local all = st.parent + st.current + st.preview - self._chunks = ui.Layout() - :direction(ui.Layout.HORIZONTAL) - :constraints({ - ui.Constraint.Ratio(st.parent, all), - ui.Constraint.Ratio(st.current, all), - ui.Constraint.Ratio(st.preview, all), - }) - :split(self._area) - end - end - - if not act then - Tab.layout, st.old = st.old, nil - st.parent, st.current, st.preview = nil, nil, nil - end - ya.emit("app:resize", {}) -end - -return { entry = entry } diff --git a/yazi_1/.config/yazi/plugins/vcs-files.yazi/LICENSE b/yazi_1/.config/yazi/plugins/vcs-files.yazi/LICENSE deleted file mode 100644 index fb5b1d6..0000000 --- a/yazi_1/.config/yazi/plugins/vcs-files.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 yazi-rs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/vcs-files.yazi/README.md b/yazi_1/.config/yazi/plugins/vcs-files.yazi/README.md deleted file mode 100644 index 7997d27..0000000 --- a/yazi_1/.config/yazi/plugins/vcs-files.yazi/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# vcs-files.yazi - -Show Git file changes in Yazi. - -https://github.com/user-attachments/assets/465b801b-3516-4f57-be09-8405da21e34d - -## Installation - -```sh -ya pkg add yazi-rs/plugins:vcs-files -``` - -## Usage - -```toml -# keymap.toml -[[mgr.prepend_keymap]] -on = [ "g", "c" ] -run = "plugin vcs-files" -desc = "Show Git file changes" -``` - -Note that, the keybindings above are just examples, please tune them up as needed to ensure they don't conflict with your other commands/plugins. - -## TODO - -- [ ] Add support for other VCS (e.g. Mercurial, Subversion) - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/vcs-files.yazi/main.lua b/yazi_1/.config/yazi/plugins/vcs-files.yazi/main.lua deleted file mode 100644 index 066c44a..0000000 --- a/yazi_1/.config/yazi/plugins/vcs-files.yazi/main.lua +++ /dev/null @@ -1,33 +0,0 @@ ---- @since 25.12.29 - -local root = ya.sync(function() return cx.active.current.cwd end) - -local function fail(content) return ya.notify { title = "VCS Files", content = content, timeout = 5, level = "error" } end - -local function entry() - local root = root() - local output, err = Command("git"):cwd(tostring(root)):arg({ "diff", "--name-only", "HEAD" }):output() - if err then - return fail("Failed to run `git diff`, error: " .. err) - elseif not output.status.success then - return fail("Failed to run `git diff`, stderr: " .. output.stderr) - end - - local id = ya.id("ft") - local cwd = root:into_search("Git changes") - ya.emit("cd", { Url(cwd) }) - ya.emit("update_files", { op = fs.op("part", { id = id, url = Url(cwd), files = {} }) }) - - local files = {} - for line in output.stdout:gmatch("[^\r\n]+") do - local url = cwd:join("search://Git changes/" .. line) -- TODO: remove "search://Git changes/" - local cha = fs.cha(url, true) - if cha then - files[#files + 1] = File { url = url, cha = cha } - end - end - ya.emit("update_files", { op = fs.op("part", { id = id, url = Url(cwd), files = files }) }) - ya.emit("update_files", { op = fs.op("done", { id = id, url = cwd, cha = Cha { mode = tonumber("100644", 8) } }) }) -end - -return { entry = entry } diff --git a/yazi_1/.config/yazi/plugins/what-size.yazi/LICENSE b/yazi_1/.config/yazi/plugins/what-size.yazi/LICENSE deleted file mode 100644 index dc36871..0000000 --- a/yazi_1/.config/yazi/plugins/what-size.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 Francesco Pira - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/what-size.yazi/README.md b/yazi_1/.config/yazi/plugins/what-size.yazi/README.md deleted file mode 100644 index 3883140..0000000 --- a/yazi_1/.config/yazi/plugins/what-size.yazi/README.md +++ /dev/null @@ -1,128 +0,0 @@ -# what-size.yazi - -A plugin for [yazi](https://github.com/sxyazi/yazi) to calculate the size of the current selection or the current working directory (if no selection is made). - -## Compatibility - -what-size supports Yazi on Linux, macOS, and Windows. - -### OS - -- Linux since first commit -- macOS since commit `42c6a0e` ([link](https://github.com/pirafrank/what-size.yazi/commit/42c6a0efb7245badb16781da5380be1a1705f3f2)) -- Windows since commit `4a56ead` ([link](https://github.com/pirafrank/what-size.yazi/commit/4a56ead2a84c5969791fb17416e0b451ab906c5d)) - -### Yazi - -In an effort to make things easy, I keep `compatibility/yazi-x.y.z` branches with each pointing to the most up-to-date commit compatible with yazi release `x.y.z`. Full table below. - -|Yazi releases|what-size branch name| -|---|---| -|*[latest stable](https://github.com/sxyazi/yazi/releases/latest)*|`main`| -|`25.5.28`|`compatibility/yazi-25.5.28`| -|`25.x`-`25.4.8`|`compatibility/yazi-25.4.8`| -|`0.4.x`|`compatibility/yazi-0.4.x`| -|`0.3.x`|`compatibility/yazi-0.3.x`| - -Please notice that `nightly` releses may work but are not explicitly supported. - -## Requirements - -### Before Yazi's version 25.5.28 - -- Use this commit: [Old version](https://github.com/pirafrank/what-size.yazi/commit/d8966568f2a80394bf1f9a1ace6708ddd4cc8154) -- `du` on Linux and macOS -- PowerShell on Windows - -### On Yazi's version 25.5.28 or newer - -- No requirement - -## Installation - -```sh -ya pkg add pirafrank/what-size -``` - -or (**DEPRECATED** - use only for yazi `25.4.8` and older): - -```sh -ya pack -a 'pirafrank/what-size' -``` - -## Usage - -### Keymap - -Add this to your `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = [ ".", "s" ] -run = "plugin what-size" -desc = "Calc size of selection or cwd" -``` - -If you want to copy the result to clipboard, you can add `--clipboard` or `-c` as 2nd positional argument: - -```toml -[[mgr.prepend_keymap]] -on = [ ".", "s" ] -run = "plugin what-size -- '--clipboard'" -desc = "Calc size of sel/cwd + paste to clipboard" -``` - -```toml -[[mgr.prepend_keymap]] -on = [ ".", "s" ] -run = "plugin what-size -- '-c'" -desc = "Calc size of sel/cwd + paste to clipboard" -``` - -Change to whatever keybinding you like. - -### User interface (optional) - -If you want to place the size value exactly where you want, modify the priority value. Also changing two strings `LEFT` and `RIGHT` will add them to the left and right side of the value. Remember to add to and change these lines inside your `init.lua` file if you want to customize, or the plugin will use this configuration by default: - -```lua -require("what-size"):setup({ - priority = 400, - LEFT = "", - RIGHT = " ", -}) -``` - -## Feedback - -If you have any feedback, suggestions, or ideas please let me know by opening an issue. - -## Dev setup - -Check the debug config [here](https://yazi-rs.github.io/docs/plugins/overview/#debugging). - -To get debug logs while develoing use `ya.dbg()` in your code, then set the `YAZI_LOG` environment variable to `debug` before running Yazi. - -```sh -YAZI_LOG=debug yazi -``` - -Logs will be saved to `~.local/state/yazi/yazi.log` file. - -### Plugin definition - -The repo already has a `.luarc.json` file. You only need to run the following to add the `types` plugin dependency: - -```sh -ya pkg add yazi-rs/plugins:types -``` - -as per the [docs](https://github.com/yazi-rs/plugins/tree/main/types.yazi). - -## Contributing - -Contributions are welcome. Please fork the repository and submit a PR. - -## License - -MIT diff --git a/yazi_1/.config/yazi/plugins/what-size.yazi/main.lua b/yazi_1/.config/yazi/plugins/what-size.yazi/main.lua deleted file mode 100644 index 00b9109..0000000 --- a/yazi_1/.config/yazi/plugins/what-size.yazi/main.lua +++ /dev/null @@ -1,238 +0,0 @@ ---- @since 25.5.28 --- This plugin is now only supporting Yazi's version 25.5.28 or newer --- since commit https://github.com/sxyazi/yazi/pull/2695 - --- TODO: Asynchronous calculating and dynamic displaying in statusline, --- perhaps by using this: --- https://yazi-rs.github.io/docs/plugins/utils/#ps.sub --- and by using ui.render() method --- See also: --- https://github.com/sxyazi/yazi/pull/1903 --- https://yazi-rs.github.io/docs/dds/#kinds --- https://github.com/sxyazi/yazi/pull/2210 --- https://github.com/imsi32/yatline.yazi --- TODO: Add options to choose displaying in popup box or in statusline --- TODO: Add spotter and previewer widget to support simpler displaying --- TODO: Remove note [1] and [2] after add them to the setup --- configuration - --- Get selected paths {{{1 -local get_selected_paths = ya.sync(function(state) - local result = {} - if cx and cx.active and cx.active.selected then - for _, url in pairs(cx.active.selected) do - result[#result + 1] = url - end - end - return result -end) --- }}}1 --- Get current working directory in sync context {{{1 -local get_cwd = ya.sync(function(state) - if cx and cx.active and cx.active.current and cx.active.current.cwd then - return cx.active.current.cwd - end - return nil -end) --- }}}1 --- Function to get paths of selected files or current directory {{{1 ---- @param selected table Table of selected urls ---- @return paths table Table of selected urls -local function get_paths(selected) - -- If no files are selected, get current directory - if #selected == 0 then - local paths = {} - -- Try fs.cwd() first (async, optimized for slow devices) - local cwd, err = fs.cwd() - if cwd then - paths[1] = cwd - else - -- Fallback to cx.active.current.cwd (via sync block) - local sync_cwd = get_cwd() - if sync_cwd then - paths[1] = sync_cwd - else - ya.notify { - title = "What size", - content = "Cannot get current working directory: " .. (err or "unknown error"), - timeout = 5, - level = "error", - } - end - end - return paths - else - -- This variable is a table of urls already - return selected - end -end --- }}}1 --- Function to get total size using Yazi's fs.calc_size API {{{1 --- See: https://github.com/sxyazi/yazi/pull/2695 --- See: https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/folder.lua -local function get_total_size(items) - local total = 0 - for _, url in ipairs(items) do - local it = fs.calc_size(url) - while true do - local next = it:recv() - if next then - total = total + next - else - break - end - end - end - return total -end --- }}}1 --- Function to format files/folders size {{{1 -local function format_size(size) - local units = { "B", "KB", "MB", "GB", "TB" } - local unit_index = 1 - while size > 1024 and unit_index < #units do - size = size / 1024 - unit_index = unit_index + 1 - end - return string.format("%.2f %s", size, units[unit_index]) -end --- }}}1 --- Generic setter for any state field {{{1 -local set_state = ya.sync(function(state, field, value) - state[field] = value -end) --- }}}1 --- Generic getter for any state field {{{1 -local get_state = ya.sync(function(state, field) - return state[field] or nil -end) --- }}}1 --- Get selecting state {{{1 -local get_selected = ya.sync(function() - return (not cx.active.mode.is_visual) and (#cx.active.selected ~= 0) -end) --- }}}1 --- Set separators {{{1 -local set_separator = ya.sync(function(state, table) - if table and table.LEFT and table.RIGHT then - state.LEFT = table.LEFT - state.RIGHT = table.RIGHT - else - state.LEFT = " " - state.RIGHT = " " - end -end) --- }}}1 --- Get separators {{{1 -local get_separator = ya.sync(function(state) - return {state.LEFT, state.RIGHT} -end) --- }}}1 --- Redraw statusline {{{1 -local redraw_statusline = ya.sync(function(state) - ui.render() -end) --- }}}1 --- Set ui line in statusline for size, clean up when no selection exists {{{1 --- @return of get_state("renewed_state") number or nil Returning -1 --- means never show the size - suitable for setup function; --- returning 0 means the size will be shown after triggering the --- calculation, but without unselect the selections, or it will be --- hidden after nothing is selected; returning 1 means hidden when --- nothing is selected as said. -local set_ui_line = function(state) - local sep_left, sep_right = table.unpack(get_separator()) - - if get_state("renewed_state") == -1 then - return "" - else - if not get_selected() then - if not get_state("is_held") then - set_state("renewed_state", 1) - return "" - end - -- NOTE [1]: Set this line if DON'T want to clear the value - -- in the statusline when move the cursor, after calculating - -- with NO selection(s). Or just return "" - return ui.Span(sep_left .. get_state("size") .. sep_right) - end - if get_state("renewed_state") == 0 then - return ui.Span(sep_left .. get_state("size") .. sep_right) - else - -- NOTE [2]: Set this line if want to clear the value in the - -- statusline when move the cursor, after calculating WITH - -- selection: return ui.Span(sep_left .. get_state("size") .. sep_right) - -- or just remove after the unselection like below - return "" - end - end -end --- }}}1 - ---- @since 25.12.29 -return { - entry = function(self, job) - local clipboard = job.args.clipboard or job.args[1] == '-c' - - local selected = get_selected_paths() - local prepend_msg - -- Keep showing the size after CWD calculation (no selections) - if #selected == 0 then - set_state("is_held", true) - prepend_msg = "Current Dir: " - else - set_state("is_held", false) - prepend_msg = "Selected: " - end - - local items = get_paths(selected) - if not items or #items == 0 then - ya.notify { - title = "What size", - content = "Failed to get paths", - timeout = 5, - } - return - end - - local total_size = get_total_size(items) - if not total_size then - ya.notify { - title = "What size", - content = "Failed to calculate size", - timeout = 5, - } - return - end - - local formatted_size = format_size(total_size) - - local notification_content = prepend_msg .. formatted_size - if clipboard then - ya.clipboard(formatted_size) - notification_content = notification_content .. "\nCopied to clipboard." - end - ya.notify { - title = "What size", - content = notification_content, - timeout = 4, - } - - set_state("size", formatted_size) - set_state("renewed_state", 0) - redraw_statusline() - end, - - setup = function(state, opts) - opts = opts or {} - local priority = opts.priority or 400 - set_separator(opts) - set_state("renewed_state", -1) - - if Status and type(Status.children_add) == "function" then - Status:children_add(set_ui_line, priority, Status.RIGHT) - else - ya.err("Failed to initialize status bar: Status or children_add not available") - end - end, -} diff --git a/yazi_1/.config/yazi/plugins/whoosh.yazi b/yazi_1/.config/yazi/plugins/whoosh.yazi deleted file mode 160000 index 67bebd1..0000000 --- a/yazi_1/.config/yazi/plugins/whoosh.yazi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 67bebd12ad052b527b40ff2d24d6bba086da3fc1 diff --git a/yazi_1/.config/yazi/plugins/wise-enter.yazi/LICENSE b/yazi_1/.config/yazi/plugins/wise-enter.yazi/LICENSE deleted file mode 100644 index d822628..0000000 --- a/yazi_1/.config/yazi/plugins/wise-enter.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 Vasilina Demidova - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/wise-enter.yazi/README.md b/yazi_1/.config/yazi/plugins/wise-enter.yazi/README.md deleted file mode 100644 index 8a45526..0000000 --- a/yazi_1/.config/yazi/plugins/wise-enter.yazi/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# wise-enter.yazi -Yazi plugin: enter the deepest subfolder, extract archives, open files - all in `` key - ---- - -## Features - -- **Tunnel skipping** — if a directory contains only a single subdirectory, it jumps straight to the deepest non-trivial level (e.g. `a/b/c/` → enters `c` directly) -- **Archive extraction** — extracts archives via `unar` and then navigates into the result, also skipping tunnels -- **Smart file opening** — opens regular files with `open`, with optional multi-select support via `open_multi` - -## Requirements - -- [Yazi](https://github.com/sxyazi/yazi) -- [`unar`](https://theunarchiver.com/command-line) (provided by the `unarchiver` package) - -```bash -# Arch Linux -sudo pacman -S unarchiver - -# macOS -brew install unar -``` - -## Installation - -```bash -ya pkg add jaam8/wise-enter -``` - -Or manually clone into your Yazi plugins directory: - -```bash -git clone https://github.com/jaam8/wise-enter.yazi.git ~/.config/yazi/plugins/wise-enter.yazi -``` - -## Usage - -Add to `~/.config/yazi/keymap.toml`: - -```toml -[[manager.keymap]] -on = "" -run = "plugin wise-enter" -desc = "Wise enter" -``` - -Optionally configure in `~/.config/yazi/init.lua`: - -```lua -require("wise-enter"):setup { - open_multi = false, -- set to true to open all selected files instead of hovered only -} -``` - -## Behavior - -| Hovered item | Action | -|---|---| -| Directory (no tunnel) | `enter` — navigate one level in | -| Directory (with tunnel) | `cd` — jump straight to the deepest non-empty directory | -| Archive | Extract via `unar`, then apply directory logic to the result | -| Regular file | `open` — respects `open_multi` option | - -## Credits - -Inspired by and built on top of: -- [smart-enter.yazi](https://github.com/yazi-rs/plugins/tree/main/smart-enter.yazi) — the original archive extraction + tunnel skipping idea -- [fast-enter.yazi](https://github.com/ourongxing/fast-enter.yazi) — the `open_multi` and `enter`/`open` toggle approach - -## License - -This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file. diff --git a/yazi_1/.config/yazi/plugins/wise-enter.yazi/main.lua b/yazi_1/.config/yazi/plugins/wise-enter.yazi/main.lua deleted file mode 100644 index a82950c..0000000 --- a/yazi_1/.config/yazi/plugins/wise-enter.yazi/main.lua +++ /dev/null @@ -1,76 +0,0 @@ ---- @sync entry - -local function setup(self, opts) - self.open_multi = opts and opts.open_multi or false -end - -local function is_folder_only(path) - local p = io.popen("ls -l " .. ya.quote(path), "r") - if p == nil then return false end - local num = -1 - local flag = false - for line in p:lines() do - num = num + 1 - if num == 1 and line:sub(1, 1) == "d" then flag = true end - end - p:close() - return num == 1 and flag or false -end - -local function get_innermost_directory(path) - if not is_folder_only(path) then return path end - local dirs = io.popen("ls " .. ya.quote(path), "r") - if dirs == nil then return path end - local next = path - for dir in dirs:lines() do - next = path .. "/" .. dir - end - dirs:close() - return get_innermost_directory(next) -end - -local function is_archive(mime) - local patterns = { - "application/zip", - "application/gzip", - "application/x-tar", - "application/x-bzip", - "application/x-bzip2", - "application/x-7z-compressed", - "application/x-rar", - "application/x-xz", - } - for _, pattern in ipairs(patterns) do - if mime:match(pattern) then return true end - end - return false -end - -local function extract(archive) - local filename = archive:match("(.*)%.([^%.]+)$") - os.execute("unar -f -d " .. ya.quote(archive) .. " >/dev/null 2>&1") - return filename -end - -local function entry(self) - local h = cx.active.current.hovered - if h == nil then return end - - if h.cha.is_dir then - local path = tostring(h.url) - if is_folder_only(path) then - ya.emit("cd", { get_innermost_directory(path) }) - else - ya.emit("enter", {}) - end - - elseif is_archive(h:mime()) then - local extracted = extract(tostring(h.url)) - ya.emit("cd", { get_innermost_directory(extracted) }) - - else - ya.emit("open", { hovered = not self.open_multi }) - end -end - -return { entry = entry, setup = setup } diff --git a/yazi_1/.config/yazi/plugins/yafg.yazi/LICENSE b/yazi_1/.config/yazi/plugins/yafg.yazi/LICENSE deleted file mode 100644 index 0ad25db..0000000 --- a/yazi_1/.config/yazi/plugins/yafg.yazi/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/yazi_1/.config/yazi/plugins/yafg.yazi/README.md b/yazi_1/.config/yazi/plugins/yafg.yazi/README.md deleted file mode 100644 index 5b0ae37..0000000 --- a/yazi_1/.config/yazi/plugins/yafg.yazi/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# yafg.yazi (Yet Another FG) - -Fuzzy find and grep in Yazi using ripgrep and fzf. This plugin provides an interactive search interface that allows you to search file contents and open results directly in your configured editor. - -> Inspired by [fg.yazi](https://github.com/DreamMaoMao/fg.yazi) - -## Requirements - -- `bash` -- `rg` (ripgrep) -- `fzf` -- `bat` -- A text editor (default: `hx` Helix) - -## Installation - -Install the plugin via the package manager: - -```bash -ya pkg add XYenon/yafg -``` - -This clones the repository, adds it to `~/.config/yazi/package.toml`, and pins the current revision. - -## Usage - -Add a shortcut in `~/.config/yazi/keymap.toml`: - -```toml -[[mgr.prepend_keymap]] -on = [ "F", "G" ] -run = "plugin yafg" -``` - -## Configuration - -Customize the editor and command format in `~/.config/yazi/init.lua`: - -```lua -require("yafg"):setup({ - editor = "nvim", -- Editor command (default: "hx") - args = { "--noplugin" }, -- Additional editor arguments (default: {}) - file_arg_format = "+{row} {file}", -- File argument format (default: "{file}:{row}:{col}") -}) -``` - -Format placeholders: - -- `{file}` - File path -- `{row}` - Line number -- `{col}` - Column number - -## Features - -- **Interactive search**: Use ripgrep to search file contents with live preview -- **Switch modes**: Press `Ctrl-T` to toggle between ripgrep and fzf modes -- **Multi-select**: Select multiple search results -- **Preview**: View file contents with syntax highlighting via bat -- **Direct open**: Opens selected files in your configured editor at the matched line -- **Configurable**: Customize editor command, arguments, and file format - -## Troubleshooting - -- **Failed to start fzf**: ensure all required dependencies are installed (`rg`, `fzf`, `bat`, `bash`). -- **Preview not working**: install `bat` for syntax-highlighted previews. -- **Editor not opening**: ensure your configured editor is installed and in your PATH, or customize it in `init.lua`. - -## Development - -This repository uses [treefmt](https://github.com/numtide/treefmt) for formatting: - -```bash -nix fmt -``` - -Feel free to open a PR to add more features or support additional editors. diff --git a/yazi_1/.config/yazi/plugins/yafg.yazi/main.lua b/yazi_1/.config/yazi/plugins/yafg.yazi/main.lua deleted file mode 100644 index 0ff84ff..0000000 --- a/yazi_1/.config/yazi/plugins/yafg.yazi/main.lua +++ /dev/null @@ -1,113 +0,0 @@ -local M = { - editor = "hx", - args = {}, - file_arg_format = "{file}:{row}:{col}", -} - -local cwd = ya.sync(function() - return cx.active.current.cwd -end) - -local sync_self = ya.sync(function() - local self = {} - for key, value in pairs(M) do - if type(value) ~= "function" then - self[key] = value - end - end - return self -end) - -function M:setup(opts) - self.editor = opts.editor or self.editor - self.args = opts.args or self.args - self.file_arg_format = opts.file_arg_format or self.file_arg_format -end - -function M:entry() - ya.emit("escape", { visual = true }) - - local _permit = ui.hide() - local cwd = cwd() - - local output, err = M.run_with(cwd) - if not output then - return ya.notify({ title = "Yafg", content = tostring(err), timeout = 5, level = "error" }) - end - - local results = M.split_results(cwd, output) - if #results == 0 then - return - elseif #results == 1 then - local first_url = results[1][1] - local cha = fs.cha(first_url) - ya.emit(cha and cha.is_dir and "cd" or "reveal", { Url(first_url) }) - end - - local ss = sync_self() - local args = {} - for i, arg in ipairs(ss.args) do - args[i] = ya.quote(arg) - end - local file_args = {} - for i, result in ipairs(results) do - local arg = string.gsub(ss.file_arg_format, "{file}", ya.quote(tostring(result[1]))) - arg = string.gsub(arg, "{row}", tostring(result[2])) - arg = string.gsub(arg, "{col}", tostring(result[3])) - file_args[i] = arg - end - - local cmd = ss.editor .. " " .. table.concat(args, " ") .. " " .. table.concat(file_args, " ") - ya.dbg("Yafg", "editor cmd", cmd) - os.execute(cmd) -end - -function M.run_with(cwd) - local cmd_args = [=[ - RG_PREFIX='rg --column --line-number --no-heading --color=always --smart-case' - PREVIEW='bat --color=always --highlight-line={2} {1}' - fzf --ansi --disabled --multi \ - --bind "start:reload:${RG_PREFIX} {q}" \ - --bind "change:reload:sleep 0.1; ${RG_PREFIX} {q} || true" \ - --bind "ctrl-t:transform:[[ ! \${FZF_PROMPT} =~ ripgrep ]] && - echo 'rebind(change)+change-prompt(1. ripgrep> )+disable-search+reload:${RG_PREFIX} \{q} || true' || - echo 'unbind(change)+change-prompt(2. fzf> )+enable-search+reload:${RG_PREFIX} \"\" || true'" \ - --color "hl:-1:underline,hl+:-1:underline:reverse" \ - --prompt '1. ripgrep> ' \ - --delimiter : \ - --header 'CTRL-T: Switch between ripgrep/fzf' \ - --preview "${PREVIEW}" \ - --preview-window 'up,60%,~3,+{2}+3/2' \ - --nth '3..' - ]=] - local child, err = - Command("bash"):arg({ "-c", cmd_args }):cwd(tostring(cwd)):stdin(Command.INHERIT):stdout(Command.PIPED):spawn() - - if not child then - return nil, Err("Failed to start `fzf`, error: %s", err) - end - - local output, err = child:wait_with_output() - if not output then - return nil, Err("Cannot read `fzf` output, error: %s", err) - elseif not output.status.success and output.status.code ~= 130 then - return nil, Err("`fzf` exited with error code %s", output.status.code) - end - return output.stdout, nil -end - -function M.split_results(cwd, output) - local t = {} - for line in output:gmatch("[^\r\n]+") do - local file, row, col = (string.gmatch(line, "(..-):(%d+):(%d+):"))() - local u = Url(file) - if u.is_absolute then - t[#t + 1] = { u, row, col } - else - t[#t + 1] = { cwd:join(u), row, col } - end - end - return t -end - -return M diff --git a/yazi_1/.config/yazi/plugins/yaziline.yazi/LICENSE b/yazi_1/.config/yazi/plugins/yaziline.yazi/LICENSE deleted file mode 100644 index 82a69f6..0000000 --- a/yazi_1/.config/yazi/plugins/yaziline.yazi/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 llanosrocas - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/yazi_1/.config/yazi/plugins/yaziline.yazi/README.md b/yazi_1/.config/yazi/plugins/yaziline.yazi/README.md deleted file mode 100644 index 5291f00..0000000 --- a/yazi_1/.config/yazi/plugins/yaziline.yazi/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# yaziline.yazi - -Simple lualine-like status line for yazi. - -![angly](https://github.com/llanosrocas/yaziline.yazi/blob/main/.github/images/angly.png) -![preview-fullscreen](https://github.com/llanosrocas/yaziline.yazi/blob/main/.github/images/preview-fullscreen.png) - -All supported features are listed [here](#features). More presets are available [here](#presets). - -## Requirements - -- yazi version >= [917e1f5](https://github.com/sxyazi/yazi/commit/917e1f54a10445f2e25147c4b81a3c77d8233632) -- Font with symbol support. For example [Nerd Fonts](https://www.nerdfonts.com/). - -## Compatibility - -To keep the plugin up to date, there are two branches: `main` and `nightly`. -The `main` branch follows major yazi releases, while `nightly` is linked to specific yazi commits or changes. - -This setup allows shipping stable versions on time, while giving early access to "cutting-edge" changes. See matrix below. - -
-Compatibility matrix - -| yaziline | yazi | -| :------------------------------------------------------------------------: | ----------------------------------------------------------------------------------------- | -| [v2.5.2](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.2) | [v25.12.29](https://github.com/sxyazi/yazi/releases/tag/v25.12.29) | -| [v2.5.2](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.2) | [2f66561](https://github.com/sxyazi/yazi/commit/2f66561a8251f8788b2b0fd366af90555ecafc86) | -| [v2.5.2](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.2) | [6cfa92f](https://github.com/sxyazi/yazi/commit/6cfa92f11205d212155579b5b76d4cbabe723829) | -| [v2.5.2](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.2) | [917e1f5](https://github.com/sxyazi/yazi/commit/917e1f54a10445f2e25147c4b81a3c77d8233632) | -| [v2.5.1](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.1) | [917e1f5](https://github.com/sxyazi/yazi/commit/917e1f54a10445f2e25147c4b81a3c77d8233632) | -| [v2.5.0](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.5.0) | [v25.5.28](https://github.com/sxyazi/yazi/releases/tag/v25.5.28) | -| [v2.4.0](https://github.com/llanosrocas/yaziline.yazi/releases/tag/v2.4.0) | [v25.4.8](https://github.com/sxyazi/yazi/releases/tag/v25.4.8) | - -
- -## Installation - -1. Using yazi package manager - -```sh -ya pkg add llanosrocas/yaziline -``` - -_Or manually copy `main.lua` to the `~/.config/yazi/plugins/yaziline.yazi/main.lua`_ - -2. Add this line to your `~/.config/yazi/init.lua`: - -```lua -require("yaziline"):setup() -``` - -## Configuration - -This is default config, if you want to see presets go to [this section](#presets). - -```lua -require("yaziline"):setup({ - color = "#98c379", - secondary_color = "#5A6078", - default_files_color = "darkgray", -- color of the file counter when it's inactive - selected_files_color = "white", - yanked_files_color = "green", - cut_files_color = "red", - - separator_style = "angly", -- "angly" | "curvy" | "liney" | "empty" - separator_open = "î‚Č", - separator_close = "", - separator_open_thin = "", - separator_close_thin = "", - separator_head = "", - separator_tail = "", - - select_symbol = "", - yank_symbol = "󰆐", - - filename_max_length = 24, -- truncate when filename > 24 - filename_truncate_length = 6, -- leave 6 chars on both sides - filename_truncate_separator = "..." -}) -``` - -By default yaziline uses color values from your `theme.toml`: - -- mode and position font color: th.which.mask.bg -- default_files_color: which.separator_style.fg -- selected_files_color: mgr.count_selected.bg -- yanked_files_color: mgr.count_copied.bg -- cut_files_color: mgr.count_cut.bg - -``` - MODE  size  long_file...name.md  S 0 Y 0 -| | | | | | | | | -| | | | | | | | └─── yank_symbol -| | | | | | | └─────── select_symbol -| | | | | | └───────── separator_close_thin -| | | | | └─────────────────── filename_truncate_separator -| | | | └─────────────────────────────── separator_close -| | | └────────────────────────────────── secondary_color -| | └────────────────────────────────────── separator_close -| └────────────────────────────────────────── color -└───────────────────────────────────────────── separator_head -``` - -## Features - -### Presets - -- `angly` - ![angly](https://github.com/llanosrocas/yaziline.yazi/blob/main/.github/images/angly.png) -- `curvy` - ![curvy](https://github.com/llanosrocas/yaziline.yazi/blob/main/.github/images/curvy.png) -- `liney` - ![liney](https://github.com/llanosrocas/yaziline.yazi/blob/main/.github/images/liney.png) -- `empty` - ![empty](https://github.com/llanosrocas/yaziline.yazi/blob/main/.github/images/empty.png) - -### Selected and Yanked Counter - -Displays the number of selected ('S') and yanked ('Y') files on the left. If files are cut, the yank counter changes color, since its `yank --cut` under the hood. - -### Truncated filename - -Displays the truncated filename on the left, which is useful for smaller windows or long filenames. By default, it's 24 characters with trimming to 12 (6 + 6). Adjust in the `setup`. - -```lua -require("yaziline"):setup({ - filename_max_length = 24, - filename_truncate_length = 6, - filename_truncate_separator = "..." -}) -``` - -### ISO Date for 'Modified' - -On the right, you'll find the date and time the file was modified, formatted in an [ISO](https://en.wikipedia.org/wiki/ISO_8601)-like string for universal date representation. Adjust in the `Status:date` function. - -## Credits - -- [yazi source code](https://github.com/sxyazi/yazi) -- [yatline.yazi](https://github.com/imsi32/yatline.yazi/tree/main) -- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) diff --git a/yazi_1/.config/yazi/plugins/yaziline.yazi/main.lua b/yazi_1/.config/yazi/plugins/yaziline.yazi/main.lua deleted file mode 100644 index 2bbbd16..0000000 --- a/yazi_1/.config/yazi/plugins/yaziline.yazi/main.lua +++ /dev/null @@ -1,212 +0,0 @@ ----@diagnostic disable: undefined-global - -local function setup(_, options) - options = options or {} - - local default_separators = { - angly = { "î‚Č", "", "", "" }, - curvy = { "", "", "", "î‚”" }, - liney = { "", "", "|", "|" }, - empty = { "", "", "", "" }, - } - local separators = default_separators[options.separator_style or "angly"] - - local config = { - separator_styles = { - separator_open = options.separator_open or separators[1], - separator_close = options.separator_close or separators[2], - separator_open_thin = options.separator_open_thin or separators[3], - separator_close_thin = options.separator_close_thin or separators[4], - separator_head = options.separator_head or "", - separator_tail = options.separator_tail or "", - }, - select_symbol = options.select_symbol or "S", - yank_symbol = options.yank_symbol or "Y", - - filename_max_length = options.filename_max_length or 24, - filename_truncate_length = options.filename_truncate_length or 6, - filename_truncate_separator = options.filename_truncate_separator or "...", - - color = options.color or nil, - secondary_color = options.secondary_color or nil, - default_files_color = options.default_files_color - or th.which.separator_style:fg() - or "darkgray", - selected_files_color = options.selected_files_color - or th.mgr.count_selected:bg() - or "white", - yanked_files_color = options.selected_files_color - or th.mgr.count_copied:bg() - or "green", - cut_files_color = options.cut_files_color - or th.mgr.count_cut:bg() - or "red", - } - - local current_separator_style = config.separator_styles - - function Header:count() - return ui.Line({}) - end - - function Status:mode() - local mode = tostring(self._tab.mode):upper() - - local style = self:style() - return ui.Line({ - ui.Span(current_separator_style.separator_head) - :fg(config.color or style.main:bg()), - ui.Span(" " .. mode .. " ") - :fg(th.which.mask:bg()) - :bg(config.color or style.main:bg()), - }) - end - - function Status:size() - local h = self._current.hovered - local size = h and (h:size() or h.cha.len) or 0 - - local style = self:style() - return ui.Span(current_separator_style.separator_close .. " " .. ya.readable_size(size) .. " ") - :fg(config.color or style.main:bg()) - :bg(config.secondary_color or th.which.separator_style:fg()) - end - - function Status:utf8_sub(str, start_char, end_char) - local start_byte = utf8.offset(str, start_char) - local end_byte = end_char and (utf8.offset(str, end_char + 1) - 1) or #str - - if not start_byte or not end_byte then - return "" - end - - return string.sub(str, start_byte, end_byte) - end - - function Status:truncate_name(filename, max_length) - local base_name, extension = filename:match("^(.+)(%.[^%.]+)$") - base_name = base_name or filename - extension = extension or "" - - if utf8.len(base_name) > max_length then - base_name = self:utf8_sub(base_name, 1, config.filename_truncate_length) - .. config.filename_truncate_separator - .. self:utf8_sub(base_name, -config.filename_truncate_length) - end - - return base_name .. extension - end - - function Status:name() - local h = self._current.hovered - local style = self:style() - if not h then - return ui.Line({ - ui.Span(current_separator_style.separator_close .. " ") - :fg(config.secondary_color or th.which.separator_style:fg()), - ui.Span("Empty dir") - :fg(config.color or style.main:bg()), - }) - end - - local truncated_name = self:truncate_name(h.name, config.filename_max_length) - - return ui.Line({ - ui.Span(current_separator_style.separator_close .. " ") - :fg(config.secondary_color or th.which.separator_style:fg()), - ui.Span(truncated_name) - :fg(config.color or style.main:bg()), - }) - end - - function Status:files() - local files_yanked = #cx.yanked - local files_selected = #cx.active.selected - local files_cut = cx.yanked.is_cut - - local selected_fg = files_selected > 0 - and config.selected_files_color - or config.default_files_color - local yanked_fg = files_yanked > 0 - and - (files_cut - and config.cut_files_color - or config.yanked_files_color - ) - or config.default_files_color - - local yanked_text = files_yanked > 0 - and config.yank_symbol .. " " .. files_yanked - or config.yank_symbol .. " 0" - - return ui.Line({ - ui.Span(" " .. current_separator_style.separator_close_thin .. " ") - :fg(th.which.separator_style:fg()), - ui.Span(config.select_symbol .. " " .. files_selected .. " ") - :fg(selected_fg), - ui.Span(yanked_text .. " ") - :fg(yanked_fg), - }) - end - - function Status:modified() - local hovered = cx.active.current.hovered - - if not hovered then - return "" - end - - local cha = hovered.cha - local time = (cha.mtime or 0) // 1 - - return ui.Span(os.date("%Y-%m-%d %H:%M", time) .. " " .. current_separator_style.separator_open_thin .. " ") - :fg(th.which.separator_style:fg()) - end - - function Status:percent() - local percent = 0 - local cursor = self._tab.current.cursor - local length = #self._tab.current.files - if cursor ~= 0 and length ~= 0 then - percent = math.floor((cursor + 1) * 100 / length) - end - - if percent == 0 then - percent = " Top " - elseif percent == 100 then - percent = " Bot " - else - percent = string.format(" %2d%% ", percent) - end - - local style = self:style() - return ui.Line({ - ui.Span(" " .. current_separator_style.separator_open) - :fg(config.secondary_color or th.which.separator_style:fg()), - ui.Span(percent) - :fg(config.color or style.main:bg()) - :bg(config.secondary_color or th.which.separator_style:fg()), - ui.Span(current_separator_style.separator_open) - :fg(config.color or style.main:bg()) - :bg(config.secondary_color or th.which.separator_style:fg()), - }) - end - - function Status:position() - local cursor = self._tab.current.cursor - local length = #self._tab.current.files - - local style = self:style() - return ui.Line({ - ui.Span(string.format(" %2d/%-2d ", math.min(cursor + 1, length), length)) - :fg(th.which.mask:bg()) - :bg(config.color or style.main:bg()), - ui.Span(current_separator_style.separator_tail):fg(config.color or style.main:bg()), - }) - end - - Status:children_add(Status.files, 4000, Status.LEFT) - Status:children_add(Status.modified, 0, Status.RIGHT) -end - -return { setup = setup } diff --git a/yazi_1/.config/yazi/tags/home/liph/.local/share/Trash/files/tags.json b/yazi_1/.config/yazi/tags/home/liph/.local/share/Trash/files/tags.json deleted file mode 100644 index 63bc2e5..0000000 --- a/yazi_1/.config/yazi/tags/home/liph/.local/share/Trash/files/tags.json +++ /dev/null @@ -1 +0,0 @@ -{"\\x61\\x6E\\x73\\x69\\x62\\x6C\\x65":["\\x31"]} \ No newline at end of file diff --git a/yazi_1/.config/yazi/tags/home/liph/Downloads/tags.json b/yazi_1/.config/yazi/tags/home/liph/Downloads/tags.json deleted file mode 100644 index 1facf9d..0000000 --- a/yazi_1/.config/yazi/tags/home/liph/Downloads/tags.json +++ /dev/null @@ -1 +0,0 @@ -{"\\x62\\x61\\x63\\x6B\\x75\\x70\\x2D\\x4C\\x69\\x70\\x68\\x52\\x6F\\x6F\\x74\\x2D\\x32\\x30\\x32\\x35\\x2D\\x30\\x35\\x2D\\x33\\x31\\x2E\\x74\\x61\\x72\\x2E\\x67\\x7A":["\\x31"]} \ No newline at end of file diff --git a/yazi_1/.config/yazi/tags/home/liph/programming/webdev/html/static/tags.json b/yazi_1/.config/yazi/tags/home/liph/programming/webdev/html/static/tags.json deleted file mode 100644 index c97a87a..0000000 --- a/yazi_1/.config/yazi/tags/home/liph/programming/webdev/html/static/tags.json +++ /dev/null @@ -1 +0,0 @@ -{"\\x73\\x74\\x79\\x6C\\x65\\x73\\x2E\\x63\\x73\\x73":["\\x31"]} \ No newline at end of file diff --git a/yazi_1/.config/yazi/tags/home/liph/scripts/tags.json b/yazi_1/.config/yazi/tags/home/liph/scripts/tags.json deleted file mode 100644 index 354f208..0000000 --- a/yazi_1/.config/yazi/tags/home/liph/scripts/tags.json +++ /dev/null @@ -1 +0,0 @@ -{"\\x61\\x72\\x69\\x61\\x2E\\x73\\x68":["\\x31"]} \ No newline at end of file diff --git a/yazi_1/.config/yazi/tags/home/liph/tags.json b/yazi_1/.config/yazi/tags/home/liph/tags.json deleted file mode 100644 index b2defff..0000000 --- a/yazi_1/.config/yazi/tags/home/liph/tags.json +++ /dev/null @@ -1 +0,0 @@ -{"\\x61\\x6E\\x69\\x6D\\x61\\x6C\\x66\\x6C\\x6F\\x77":["\\x21"]} \ No newline at end of file diff --git a/yazi_1/.config/yazi/yazi.toml b/yazi_1/.config/yazi/yazi.toml deleted file mode 100644 index 4407362..0000000 --- a/yazi_1/.config/yazi/yazi.toml +++ /dev/null @@ -1,144 +0,0 @@ -[mgr] -# it also support --mode=or when using with --input or --keys=!1q or --key=!1q or --tag=!1q or --tags=!1q -ratio = [2, 3, 5] -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_delay = 30 -image_filter = "triangle" -image_quality = 75 - -[opener] -# edit = [ -# { run = '$EDITOR "$@"', block = true, for = "unix" }, -# ] -open = [{ run = 'xdg-open "$1"', desc = "Open", orphan = true }] -edit = [{ run = 'nvim "$@"', block = true, desc = "nvim", for = "unix" }] -reveal = [ - { run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" }, -] -play = [{ run = 'mpv --force-window "$@"', orphan = true, for = "unix" }] -pdf = [{ run = 'zathura "$@"', orphan = true, for = "linux" }] -text = [{ run = 'nvim "$@"', block = true, for = "linux" }] -epub = [{ run = 'epy "$@"', orphan = true, for = "linux" }] - -[open] -rules = [ - # Empty files - { mime = "inode/empty", use = "edit" }, - # { mime = "inode/x-empty", use = "edit" }, - # Text files - use edit (which uses $EDITOR/nvim) - { mime = "text/*", use = "edit" }, # Changed from "text" to "edit" - # { mime = "text/x-tex", use = "edit" }, # Changed from "text" to "edit" - { mime = "application/json", use = "edit" }, - { mime = "application/x-sh", use = "edit" }, - { mime = "application/x-shellscript", use = "edit" }, - { mime = "application/javascript", use = "edit" }, - # Fallback by extension - { url = "*.sh", use = "edit" }, - { url = "*.json", use = "edit" }, - { url = "*.md", use = "edit" }, - { url = "*.txt", use = "edit" }, - { url = "*.css", use = "edit" }, - { url = "*.js", use = "edit" }, - { url = "*.toml", use = "edit" }, - { url = "*.yaml", use = "edit" }, - { url = "*.yml", use = "edit" }, - { url = "*.tex", use = "edit" }, # Uncommented! - { url = "*.text", use = "edit" }, - { url = "*.epub", use = "edit" }, - { url = "*,kdl", use = "edit" }, - # Media files - { mime = "image/*", use = "open" }, - { mime = "video/*", use = "play" }, - { mime = "audio/*", use = "play" }, - { mime = "application/pdf", use = "pdf" }, - # Fallback - { mime = "*", use = "open" }, -] - -[tasks] -micro_workers = 10 -macro_workers = 25 -bizarre_retry = 5 -suppress_preload = false - -[plugin] -prepend_fetchers = [ - { group = "mime", id = "mime", url = "*", run = "mime-ext", prio = "high" }, - # git plugin - { group = "mime", id = "git", url = "*", run = "git" }, - { group = "mime", id = "git", url = "*/", run = "git" }, - # mime plugin - { group = "mime", id = "simple-tag", url = "*", run = "simple-tag" }, - { group = "mime", id = "simple-tag", url = "*/", run = "simple-tag" }, -] -preloaders = [ - # 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" }, - # Font - { mime = "font/*", run = "font" }, - { mime = "application/ms-opentype", run = "font" }, -] -prepend_preloaders = [ - # Replace magick, image, video with mediainfo - { mime = "{audio,video,image}/*", run = "mediainfo" }, - { mime = "application/subrip", run = "mediainfo" }, - # Adobe Illustrator, Adobe Photoshop is image/adobe.photoshop, already handled above - { mime = "application/postscript", run = "mediainfo" }, -] -spotters = [ - # extra-metadata plugin - { url = "*", run = "file-extra-metadata" }, -] -previewers = [ - { url = "*/", run = "folder", sync = true }, - # Code - { url = "text/*", run = "code" }, - { url = "*/{xml,javascript,wine-extension-ini}", run = "code" }, - # JSON - { url = "application/{json,ndjson}", run = "json" }, - # Image - { url = "image/{avif,hei?,jxl,svg+xml}", run = "magick" }, - { url = "image/*", run = "image" }, - # # Video - # { mime = "video/*", run = "video" }, - # PDF - { url = "application/pdf", run = "pdf" }, - # extra-metadata plugin - { url = "*", run = "file-extra-metadata" }, -] -prepend_previewers = [ - # mediainfo MUST come before the catch-all piper rule - { mime = "{audio,video,image}/*", run = "mediainfo" }, - { mime = "application/subrip", run = "mediainfo" }, - { mime = "application/postscript", run = "mediainfo" }, - # ouch plugin for archives - { mime = "application/{*zip,tar,bzip2,7z*,rar,xz,zstd,java-archive}", run = "ouch" }, - # piper for directories - { url = "*/", run = 'piper -- eza -TL=3 --color=always --icons=always --group-directories-first --no-quotes "$1"' }, - # piper markdown (commented out as you had it) - # rich preview plugin - { url = "*.csv", run = "rich-preview" }, # for csv files - { url = "*.md", run = "rich-preview" }, # for markdown (.md) files - { url = "*.rst", run = "rich-preview" }, # for restructured text (.rst) files - { url = "*.ipynb", run = "rich-preview" }, # for jupyter notebooks (.ipynb) - { url = "*.json", run = "rich-preview" }, # for json (.json) files - # { url = "*.lang_type", run = "rich-preview"} # for particular language files eg. .py, .go., .lua, etc. -]