commit 224255e5c74f3a5618ed9a416b6a48e6eeb18882 Author: huyjaky Date: Sat Aug 16 20:04:28 2025 +0700 yazi - init commit diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 0000000..65948ab --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,2 @@ +[formatting] +inline_table_expand = false diff --git a/flavors/catppuccin-mocha.yazi/LICENSE b/flavors/catppuccin-mocha.yazi/LICENSE new file mode 100644 index 0000000..fb5b1d6 --- /dev/null +++ b/flavors/catppuccin-mocha.yazi/LICENSE @@ -0,0 +1,21 @@ +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/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme b/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme new file mode 100644 index 0000000..006383b --- /dev/null +++ b/flavors/catppuccin-mocha.yazi/LICENSE-tmtheme @@ -0,0 +1,21 @@ +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/flavors/catppuccin-mocha.yazi/README.md b/flavors/catppuccin-mocha.yazi/README.md new file mode 100644 index 0000000..0ddacbd --- /dev/null +++ b/flavors/catppuccin-mocha.yazi/README.md @@ -0,0 +1,36 @@ +
+ Yazi logo +
+ +

+ Catppuccin Mocha Flavor for Yazi +

+ +## 👀 Preview + + + +## 🎨 Installation + +```sh +ya pack -a 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/flavors/catppuccin-mocha.yazi/flavor.toml b/flavors/catppuccin-mocha.yazi/flavor.toml new file mode 100644 index 0000000..2a6659d --- /dev/null +++ b/flavors/catppuccin-mocha.yazi/flavor.toml @@ -0,0 +1,170 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +# : Manager {{{ + +[manager] +cwd = { fg = "#94e2d5" } + +# 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" } + +# Tab +tab_active = { reversed = true } +tab_inactive = {} +tab_width = 1 + +# 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" } + +# : }}} + + +# : 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 = "#89b4fa", bg = "#45475a" } +progress_error = { fg = "#f38ba8", bg = "#45475a" } + +# : }}} + + +# : 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", underline = 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" } + +# : }}} + + +# : Notify {{{ + +[notify] +title_info = { fg = "#a6e3a1" } +title_warn = { fg = "#f9e2af" } +title_error = { fg = "#f38ba8" } + +# : }}} + + +# : File-specific styles {{{ + +[filetype] + +rules = [ + # Images + { mime = "image/*", fg = "#94e2d5" }, + + # Media + { mime = "{audio,video}/*", fg = "#f9e2af" }, + + # Archives + { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#f5c2e7" }, + + # Documents + { mime = "application/{pdf,doc,rtf}", fg = "#a6e3a1" }, + + # Fallback + { name = "*", fg = "#cdd6f4" }, + { name = "*/", fg = "#89b4fa" } +] + +# : }}} diff --git a/flavors/catppuccin-mocha.yazi/preview.png b/flavors/catppuccin-mocha.yazi/preview.png new file mode 100644 index 0000000..a684ec8 Binary files /dev/null and b/flavors/catppuccin-mocha.yazi/preview.png differ diff --git a/flavors/catppuccin-mocha.yazi/tmtheme.xml b/flavors/catppuccin-mocha.yazi/tmtheme.xml new file mode 100644 index 0000000..6bd0f29 --- /dev/null +++ b/flavors/catppuccin-mocha.yazi/tmtheme.xml @@ -0,0 +1,2081 @@ + + + + + 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 + #6c7086 + 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 + 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, 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, 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, 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, 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, markup.heading.atx.5.mdx, markup.heading.atx.5.mdx punctuation.definition.heading.mdx, markup.heading.heading-4.asciidoc + settings + + foreground + #89b4fa + + + + scope + heading.6.markdown punctuation.definition.heading.markdown, heading.6.markdown, markup.heading.atx.6.mdx, markup.heading.atx.6.mdx punctuation.definition.heading.mdx, markup.heading.heading-5.asciidoc + settings + + foreground + #cba6f7 + + + + 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, string.other.link.title.markdown, markup.link, punctuation.definition.constant.markdown, constant.other.reference.link.markdown, markup.substitution.attribute-reference + settings + + foreground + #b4befe + + + + name + Markdown code spans + scope + punctuation.definition.raw.markdown, markup.inline.raw.string.markdown, markup.raw.block.markdown + 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, markup.list.bullet + settings + + foreground + #94e2d5 + + + + 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 + #fab387 + + + + name + python constants (True/False) + scope + constant.language.python + settings + + foreground + #cba6f7 + + + + 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 + + + + 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/flavors/tokyo-night.yazi b/flavors/tokyo-night.yazi new file mode 160000 index 0000000..9e6f899 --- /dev/null +++ b/flavors/tokyo-night.yazi @@ -0,0 +1 @@ +Subproject commit 9e6f8997c7419bddbf341c1ad5e4bf0a0aa43824 diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..7e8e7b5 --- /dev/null +++ b/init.lua @@ -0,0 +1,51 @@ +-- function Status:name() +-- local h = cx.active.current.hovered +-- if not h then +-- return ui.Span("") +-- end +-- local linked = "" +-- if h.link_to ~= nil then +-- linked = " -> " .. tostring(h.link_to) +-- end + +-- return ui.Span(" " .. h.name .. linked) +-- end + +-- Status:children_add(function() +-- local h = cx.active.current.hovered +-- if h == nil or ya.target_family() ~= "unix" then +-- return ui.Line({}) +-- end + +-- return ui.Line({ +-- ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("#6495ED"), +-- ui.Span(":"):fg("#87CEFA"), +-- ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("#6495ED"), +-- ui.Span(" "), +-- }) +-- end, 500, Status.RIGHT) + +-- Header:children_add(function() +-- if ya.target_family() ~= "unix" then +-- return ui.Line({}) +-- end +-- return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("#87CEFA") +-- end, 500, Header.LEFT) + +require("full-border"):setup({ + -- Available values: ui.Border.PLAIN, ui.Border.ROUNDED + type = ui.Border.ROUNDED, +}) + +require("eza-preview"):setup({ + -- Determines the directory depth level to tree preview (default: 3) + level = 3, + + -- Whether to follow symlinks when previewing directories (default: false) + follow_symlinks = false, + + -- Whether to show target file info instead of symlink info (default: false) + dereference = false +}) + + diff --git a/keymap.toml b/keymap.toml new file mode 100644 index 0000000..a4c6725 --- /dev/null +++ b/keymap.toml @@ -0,0 +1,18 @@ +# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. +# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. +"$schema" = "https://yazi-rs.github.io/schemas/keymap.json" + +[mgr] +prepend_keymap = [ + { on = ['c', 'm'], run = "plugin chmod", desc = "Chmod on selected files" }, + { on = "", run = "plugin toggle-pane min-preview", desc = "Hide or show preview" }, + { on = "M", run = "plugin toggle-pane max-preview", desc = "Maximize or restore preview" }, + # { on = "f", run = "plugin jump-to-char", desc = "Jump to char" }, + { on = "", run = "plugin wl-clipboard", desc = "Copy wl-clipboard" }, + { on = ['g', 'D'], run = "cd ~/Downloads/", desc = "Go to Downloads" }, + { on = ['g', 'd'], run = "cd ~/Documents/", desc = "Go to Documents" }, + { on = ['g', 'c'], run = "cd ~/.config/", desc = "Go to Config" }, + { on = ['g', 'o'], run = "cd /mnt/SSD-playing\\ games/Workspace/obsidian_aio/", desc = "Go to Obsidian_aio" }, + { on = ['g', 'k'], run = "cd ~/Documents/obsidian_aio/Code model/Knowledge/", desc = "Go to Knowledge note" }, + { on = ['i', 'c'], run = "plugin ouch --args=zip", desc = "Compress with ouch" }, +] diff --git a/keymap.toml-1748921996817036 b/keymap.toml-1748921996817036 new file mode 100644 index 0000000..2f3492e --- /dev/null +++ b/keymap.toml-1748921996817036 @@ -0,0 +1,18 @@ +# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. +# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. +"$schema" = "https://yazi-rs.github.io/schemas/keymap.json" + +[manager] +prepend_keymap = [ + { on = ['c', 'm'], run = "plugin chmod", desc = "Chmod on selected files" }, + { on = "", run = "plugin toggle-pane min-preview", desc = "Hide or show preview" }, + { on = "M", run = "plugin toggle-pane max-preview", desc = "Maximize or restore preview" }, + # { on = "f", run = "plugin jump-to-char", desc = "Jump to char" }, + { on = "", run = "plugin wl-clipboard", desc = "Copy wl-clipboard" }, + { on = ['g', 'D'], run = "cd ~/Downloads/", desc = "Go to Downloads" }, + { on = ['g', 'd'], run = "cd ~/Documents/", desc = "Go to Documents" }, + { on = ['g', 'c'], run = "cd ~/.config/", desc = "Go to Config" }, + { on = ['g', 'o'], run = "cd ~/Documents/obsidian_aio/", desc = "Go to Obsidian_aio" }, + { on = ['g', 'k'], run = "cd ~/Documents/obsidian_aio/Code model/Knowledge/", desc = "Go to Knowledge note" }, + { on = ['i', 'c'], run = "plugin ouch --args=zip", desc = "Compress with ouch" }, +] diff --git a/package.toml b/package.toml new file mode 100644 index 0000000..9d336d6 --- /dev/null +++ b/package.toml @@ -0,0 +1,49 @@ +[[plugin.deps]] +use = "GrzegorzKozub/mdcat" +rev = "d3d5089" +hash = "40c20e6c1085d1f45309b9f148bf4f6e" + +[[plugin.deps]] +use = "Reledia/glow" +rev = "c76bf4f" +hash = "a6b78bf9af5390e3a85a6951fbb7b93" + +[[plugin.deps]] +use = "AnirudhG07/nbpreview" +rev = "f8879b3" +hash = "d378328e5d0a1b9fb9f04ab3aade4575" + +[[plugin.deps]] +use = "AnirudhG07/rich-preview" +rev = "2559e5f" +hash = "c9a3d0731e7d7340e2c6d6126b1f3aa3" + +[[plugin.deps]] +use = "ahkohd/eza-preview" +rev = "6575a9a" +hash = "72355a6c8b7c8de6ed4dda0f98f86fee" + +[[plugin.deps]] +use = "grappas/wl-clipboard" +rev = "c4edc4f" +hash = "51ff959c3c26cb3889589a0f8d394f14" + +[[plugin.deps]] +use = "yazi-rs/plugins:max-preview" +rev = "de9814b" +hash = "a8025f2bb311e869069364fba01abffc" + +[[plugin.deps]] +use = "yazi-rs/plugins:toggle-pane" +rev = "de9814b" +hash = "812fd49667ab6823250f0411f8cf793a" + +[[plugin.deps]] +use = "josephschmitt/auto-layout" +rev = "2149c8f" +hash = "ee6440a6a6cf85baa377dfaa2265b777" + +[[flavor.deps]] +use = "yazi-rs/flavors:catppuccin-mocha" +rev = "c023460" +hash = "2ac87e1b3a61f5887472899e86535d29" diff --git a/plugins/eza-preview.yazi/LICENSE b/plugins/eza-preview.yazi/LICENSE new file mode 100644 index 0000000..14b7911 --- /dev/null +++ b/plugins/eza-preview.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 sharklasers996 + +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/plugins/eza-preview.yazi/README.md b/plugins/eza-preview.yazi/README.md new file mode 100644 index 0000000..0694dbe --- /dev/null +++ b/plugins/eza-preview.yazi/README.md @@ -0,0 +1,63 @@ +# eza-preview.yazi + +[Yazi](https://github.com/sxyazi/yazi) plugin to preview directories using [eza](https://github.com/eza-community/eza), can be switched between list and tree modes. + +List mode: +![list.png](list.png) + +Tree mode: +![tree.png](tree.png) + +## Requirements + +- [yazi (0.4+) or nightly](https://github.com/sxyazi/yazi) +- [eza (0.20+)](https://github.com/eza-community/eza) + +## Installation + +### Linux/MacOS + +```sh +ya pack -a ahkohd/eza-preview +``` + +## Usage + +Add `eza-preview` to previewers in `yazi.toml`: + +```toml +[[plugin.prepend_previewers]] +name = "*/" +run = "eza-preview" +``` + +Set key binding to switch between list and tree modes in `keymap.toml`: + +```toml +[manager] +prepend_keymap = [ + { on = [ "E" ], run = "plugin eza-preview", desc = "Toggle tree/list dir preview" }, + { on = [ "-" ], run = "plugin eza-preview --args='--inc-level'", desc = "Increment tree level" }, + { on = [ "_" ], run = "plugin eza-preview --args='--dec-level'", desc = "Decrement tree level" }, + { on = [ "$" ], run = "plugin eza-preview --args='--toggle-follow-symlinks'", desc = "Toggle tree follow symlinks" }, +] +``` + +List mode is the default, if you want to have tree mode instead when starting yazi - update `init.lua` with: + +```lua +require("eza-preview"):setup({ + -- Determines the directory depth level to tree preview (default: 3) + level = 3, + + -- Whether to follow symlinks when previewing directories (default: false) + follow_symlinks = false + + -- Whether to show target file info instead of symlink info (default: false) + dereference = false +}) + +-- Or use default settings with empty table +require("eza-preview"):setup({}) + +``` diff --git a/plugins/eza-preview.yazi/main.lua b/plugins/eza-preview.yazi/main.lua new file mode 100644 index 0000000..e87963e --- /dev/null +++ b/plugins/eza-preview.yazi/main.lua @@ -0,0 +1,157 @@ +local M = {} + +local function fail(s, ...) + ya.notify({ title = "Eza Preview", content = string.format(s, ...), timeout = 5, level = "error" }) +end + +local toggle_view_mode = ya.sync(function(state, _) + if state.tree == nil then + state.tree = false + end + + state.tree = not state.tree +end) + +local is_tree_view_mode = ya.sync(function(state, _) + return state.tree +end) + +local set_opts = ya.sync(function(state, opts) + if state.opts == nil then + state.opts = { level = 3, follow_symlinks = false, dereference = false } + end + + for key, value in pairs(opts or {}) do + state.opts[key] = value + end +end) + +local get_opts = ya.sync(function(state) + return state.opts +end) + +local inc_level = ya.sync(function(state) + state.opts.level = state.opts.level + 1 +end) + +local dec_level = ya.sync(function(state) + if state.opts.level > 1 then + state.opts.level = state.opts.level - 1 + end +end) + +local toggle_follow_symlinks = ya.sync(function(state) + state.opts.follow_symlinks = not state.opts.follow_symlinks +end) + +function M:setup(opts) + set_opts(opts) + + toggle_view_mode() +end + +function M:entry(job) + local arg = job.arg + + if arg["inc_level"] ~= nil then + inc_level() + elseif arg["dec_level"] ~= nil then + dec_level() + elseif arg["toggle_follow_symlinks"] ~= nil then + toggle_follow_symlinks() + else + set_opts() + toggle_view_mode() + end + + ya.manager_emit("seek", { 0 }) +end + +function M:peek(job) + local opts = get_opts() + + local arg = { + "--all", + "--color=always", + "--icons=always", + "--group-directories-first", + "--no-quotes", + tostring(job.file.url), + } + + if is_tree_view_mode() then + table.insert(arg, "--tree") + table.insert(arg, string.format("--level=%d", opts.level)) + end + + if opts then + if opts.follow_symlinks then + table.insert(arg, "--follow-symlinks") + end + + if opts.dereference then + table.insert(arg, "--dereference") + end + end + + local child = Command("eza"):arg(arg):stdout(Command.PIPED):stderr(Command.PIPED):spawn() + + local limit = job.area.h + local lines = "" + local num_lines = 1 + local num_skip = 0 + local empty_output = false + + repeat + local line, event = child:read_line() + if event == 1 then + fail(tostring(event)) + elseif event ~= 0 then + break + end + + if num_skip >= job.skip then + lines = lines .. line + num_lines = num_lines + 1 + else + num_skip = num_skip + 1 + end + until num_lines >= limit + + if num_lines == 1 and not is_tree_view_mode() then + empty_output = true + elseif num_lines == 2 and is_tree_view_mode() then + empty_output = true + end + + child:start_kill() + if job.skip > 0 and num_lines < limit then + ya.manager_emit("peek", { + tostring(math.max(0, job.skip - (limit - num_lines))), + only_if = tostring(job.file.url), + upper_bound = "", + }) + elseif empty_output then + ya.preview_widgets(job, { + ui.Text({ ui.Line("No items") }):area(job.area):align(ui.Text.CENTER), + }) + else + ya.preview_widgets(job, { ui.Text.parse(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.manager_emit("peek", { + math.max(0, cx.active.preview.skip + step), + only_if = tostring(job.file.url), + force = true, + }) + end +end + +return M diff --git a/plugins/full-border.yazi/main.lua b/plugins/full-border.yazi/main.lua new file mode 100644 index 0000000..9051236 --- /dev/null +++ b/plugins/full-border.yazi/main.lua @@ -0,0 +1,49 @@ +--- @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 then + return ui.Bar(ui.Bar.TOP) + end + + return ui.Bar(ui.Bar.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.Border.ALL):area(self._area):type(type):style(style), + ui.Bar(ui.Bar.RIGHT):area(self._chunks[1]):style(style), + ui.Bar(ui.Bar.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/plugins/ouch.yazi b/plugins/ouch.yazi new file mode 160000 index 0000000..ce6fb75 --- /dev/null +++ b/plugins/ouch.yazi @@ -0,0 +1 @@ +Subproject commit ce6fb75431b9d0d88efc6ae92e8a8ebb9bc1864a diff --git a/plugins/rich-preview.yazi b/plugins/rich-preview.yazi new file mode 160000 index 0000000..843c3fa --- /dev/null +++ b/plugins/rich-preview.yazi @@ -0,0 +1 @@ +Subproject commit 843c3faf0a99f5ce31d02372c868d8dae92ca29d diff --git a/plugins/toggle-pane.yazi/LICENSE b/plugins/toggle-pane.yazi/LICENSE new file mode 100644 index 0000000..fb5b1d6 --- /dev/null +++ b/plugins/toggle-pane.yazi/LICENSE @@ -0,0 +1,21 @@ +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/plugins/toggle-pane.yazi/README.md b/plugins/toggle-pane.yazi/README.md new file mode 100644 index 0000000..d00c169 --- /dev/null +++ b/plugins/toggle-pane.yazi/README.md @@ -0,0 +1,78 @@ +# 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#manager.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 pack -a yazi-rs/plugins:toggle-pane +``` + +## Usage + +Hide/Show preview: + +```toml +# keymap.toml +[[manager.prepend_keymap]] +on = "T" +run = "plugin toggle-pane min-preview" +desc = "Show or hide the preview pane" +``` + +Maximize/Restore preview: + +```toml +# keymap.toml +[[manager.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. + +## 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/plugins/toggle-pane.yazi/main.lua b/plugins/toggle-pane.yazi/main.lua new file mode 100644 index 0000000..cf40a30 --- /dev/null +++ b/plugins/toggle-pane.yazi/main.lua @@ -0,0 +1,46 @@ +--- @since 25.2.26 +--- @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 and st.parent or R.parent + st.current = st.current and st.current or R.current + st.preview = st.preview and 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.app_emit("resize", {}) +end + +return { entry = entry } diff --git a/plugins/wl-clipboard.yazi/LICENSE b/plugins/wl-clipboard.yazi/LICENSE new file mode 100644 index 0000000..ef43362 --- /dev/null +++ b/plugins/wl-clipboard.yazi/LICENSE @@ -0,0 +1,7 @@ +Copyright 2024 grappas + +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/plugins/wl-clipboard.yazi/README.md b/plugins/wl-clipboard.yazi/README.md new file mode 100644 index 0000000..b1d09f1 --- /dev/null +++ b/plugins/wl-clipboard.yazi/README.md @@ -0,0 +1,34 @@ +# wl-clipboard.yazi + +Forked from: [orhnk/system-clipboard.yazi](https://github.com/orhnk/system-clipboard.yazi) to work with wayland compositors. + +## Demo + + + +## Config + +> [!NOTE] +> You need yazi 3.x for this plugin to work. + +> [!Important] +> This plugin utilizes ["wl-clipboard" project](https://github.com/bugaevc/wl-clipboard). +> You need to have it installed on your system. (Make sure that It's on your $PATH) + +## Installation + +```bash +ya pack -a grappas/wl-clipboard +``` + +## Configuration + +Copy or install this plugin and add the following keymap to your `manager.prepend_keymap`: + +```toml +on = "" +run = ["plugin wl-clipboard"] +``` + +> [!Tip] +> If you want to use this plugin with yazi's default yanking behaviour you should use `cx.yanked` instead of `tab.selected` in `init.lua` (See [#1487](https://github.com/sxyazi/yazi/issues/1487)) diff --git a/plugins/wl-clipboard.yazi/main.lua b/plugins/wl-clipboard.yazi/main.lua new file mode 100644 index 0000000..1c737b2 --- /dev/null +++ b/plugins/wl-clipboard.yazi/main.lua @@ -0,0 +1,60 @@ +-- Meant to run at async context. (yazi system-clipboard) + +local selected_or_hovered = 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) + +return { + entry = function() + ya.manager_emit("escape", { visual = true }) + + local urls = selected_or_hovered() + + if #urls == 0 then + return ya.notify({ title = "System Clipboard", content = "No file selected", level = "warn", timeout = 5 }) + end + + -- ya.notify({ title = #urls, content = table.concat(urls, " "), level = "info", timeout = 5 }) + + -- Format the URLs for `text/uri-list` specification + local function encode_uri(uri) + return uri:gsub("([^%w%-%._~:/])", function(c) + return string.format("%%%02X", string.byte(c)) + end) + end + + local file_list_formatted = "" + for _, path in ipairs(urls) do + -- Each file path must be URI-encoded and prefixed with "file://" + file_list_formatted = file_list_formatted .. "file://" .. encode_uri(path) .. "\r\n" + end + + local status, err = + Command("wl-copy"):arg("--type"):arg("text/uri-list"):arg(file_list_formatted):spawn():wait() + + if status or status.succes then + ya.notify({ + title = "System Clipboard", + content = "Succesfully copied the file(s) to system clipboard", + level = "info", + timeout = 5, + }) + end + + if not status or not status.success then + ya.notify({ + title = "System Clipboard", + content = string.format("Could not copy selected file(s) %s", status and status.code or err), + level = "error", + timeout = 5, + }) + end + end, +} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..80dad85 --- /dev/null +++ b/theme.toml @@ -0,0 +1,3 @@ +[flavor] +dark = "catppuccin-mocha" + diff --git a/yazi.toml b/yazi.toml new file mode 100644 index 0000000..269d370 --- /dev/null +++ b/yazi.toml @@ -0,0 +1,158 @@ +# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. +# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. +"$schema" = "https://yazi-rs.github.io/schemas/yazi.json" + +[mgr] +ratio = [2, 4, 4] +sort_by = "natural" +sort_sensitive = false +sort_reverse = false +sort_dir_first = true +sort_translit = false +linemode = "size" +show_hidden = true +show_symlink = true +scrolloff = 5 +mouse_events = ["click", "scroll"] +title_format = "Yazi: {cwd}" + +[preview] +tab_size = 4 +max_width = 600 +max_height = 900 +cache_dir = "" +# image_delay = 30 +image_filter = "triangle" +image_quality = 75 +sixel_fraction = 15 +ueberzug_scale = 1 +ueberzug_offset = [0, 0, 0, 0] + +[opener] +edit = [ + { run = '${EDITOR:-vi} "$@"', desc = "$EDITOR", block = true, for = "unix" }, + { run = 'code %*', orphan = true, desc = "code", for = "windows" }, + { run = 'code -w %*', block = true, desc = "code (block)", for = "windows" }, +] +open = [ + { run = 'xdg-open "$1"', desc = "Open", for = "linux" }, + { run = 'open "$@"', desc = "Open", for = "macos" }, + { run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" }, +] +reveal = [ + { run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" }, + { run = 'open -R "$1"', desc = "Reveal", for = "macos" }, + { run = 'explorer /select,"%1"', orphan = true, desc = "Reveal", for = "windows" }, + { run = '''exiftool "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" }, +] +extract = [ + { run = 'ouch d -y "%*"', desc = "Extract here with ouch", for = "windows" }, + { run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" }, +] +play = [ + { run = 'mpv --force-window "$@"', orphan = true, for = "unix" }, + { run = 'mpv --force-window %*', orphan = true, for = "windows" }, + { run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" }, +] + +[open] +rules = [ + # Folder + { name = "*/", use = ["edit", "open", "reveal"] }, + # Text + { mime = "text/*", use = ["edit", "reveal"] }, + # Image + { mime = "image/*", use = ["open", "reveal"] }, + # Media + { mime = "{audio,video}/*", use = ["play", "reveal"] }, + # Archive + { mime = "application/{,g}zip", use = ["extract", "reveal"] }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = ["extract", "reveal"] }, + # JSON + { mime = "application/{json,x-ndjson,jsonl}", use = ["edit", "reveal"] }, + { mime = "*/javascript", use = ["edit", "reveal"] }, + # Empty file + { mime = "inode/x-empty", use = ["edit", "reveal"] }, + # Fallback + { name = "*", use = ["open", "reveal"] }, +] + +[tasks] +micro_workers = 10 +macro_workers = 25 +bizarre_retry = 5 +image_alloc = 536870912 # 512MB +image_bound = [0, 0] +suppress_preload = false + +[plugin] +fetchers = [ + # Mimetype + { id = "mime", name = "*", run = "mime", if = "!mime", prio = "high" }, +] +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/vnd.ms-opentype", run = "font" }, +] +previewers = [ + { name = "*/", run = "folder", sync = true }, + # Code + { mime = "text/*", run = "code" }, + { mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code" }, + # JSON + { mime = "application/{json,x-ndjson}", run = "json" }, + # 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" }, + # Archive + { mime = "application/{,g}zip", run = "archive" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar,iso9660-image}", run = "archive" }, + # Font + { mime = "font/*", run = "font" }, + { mime = "application/vnd.ms-opentype", run = "font" }, + # Empty file + { mime = "inode/x-empty", run = "empty" }, + # Fallback + { name = "*", run = "file" }, +] +prepend_previewers = [ + { mime = "application/*zip", run = "ouch" }, + { mime = "application/x-tar", run = "ouch" }, + { mime = "application/x-bzip2", run = "ouch" }, + { mime = "application/x-7z-compressed", run = "ouch" }, + { mime = "application/x-rar", run = "ouch" }, + { mime = "application/x-xz", run = "ouch" }, + { name = "*.csv", run = "rich-preview"}, # for csv files + { name = "*.md", run = "rich-preview" }, # for markdown (.md) files + { name = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files + { name = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb) + { name = "*.json", run = "rich-preview"}, # for json (.json) files + { name = "*.jsonl", run = "rich-preview"}, # for json (.json) files + { name = "*/", run = "eza-preview"} +] + +[select] +open_title = "Open with:" +open_origin = "hovered" +open_offset = [0, 1, 50, 7] + +[which] +sort_by = "none" +sort_sensitive = false +sort_reverse = false +sort_translit = false + +[log] +enabled = false diff --git a/yazi.toml-1748921996815259 b/yazi.toml-1748921996815259 new file mode 100644 index 0000000..3edaa96 --- /dev/null +++ b/yazi.toml-1748921996815259 @@ -0,0 +1,158 @@ +# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config. +# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas. +"$schema" = "https://yazi-rs.github.io/schemas/yazi.json" + +[manager] +ratio = [2, 4, 4] +sort_by = "natural" +sort_sensitive = false +sort_reverse = false +sort_dir_first = true +sort_translit = false +linemode = "size" +show_hidden = true +show_symlink = true +scrolloff = 5 +mouse_events = ["click", "scroll"] +title_format = "Yazi: {cwd}" + +[preview] +tab_size = 4 +max_width = 600 +max_height = 900 +cache_dir = "" +# image_delay = 30 +image_filter = "triangle" +image_quality = 75 +sixel_fraction = 15 +ueberzug_scale = 1 +ueberzug_offset = [0, 0, 0, 0] + +[opener] +edit = [ + { run = '${EDITOR:-vi} "$@"', desc = "$EDITOR", block = true, for = "unix" }, + { run = 'code %*', orphan = true, desc = "code", for = "windows" }, + { run = 'code -w %*', block = true, desc = "code (block)", for = "windows" }, +] +open = [ + { run = 'xdg-open "$1"', desc = "Open", for = "linux" }, + { run = 'open "$@"', desc = "Open", for = "macos" }, + { run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" }, +] +reveal = [ + { run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" }, + { run = 'open -R "$1"', desc = "Reveal", for = "macos" }, + { run = 'explorer /select,"%1"', orphan = true, desc = "Reveal", for = "windows" }, + { run = '''exiftool "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" }, +] +extract = [ + { run = 'ouch d -y "%*"', desc = "Extract here with ouch", for = "windows" }, + { run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" }, +] +play = [ + { run = 'mpv --force-window "$@"', orphan = true, for = "unix" }, + { run = 'mpv --force-window %*', orphan = true, for = "windows" }, + { run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" }, +] + +[open] +rules = [ + # Folder + { name = "*/", use = ["edit", "open", "reveal"] }, + # Text + { mime = "text/*", use = ["edit", "reveal"] }, + # Image + { mime = "image/*", use = ["open", "reveal"] }, + # Media + { mime = "{audio,video}/*", use = ["play", "reveal"] }, + # Archive + { mime = "application/{,g}zip", use = ["extract", "reveal"] }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = ["extract", "reveal"] }, + # JSON + { mime = "application/{json,x-ndjson,jsonl}", use = ["edit", "reveal"] }, + { mime = "*/javascript", use = ["edit", "reveal"] }, + # Empty file + { mime = "inode/x-empty", use = ["edit", "reveal"] }, + # Fallback + { name = "*", use = ["open", "reveal"] }, +] + +[tasks] +micro_workers = 10 +macro_workers = 25 +bizarre_retry = 5 +image_alloc = 536870912 # 512MB +image_bound = [0, 0] +suppress_preload = false + +[plugin] +fetchers = [ + # Mimetype + { id = "mime", name = "*", run = "mime", if = "!mime", prio = "high" }, +] +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/vnd.ms-opentype", run = "font" }, +] +previewers = [ + { name = "*/", run = "folder", sync = true }, + # Code + { mime = "text/*", run = "code" }, + { mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code" }, + # JSON + { mime = "application/{json,x-ndjson}", run = "json" }, + # 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" }, + # Archive + { mime = "application/{,g}zip", run = "archive" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar,iso9660-image}", run = "archive" }, + # Font + { mime = "font/*", run = "font" }, + { mime = "application/vnd.ms-opentype", run = "font" }, + # Empty file + { mime = "inode/x-empty", run = "empty" }, + # Fallback + { name = "*", run = "file" }, +] +prepend_previewers = [ + { mime = "application/*zip", run = "ouch" }, + { mime = "application/x-tar", run = "ouch" }, + { mime = "application/x-bzip2", run = "ouch" }, + { mime = "application/x-7z-compressed", run = "ouch" }, + { mime = "application/x-rar", run = "ouch" }, + { mime = "application/x-xz", run = "ouch" }, + { name = "*.csv", run = "rich-preview"}, # for csv files + { name = "*.md", run = "rich-preview" }, # for markdown (.md) files + { name = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files + { name = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb) + { name = "*.json", run = "rich-preview"}, # for json (.json) files + { name = "*.jsonl", run = "rich-preview"}, # for json (.json) files + { name = "*/", run = "eza-preview"} +] + +[select] +open_title = "Open with:" +open_origin = "hovered" +open_offset = [0, 1, 50, 7] + +[which] +sort_by = "none" +sort_sensitive = false +sort_reverse = false +sort_translit = false + +[log] +enabled = false