From ea82cbb1c0b778dd946c717cceace53fab391ba8 Mon Sep 17 00:00:00 2001 From: Tom Li Dobnik Date: Sat, 9 Aug 2025 17:12:43 +0200 Subject: init --- .../DO_NOT_MODIFY_ANYTHING_IN_THIS_DIRECTORY | 0 .config/yazi/flavors/nord.yazi/flavor.toml | 152 ++ .config/yazi/flavors/nord.yazi/tmtheme.xml | 1873 ++++++++++++++++++++ .config/yazi/keymap.toml | 9 + .config/yazi/keymap.toml-1748684127440481 | 9 + .config/yazi/package.toml | 12 + .config/yazi/plugins/compress.yazi/LICENSE | 21 + .config/yazi/plugins/compress.yazi/README.md | 48 + .config/yazi/plugins/compress.yazi/main.lua | 228 +++ .config/yazi/plugins/smart-enter.yazi/LICENSE | 21 + .config/yazi/plugins/smart-enter.yazi/README.md | 40 + .config/yazi/plugins/smart-enter.yazi/main.lua | 10 + .config/yazi/theme.toml | 2 + .config/yazi/yazi.toml | 2 + 14 files changed, 2427 insertions(+) create mode 100644 .config/yazi/flavors/nord.yazi/DO_NOT_MODIFY_ANYTHING_IN_THIS_DIRECTORY create mode 100644 .config/yazi/flavors/nord.yazi/flavor.toml create mode 100644 .config/yazi/flavors/nord.yazi/tmtheme.xml create mode 100644 .config/yazi/keymap.toml create mode 100644 .config/yazi/keymap.toml-1748684127440481 create mode 100644 .config/yazi/package.toml create mode 100644 .config/yazi/plugins/compress.yazi/LICENSE create mode 100644 .config/yazi/plugins/compress.yazi/README.md create mode 100644 .config/yazi/plugins/compress.yazi/main.lua create mode 100644 .config/yazi/plugins/smart-enter.yazi/LICENSE create mode 100644 .config/yazi/plugins/smart-enter.yazi/README.md create mode 100644 .config/yazi/plugins/smart-enter.yazi/main.lua create mode 100644 .config/yazi/theme.toml create mode 100644 .config/yazi/yazi.toml (limited to '.config/yazi') diff --git a/.config/yazi/flavors/nord.yazi/DO_NOT_MODIFY_ANYTHING_IN_THIS_DIRECTORY b/.config/yazi/flavors/nord.yazi/DO_NOT_MODIFY_ANYTHING_IN_THIS_DIRECTORY new file mode 100644 index 0000000..e69de29 diff --git a/.config/yazi/flavors/nord.yazi/flavor.toml b/.config/yazi/flavors/nord.yazi/flavor.toml new file mode 100644 index 0000000..766613c --- /dev/null +++ b/.config/yazi/flavors/nord.yazi/flavor.toml @@ -0,0 +1,152 @@ +# vim:fileencoding=utf-8:foldmethod=marker + +# : Manager {{{ +[manager] +cwd = { fg = "#88c0d0" } + +# Hovered +hovered = { reversed = true } +preview_hovered = { underline = true } + +# Find +find_keyword = { fg = "#ebcb8b", bold = true, italic = true, underline = true } +find_position = { fg = "#b48ead", bg = "reset", bold = true, italic = true } + +# Marker +marker_copied = { fg = "#a3be8c", bg = "#a3be8c" } +marker_cut = { fg = "#bf616a", bg = "#bf616a" } +marker_marked = { fg = "#88c0d0", bg = "#88c0d0" } +marker_selected = { fg = "#ebcb8b", bg = "#ebcb8b" } + +# Tab +tab_active = { reversed = true } +tab_inactive = {} +tab_width = 1 + +# Count +count_copied = { fg = "#2e3440", bg = "#a3be8c" } +count_cut = { fg = "#2e3440", bg = "#bf616a" } +count_selected = { fg = "#2e3440", bg = "#ebcb8b" } + +# Border +border_symbol = "│" +border_style = { fg = "#3b4252" } + +# : }}} + +# : Status {{{ + +[status] +separator_open = "" +separator_close = "" +separator_style = { fg = "#434c5e", bg = "#434c5e" } + +# Mode +mode_normal = { fg = "#2e3440", bg = "#5e81ac", bold = true } +mode_select = { fg = "#2e3440", bg = "#a3be8c", bold = true } +mode_unset = { fg = "#2e3440", bg = "#f2cdcd", bold = true } + +# Progress +progress_label = { fg = "#eceff4", bold = true } +progress_normal = { fg = "#5e81ac", bg = "#434c5e" } +progress_error = { fg = "#bf616a", bg = "#434c5e" } + +# Permissions +permissions_t = { fg = "#5e81ac" } +permissions_r = { fg = "#ebcb8b" } +permissions_w = { fg = "#bf616a" } +permissions_x = { fg = "#a3be8c" } +permissions_s = { fg = "#7f849c" } + +# : }}} + +# : Select {{{ + +[select] +border = { fg = "#5e81ac" } +active = { fg = "#b48ead", bold = true } +inactive = {} + +# : }}} + +# : Input {{{ + +[input] +border = { fg = "#5e81ac" } +title = {} +value = {} +selected = { reversed = true } + +# : }}} + +# : Completion {{{ + +[completion] +border = { fg = "#5e81ac" } + +# : }}} + +# : Tasks {{{ + +[tasks] +border = { fg = "#5e81ac" } +title = {} +hovered = { fg = "#b48ead", underline = true } + +# : }}} + +# : Which {{{ + +[which] +mask = { bg = "#2e3440" } +cand = { fg = "#88c0d0" } +rest = { fg = "#4c566a" } +desc = { fg = "#b48ead" } +separator = "  " +separator_style = { fg = "#585b70" } + +# : }}} + +# : Help {{{ + +[help] +on = { fg = "#88c0d0" } +run = { fg = "#b48ead" } +hovered = { reversed = true, bold = true } +footer = { fg = "#45475a", bg = "#cdd6f4" } + +# : }}} + +# : Notify {{{ + +[notify] +title_info = { fg = "#a3be8c" } +title_warn = { fg = "#ebcb8b" } +title_error = { fg = "#bf616a" } + +# : }}} + +# : File-specific styles {{{ + +[filetype] + +rules = [ + # Images + { mime = "image/*", fg = "#88c0d0" }, + + # Media + { mime = "{audio,video}/*", fg = "#ebcb8b" }, + + # Archives + { mime = "application/*zip", fg = "#b48ead" }, + { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#b48ead" }, + + # Documents + { mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#a3be8c" }, + + # Fallback + { name = "*", fg = "#e5e9f0" }, + { name = "*/", fg = "#5e81ac" }, +] + +# : }}} diff --git a/.config/yazi/flavors/nord.yazi/tmtheme.xml b/.config/yazi/flavors/nord.yazi/tmtheme.xml new file mode 100644 index 0000000..c8778de --- /dev/null +++ b/.config/yazi/flavors/nord.yazi/tmtheme.xml @@ -0,0 +1,1873 @@ + + + + + + + name + Nord + comment + A arctic, north-bluish clean and elegant Visual Studio Code theme. + author + Arctic Ice Studio + semanticClass + nord + colorSpaceName + sRGB + settings + + + + settings + + background + #2e3440 + foreground + #d8dee9 + caret + #d8dee9 + invisibles + #4c566a + lineHighlight + #434c5e52 + + misspelling + #bf616a + minimapBorder + #434c5e52 + accent + #88C0D0 + + gutter + #2e3440 + gutterForeground + #d8dee966 + + selection + #434c5ecc + selectionBorder + #434c5ecc + inactiveSelection + #434c5e99 + + highlight + #88c0d0 + findHighlight + #88c0d0 + findHighlightForeground + #2e3440 + + guide + #434c5eb3 + activeGuide + #88c0d0cc + stackGuide + #88c0d066 + + bracketsOptions + underline + bracketsForeground + #88c0d0 + bracketsContentsOptions + underline + bracketsContentsForeground + #88c0d0 + + tagsOptions + underline + tagsForeground + #88c0d0 + + shadow + #2e3440 + shadowWidth + 8 + + + + + name + [Comment] Comment + scope + + comment, + punctuation.definition.comment + + settings + + foreground + #616e88 + + + + + name + [Constants] Numeric + scope + constant.numeric + settings + + foreground + #b48ead + + + + name + [Constants] BuiltIn + scope + constant.language + settings + + foreground + #81a1c1 + + + + name + [Constants] Escape + scope + constant.character.escape + settings + + foreground + #ebcb8b + + + + name + [Constants] Placeholder + scope + constant.other.placeholder + settings + + foreground + #ebcb8b + + + + name + [Constants] Other + scope + constant.other + settings + + foreground + #d8dee9 + + + + + name + [Entity] Class + scope + entity.name.class + settings + + foreground + #8fbcbb + + + + name + [Entity] Struct + scope + entity.name.struct + settings + + foreground + #8fbcbb + + + + name + [Entity] Enum + scope + entity.name.enum + settings + + foreground + #8fbcbb + + + + name + [Entity] Unions + scope + entity.name.union + settings + + foreground + #8fbcbb + + + + name + [Entity] Traits + scope + entity.name.trait + settings + + foreground + #8fbcbb + + + + name + [Entity] Interface + scope + entity.name.interface + settings + + foreground + #8fbcbb + fontStyle + bold + + + + name + [Entity] Type + scope + entity.name.type + settings + + foreground + #81a1c1 + + + + name + [Entity] Inherited Class/Interface/Trait + scope + entity.other.inherited-class + settings + + foreground + #8fbcbb + + + + name + [Entity] Function + scope + entity.name.function + settings + + foreground + #88c0d0 + + + + name + [Entity] Constructor + scope + entity.name.function.constructor + settings + + foreground + #88c0d0 + + + + name + [Entity] Destructor + scope + entity.name.function.destructor + settings + + foreground + #88c0d0 + + + + name + [Entity] Namespace + scope + entity.name.namespace + settings + + foreground + #8fbcbb + + + + name + [Entity] Constant + scope + entity.name.constant + settings + + foreground + #81a1c1 + + + + name + [Entity] Label/Goto + scope + entity.name.label + settings + + foreground + #5e81ac + + + + name + [Entity] Section + scope + entity.name.section + settings + + foreground + #88c0d0 + + + + name + [Entity] Tag + scope + entity.name.tag + settings + + foreground + #81a1c1 + + + + name + [Entity] Attribute Name + scope + entity.other.attribute-name + settings + + foreground + #8fbcbb + + + + + name + [Invalid] Illegal + scope + invalid.illegal + settings + + background + #bf616a + foreground + #d8dee9 + + + + name + [Invalid] Deprecated + scope + invalid.deprecated + settings + + background + #ebcb8b + foreground + #d8dee9 + + + + + name + [Keyword] Control + scope + keyword.control + settings + + foreground + #81a1c1 + + + + name + [Keyword] Control Conditional + scope + keyword.control.conditional + settings + + foreground + #81a1c1 + + + + name + [Keyword] Control Import + scope + keyword.control.import + settings + + foreground + #81a1c1 + + + + name + [Keyword] Punctuation Definition + scope + punctuation.definition.keyword + settings + + foreground + #81a1c1 + + + + name + [Keyword] Other + scope + keyword.other + settings + + foreground + #81a1c1 + + + + name + [Keyword] Operator + scope + + keyword.operator, + keyword.operator.assignment, + keyword.operator.arithmetic, + keyword.operator.bitwise, + keyword.operator.logical, + keyword.operator.word + + settings + + foreground + #81a1c1 + + + + + name + [Markup] Heading + scope + markup.heading + settings + + foreground + #88c0d0 + + + + name + [Markup] List + scope + + markup.list.unnumbered, + markup.list.numbered + + settings + + foreground + #d8dee9 + + + + name + [Markup] Bold + scope + markup.bold + settings + + fontStyle + bold + + + + name + [Markup] Italic + scope + markup.italic + settings + + fontStyle + italic + + + + name + [Markup] Inserted + scope + markup.inserted + settings + + foreground + #a3be8c + + + + name + [Markup] Deleted + scope + markup.deleted + settings + + foreground + #bf616a + + + + name + [Markup] Changed + scope + markup.changed + settings + + foreground + #ebcb8b + + + + name + [Markup] Quote + scope + markup.quote + settings + + foreground + #616e88 + + + + name + [Markup] Raw + scope + + markup.raw.inline, + markup.raw.block + + settings + + foreground + #8fbcbb + + + + name + [Markup] Other + scope + markup.other + settings + + background + #eceff4 + + + + + name + [Punctuation] Separator/Terminator + scope + + punctuation.separator, + punctuation.terminator + + settings + + foreground + #eceff4 + + + + name + [Punctuation] Separator Continuation/Accessor + scope + + punctuation.separator.continuation, + punctuation.accessor + + settings + + foreground + #81a1c1 + + + + name + [Punctuation] Definition Tag + scope + punctuation.definition.tag + settings + + foreground + #81a1c1 + + + + + name + [Storage] Type + scope + + storage.type, + storage.modifier + + settings + + foreground + #81a1c1 + + + + + name + [String] Quoted/Unquoted + scope + + string.quoted.single, + string.quoted.double, + string.quoted.triple, + string.quoted.other, + string.unquoted + + settings + + foreground + #a3be8c + + + + name + [String] Punctuation Definition + scope + + punctuation.definition.string.begin, + punctuation.definition.string.end + + settings + + foreground + #a3be8c + + + + name + [String] RegExp + scope + string.regexp + settings + + foreground + #ebcb8b + + + + + name + [Support] Constant + scope + support.constant + settings + + foreground + #8fbcbb + + + + name + [Support] Function + scope + support.function + settings + + foreground + #88c0d0 + + + + name + [Support] Module + scope + support.module + settings + + foreground + #8fbcbb + + + + name + [Support] Type + scope + support.type + settings + + foreground + #8fbcbb + + + + name + [Support] Class + scope + support.class + settings + + foreground + #8fbcbb + + + + + name + [Text] HTML/XML + scope + + text.html.basic, + text.xml + + settings + + foreground + #eceff4 + + + + + name + [Variable] Other/ReadWrite + scope + + variable.other, + variable.other.readwrite + + settings + + foreground + #d8dee9 + + + + name + [Variable] Punctuation Definition + scope + punctuation.definition.variable + settings + + foreground + #81a1c1 + + + + name + [Variable] Constant + scope + variable.other.constant + settings + + foreground + #81a1c1 + + + + name + [Variable] Language + scope + variable.language + settings + + foreground + #81a1c1 + + + + name + [Variable] Parameter + scope + variable.parameter + settings + + foreground + #d8dee9 + + + + name + [Variable] Other Member + scope + variable.other.member + settings + + foreground + #d8dee9 + + + + name + [Variable] Function + scope + variable.function + settings + + foreground + #88c0d0 + + + + + + name + [Find Results] Gutter Number + scope + constant.numeric.line-number.find-in-files + settings + + foreground + #d8dee966 + + + + name + [Find Results] Gutter Number Match + scope + constant.numeric.line-number.match.find-in-files + settings + + foreground + #88c0d0 + + + + name + [Find Results] Filename + scope + entity.name.filename.find-in-files + settings + + foreground + #8fbcbb + + + + name + [Find Results] Text + scope + text.find-in-files + settings + + foreground + #d8dee9 + + + + + + name + [C/C++] Preprocessor/Include + scope + + source.c keyword.control.import.include.c, + source.c meta.preprocessor.c keyword.control.import.c, + source.c++ keyword.control.import.include.c++, + source.c++ meta.preprocessor.c++ keyword.control.import.c++ + + settings + + foreground + #5e81ac + + + + name + [C/C++] BuiltIn Function + scope + + source.c keyword.operator.word.c, + source.c++ keyword.operator.word.c++ + + settings + + foreground + #88c0d0 + fontStyle + italic + + + + + name + [CSS/Sass] Property Name + scope + + source.css support.type.property-name.css, + source.sass support.type.property-name.sass, + source.css support.type.vendor-prefix.css + + settings + + foreground + #d8dee9 + + + + name + [CSS/Sass] RGB Value + scope + + source.css constant.other.color.rgb-value.css, + source.sass constant.other.rgb-value.sass + + settings + + foreground + #b48ead + + + + name + [CSS] Property Value + scope + + source.css support.constant.color.w3c-special-color-keyword.css, + source.css support.constant.property-value.css, + source.sass support.constant.property-value.sass + + settings + + foreground + #81a1c1 + + + + name + [CSS] Pseudo Class + scope + source.css entity.other.pseudo-class.css + settings + + foreground + #8fbcbb + + + + name + [CSS/Sass] At-Rule + scope + + source.css keyword.control.at-rule.media.css, + source.css punctuation.definition.keyword.css, + source.sass keyword.control.at-rule.sass + + settings + + foreground + #d08770 + + + + name + [CSS] Color Names + scope + source.css support.constant.color.w3c-standard-color-name.css + settings + + foreground + #81a1c1 + fontStyle + italic + + + + name + [CSS/Sass] ID + scope + + source.css entity.other.attribute-name.id.css, + source.sass entity.other.attribute-name.id.sass + + settings + + fontStyle + bold + + + + + name + [diff] Meta Range Context + scope + source.diff meta.diff.range.context + settings + + foreground + #8fbcbb + + + + name + [diff] Meta Header From-File + scope + source.diff meta.diff.header.from-file + settings + + foreground + #8fbcbb + + + + name + [diff] Punctuation Definition From-File + scope + source.diff punctuation.definition.from-file + settings + + foreground + #8FBCBB + + + + name + [diff] Punctuation Definition Separator + scope + source.diff punctuation.definition.separator + settings + + foreground + #81a1c1 + + + + + name + [Go] BuiltIn Function + scope + source.go support.function.builtin.go + settings + + fontStyle + italic + + + + + name + [HTML] Entity + scope + text.html.basic constant.character.entity.html + settings + + foreground + #ebcb8b + + + + + name + [Java] Annotation + scope + + variable.annotation.java, + punctuation.definition.annotation.java + + settings + + foreground + #d08770 + + + + name + [Java] Punctuation + scope + punctuation.accessor.dot.java + settings + + foreground + #eceff4 + + + + name + [Java] Package + scope + support.other.package.java + settings + + foreground + #8fbcbb + + + + name + [Java] JavaDoc Comment Block Documentation HTML Entities + scope + source.java comment.block.documentation.javadoc punctuation.definition.entity.html + settings + + foreground + #81a1c1 + + + + name + [Java] Constant + scope + source.java entity.name.constant + settings + + foreground + #d8dee9 + + + + name + [Java] JavaDoc Tags + scope + + source.java keyword.other.documentation, + source.java comment.block.documentation.javadoc punctuation.definition.keyword.javadoc + + settings + + foreground + #8fbcbb + + + + name + [Java] Generic + scope + source.java variable.parameter.type.java + settings + + foreground + #8fbcbb + + + + name + [Java] Interface + scope + source.java entity.other.inherited-class.java + settings + + foreground + #8fbcbb + fontStyle + bold + + + + name + [Java] Implements Keyword + scope + source.java keyword.declaration.implements.java + settings + + foreground + #81a1c1 + + + + + name + [JSON] Key + scope + + source.json meta.structure.dictionary.json meta.structure.dictionary.key.json string.quoted.double.json, + source.json.sublime meta.structure.dictionary.json meta.structure.dictionary.key.json string.quoted.double.json + + settings + + foreground + #8fbcbb + + + + name + [JSON] Quote Punctuation + scope + + source.json meta.structure.dictionary.json punctuation.definition.string.begin.json, + source.json meta.structure.dictionary.json punctuation.definition.string.end.json, + source.json.sublime meta.structure.dictionary.json punctuation.definition.string.begin.json, + source.json.sublime meta.structure.dictionary.json punctuation.definition.string.end.json + + settings + + foreground + #eceff4 + + + + + name + [Markdown] Fenced Code Block + scope + + text.html.markdown punctuation.definition.raw.code-fence.begin.markdown, + text.html.markdown punctuation.definition.raw.code-fence.end.markdown, + text.html.markdown markup.raw.code-fence.markdown constant.other.language-name.markdown + + settings + + foreground + #8fbcbb + + + + name + [Markdown] List Bullet + scope + + text.html.markdown punctuation.definition.list_item.markdown, + text.html.markdown markup.list.numbered.bullet.markdown + + settings + + foreground + #81a1c1 + + + + name + [Markdown] Quote Punctuation + scope + text.html.markdown markup.quote.markdown punctuation.definition.blockquote.markdown + settings + + foreground + #8FBCBB + + + + name + [Markdown] Link Description + scope + + text.html.markdown meta.link.inline.description.markdown, + text.html.markdown meta.image.inline.description.markdown, + text.html.markdown meta.link.reference.description.markdown, + text.html.markdown constant.other.reference.link.markdown, + text.html.markdown entity.name.reference.link.markdown + + settings + + foreground + #88C0D0 + + + + name + [Markdown] Link Punctuation + scope + + text.html.markdown punctuation.definition.link.begin.markdown, + text.html.markdown punctuation.definition.link.end.markdown, + text.html.markdown punctuation.definition.image.begin.markdown, + text.html.markdown punctuation.definition.image.end.markdown, + text.html.markdown punctuation.definition.constant.begin.markdown, + text.html.markdown punctuation.definition.constant.end.markdown + + settings + + foreground + #81a1c1 + + + + name + [Markdown] Table Punctuation + scope + + text.html.markdown punctuation.separator.table-cell.markdown, + text.html.markdown punctuation.section.table-header.markdown + + settings + + foreground + #81a1c1 + + + + name + [Markdown] Table Header + scope + text.html.markdown meta.table.header.markdown + settings + + foreground + #88c0d0 + + + + name + [Markdown] Horizontal Line + scope + text.html.markdown punctuation.definition.thematic-break.markdown + settings + + foreground + #81a1c1 + fontStyle + bold + + + + + name + [PHP] Embedded Tag + scope + + embedding.php text.html.basic punctuation.section.embedded.begin.php, + embedding.php text.html.basic punctuation.section.embedded.end.php + + settings + + foreground + #5e81ac + + + + name + [PHP] PHPDoc Tag + scope + embedding.php text.html.basic comment.block.documentation.phpdoc.php keyword.other.phpdoc.php + settings + + foreground + #8fbcbb + + + + name + [PHP] Namespace + scope + embedding.php text.html.basic support.other.namespace.php + settings + + foreground + #8fbcbb + + + + + name + [Python] Decorator + scope + + source.python meta.annotation.python meta.qualified-name.python support.function.builtin.python, + source.python punctuation.definition.annotation.python + + settings + + foreground + #d08770 + + + + name + [Python] BuiltIn Function + scope + support.function.builtin.python + settings + + fontStyle + italic + + + + name + [Python] Exception + scope + source.python support.type.exception.python + settings + + foreground + #8fbcbb + + + + name + [Python] Type + scope + source.python support.type.python + settings + + foreground + #81a1c1 + + + + + name + [Sass] Variable + scope + source.sass variable.parameter.sass + settings + + foreground + #d8dee9 + fontStyle + bold + + + + + name + [Ruby] BuiltIn Function + scope + source.ruby support.function.builtin.ruby + settings + + fontStyle + italic + + + + + name + [Shell] BuiltIn Function + scope + source.shell support.function.builtin.shell + settings + + fontStyle + italic + + + + + name + [XML] Namespace + scope + text.xml entity.name.tag.namespace + settings + + foreground + #8fbcbb + + + + name + [XML] Doctype/Preprocessor + scope + + text.xml meta.tag.sgml.doctype.xml, + text.xml meta.tag.preprocessor entity.name.tag, + text.xml meta.tag.preprocessor.xml punctuation.definition.tag.begin.xml, + text.xml meta.tag.preprocessor.xml punctuation.definition.tag.end.xml, + text.xml meta.tag.sgml.doctype.xml punctuation.definition.tag.begin.xml, + text.xml meta.tag.sgml.doctype.xml punctuation.definition.tag.end.xml + + settings + + foreground + #5e81ac + + + + name + [XML] CDATA Tag + scope + + text.xml string.unquoted.cdata.xml punctuation.definition.string.begin.xml, + text.xml string.unquoted.cdata.xml punctuation.definition.string.end.xml + + settings + + foreground + #D08770 + fontStyle + italic + + + + + name + [YAML] Entity Name Tag + scope + source.yaml entity.name.tag + settings + + foreground + #8fbcbb + + + + + + + name + [SublimeLinter] Warning + scope + sublimelinter.mark.warning + settings + + foreground + #ebcb8b + + + + name + [SublimeLinter] Error + scope + sublimelinter.mark.error + settings + + foreground + #bf616a + + + + name + [SublimeLinter] Gutter Mark + scope + sublimelinter.gutter-mark + settings + + foreground + lime + + + + + name + [GitGutter] Ignored + scope + markup.ignored.git_gutter + settings + + foreground + #616e88 + + + + name + [GitGutter] Untracked + scope + markup.untracked.git_gutter + settings + + foreground + #88c0d0 + + + + name + [GitGutter] Inserted + scope + markup.inserted.git_gutter + settings + + foreground + #a3be8c + + + + name + [GitGutter] Changed + scope + markup.changed.git_gutter + settings + + foreground + #ebcb8b + + + + name + [GitGutter] Deleted + scope + markup.deleted.git_gutter + settings + + foreground + #bf616a + + + + + + name + [Babel] Decorator + scope + + source.js tag.decorator.js entity.name.tag.js, + source.js tag.decorator.js punctuation.definition.tag.js + + settings + + foreground + #d08770 + + + + name + [Babel] String (Interpolated/Template Expression) + scope + + source.js string.quoted.js, + source.js string.quoted.jsx, + source.js meta.class.js meta.class.property.js string.interpolated.js, + source.js string.interpolated.js, + source.js string.template.js + + settings + + foreground + #a3be8c + + + + name + [Babel] Constant + scope + source.js variable.other.constant.js + settings + + foreground + #d8dee9 + fontStyle + bold + + + + name + [Babel] Object Key/Variable + scope + + source.js constant.other.object.key.js string.unquoted.label.js, + source.js variable.other.readwrite.js + + settings + + foreground + #d8dee9 + + + + name + [Babel] Arrow Function + scope + source.js meta.class.js meta.class.property.js variable.other.property.js + settings + + foreground + #88c0d0 + + + + name + [Babel] Static Variable + scope + source.js variable.other.property.static.js + settings + + fontStyle + italic + + + + name + [Babel] Class + scope + source.js variable.other.class.js + settings + + foreground + #8fbcbb + + + + name + [Babel] String Interpolated/Template Expression Keyword + scope + + source.js string.interpolated.js keyword.other.substitution.begin.js, + source.js string.interpolated.js keyword.other.substitution.end.js, + source.js punctuation.definition.template-expression.begin.js, + source.js punctuation.definition.template-expression.end.js + + settings + + foreground + #5e81ac + + + + name + [Babel] Spread Operator + scope + source.js keyword.operator.spread.js + settings + + foreground + #81a1c1 + + + + name + [Babel] Export + scope + source.js meta.export.js variable.other.readwrite.js + settings + + foreground + #8fbcbb + + + + + name + [TypeScript] Inherited Class + scope + source.ts meta.class.ts entity.other.inherited-class.ts + settings + + foreground + #8fbcbb + fontStyle + bold + + + + name + [TypeScript] Class/Enum + scope + + source.ts entity.name.type.class.ts, + source.ts entity.name.type.enum.ts + + settings + + foreground + #8fbcbb + + + + name + [TypeScript] Type + scope + source.ts entity.name.type.ts + settings + + foreground + #8fbcbb + + + + name + [TypeScript] Primitive + scope + source.ts support.type.primitive.ts + settings + + foreground + #81a1c1 + + + + name + [TypeScript] Decorator + scope + + source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.decorator.ts variable.other.readwrite.ts, + source.ts meta.class.ts meta.method.declaration.ts meta.parameters.ts meta.decorator.ts punctuation.decorator.ts + + settings + + foreground + #d08770 + + + + name + [TypeScript] Interpolated String Keyword + scope + + source.ts punctuation.definition.template-expression.begin.ts, + source.ts punctuation.definition.template-expression.end.ts + + settings + + foreground + #5e81ac + + + + name + [TypeScript] Interpolated String + scope + source.ts string.template.ts + settings + + foreground + #a3be8c + + + + name + [TypeScript] Static Support Function + scope + source.ts support.function.math.ts + settings + + fontStyle + italic + + + + name + [TypeScript] Constant + scope + + source.ts variable.other.constant.property.ts, + source.ts variable.other.enummember.ts, + source.ts variable.other.constant.ts + + settings + + foreground + #d8dee9 + fontStyle + bold + + + + name + [TypeScript] JSDoc Tag + scope + source.ts comment.block.documentation.ts storage.type.class.jsdoc + settings + + foreground + #8fbcbb + + + + uuid + 8F96BB94-BF86-4D5E-9733-0428E66FB894 + + diff --git a/.config/yazi/keymap.toml b/.config/yazi/keymap.toml new file mode 100644 index 0000000..5a8bef4 --- /dev/null +++ b/.config/yazi/keymap.toml @@ -0,0 +1,9 @@ +[[mgr.prepend_keymap]] +on = ["c", "a"] +run = "plugin compress" +desc = "Archive selected files" + +[[mgr.prepend_keymap]] +on = "l" +run = "plugin smart-enter" +desc = "Enter the child directory, or open the file" diff --git a/.config/yazi/keymap.toml-1748684127440481 b/.config/yazi/keymap.toml-1748684127440481 new file mode 100644 index 0000000..ede28eb --- /dev/null +++ b/.config/yazi/keymap.toml-1748684127440481 @@ -0,0 +1,9 @@ +[[manager.prepend_keymap]] +on = ["c", "a"] +run = "plugin compress" +desc = "Archive selected files" + +[[manager.prepend_keymap]] +on = "l" +run = "plugin smart-enter" +desc = "Enter the child directory, or open the file" diff --git a/.config/yazi/package.toml b/.config/yazi/package.toml new file mode 100644 index 0000000..869975b --- /dev/null +++ b/.config/yazi/package.toml @@ -0,0 +1,12 @@ +[[plugin.deps]] +use = "KKV9/compress" +rev = "60b24af" +hash = "ee025be766240cc98e671754ac836da3" + +[[plugin.deps]] +use = "yazi-rs/plugins:smart-enter" +rev = "600614a" +hash = "c1a2739e9ef2d837030ccb4267be3ed1" + +[flavor] +deps = [] diff --git a/.config/yazi/plugins/compress.yazi/LICENSE b/.config/yazi/plugins/compress.yazi/LICENSE new file mode 100644 index 0000000..7ce7a2f --- /dev/null +++ b/.config/yazi/plugins/compress.yazi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Ciarán O'Brien + +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/.config/yazi/plugins/compress.yazi/README.md b/.config/yazi/plugins/compress.yazi/README.md new file mode 100644 index 0000000..385fe38 --- /dev/null +++ b/.config/yazi/plugins/compress.yazi/README.md @@ -0,0 +1,48 @@ +# ~~archive.yazi~~ compress.yazi + +A Yazi plugin that compresses selected files to an archive. Supporting yazi versions 0.2.5 and up. + +## Supported file types + +| Extention | Unix Command | Windows Command | +| ------------- | ------------- | --------------- | +| .zip | zip -r | 7z a -tzip | +| .7z | 7z a | 7z a | +| .tar | tar rpf | tar rpf | +| .tar.gz | gzip | 7z a -tgzip | +| .tar.xz | xz | 7z a -txz | +| .tar.bz2 | bzip2 | 7z a -tbzip2 | +| .tar.zst | zstd | zstd | + + +**NOTE:** Windows users are required to install 7-Zip and add 7z.exe to the `path` environment variable, only tar archives will be available otherwise. + + +## Install + +```bash +# For Unix platforms +git clone https://github.com/KKV9/compress.yazi.git ~/.config/yazi/plugins/compress.yazi + +## For Windows +git clone https://github.com/KKV9/compress.yazi.git %AppData%\yazi\config\plugins\compress.yazi + +# Or with yazi plugin manager +ya pack -a KKV9/compress +``` + +- Add this to your `keymap.toml`: + +```toml +[[manager.prepend_keymap]] +on = [ "c", "a" ] +run = "plugin compress" +desc = "Archive selected files" +``` + +## Usage + + - Select files or folders to add, then press `c` `a` to create a new archive. + - Type a name for the new file. + - The file extention must match one of the supported filetype extentions. + - The desired archive/compression command must be installed on your system. diff --git a/.config/yazi/plugins/compress.yazi/main.lua b/.config/yazi/plugins/compress.yazi/main.lua new file mode 100644 index 0000000..333587f --- /dev/null +++ b/.config/yazi/plugins/compress.yazi/main.lua @@ -0,0 +1,228 @@ +-- Send error notification +local function notify_error(message, urgency) + ya.notify({ + title = "Archive", + content = message, + level = urgency, + timeout = 5, + }) +end + +-- Check for windows +local is_windows = ya.target_family() == "windows" + +-- Make table of selected or hovered: path = filenames +local selected_or_hovered = ya.sync(function() + local tab, paths, names, path_fnames = cx.active, {}, {}, {} + for _, u in pairs(tab.selected) do + paths[#paths + 1] = tostring(u:parent()) + names[#names + 1] = tostring(u:name()) + end + if #paths == 0 and tab.current.hovered then + paths[1] = tostring(tab.current.hovered.url:parent()) + names[1] = tostring(tab.current.hovered.name) + end + for idx, name in ipairs(names) do + if not path_fnames[paths[idx]] then + path_fnames[paths[idx]] = {} + end + table.insert(path_fnames[paths[idx]], name) + end + return path_fnames, tostring(tab.current.cwd) +end) + +-- Check if archive command is available +local function is_command_available(cmd) + local stat_cmd + + if is_windows then + stat_cmd = string.format("where %s > nul 2>&1", cmd) + else + stat_cmd = string.format("command -v %s >/dev/null 2>&1", cmd) + end + + local cmd_exists = os.execute(stat_cmd) + if cmd_exists then + return true + else + return false + end +end + +-- Archive command list --> string +local function find_binary(cmd_list) + for _, cmd in ipairs(cmd_list) do + if is_command_available(cmd) then + return cmd + end + end + return cmd_list[1] -- Return first command as fallback +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 + +-- Append filename to it's parent directory +local function combine_url(path, file) + path, file = Url(path), Url(file) + return tostring(path:join(file)) +end + +return { + entry = function() + -- Exit visual mode + ya.manager_emit("escape", { visual = true }) + + -- Define file table and output_dir (pwd) + local path_fnames, output_dir = selected_or_hovered() + + -- Get input + local output_name, event = ya.input({ + title = "Create archive:", + position = { "top-center", y = 3, w = 40 }, + }) + if event ~= 1 then + return + end + + -- Use appropriate archive command + local archive_commands = { + ["%.zip$"] = { command = "zip", args = { "-r" } }, + ["%.7z$"] = { command = { "7z", "7zz" }, args = { "a" } }, + ["%.tar.gz$"] = { command = "tar", args = { "rpf" }, compress = "gzip" }, + ["%.tar.xz$"] = { command = "tar", args = { "rpf" }, compress = "xz" }, + ["%.tar.bz2$"] = { command = "tar", args = { "rpf" }, compress = "bzip2" }, + ["%.tar.zst$"] = { command = "tar", args = { "rpf" }, compress = "zstd", compress_args = { "--rm" } }, + ["%.tar$"] = { command = "tar", args = { "rpf" } }, + } + + if is_windows then + archive_commands = { + ["%.zip$"] = { command = "7z", args = { "a", "-tzip" } }, + ["%.7z$"] = { command = "7z", args = { "a" } }, + ["%.tar.gz$"] = { + command = "tar", + args = { "rpf" }, + compress = "7z", + compress_args = { "a", "-tgzip", "-sdel", output_name }, + }, + ["%.tar.xz$"] = { + command = "tar", + args = { "rpf" }, + compress = "7z", + compress_args = { "a", "-txz", "-sdel", output_name }, + }, + ["%.tar.bz2$"] = { + command = "tar", + args = { "rpf" }, + compress = "7z", + compress_args = { "a", "-tbzip2", "-sdel", output_name }, + }, + ["%.tar.zst$"] = { command = "tar", args = { "rpf" }, compress = "zstd", compress_args = { "--rm" } }, + ["%.tar$"] = { command = "tar", args = { "rpf" } }, + } + end + + -- Match user input to archive command + local archive_cmd, archive_args, archive_compress, archive_compress_args + for pattern, cmd_pair in pairs(archive_commands) do + if output_name:match(pattern) then + archive_cmd = cmd_pair.command + archive_args = cmd_pair.args + archive_compress = cmd_pair.compress + archive_compress_args = cmd_pair.compress_args or {} + end + end + + -- Check if archive command has multiple names + if type(archive_cmd) == "table" then + archive_cmd = find_binary(archive_cmd) + end + + -- Check if no archive command is available for the extention + if not archive_cmd then + notify_error("Unsupported file extention", "error") + return + end + + -- Exit if archive command is not available + if not is_command_available(archive_cmd) then + notify_error(string.format("%s not available", archive_cmd), "error") + return + end + + -- Exit if compress command is not available + if archive_compress and not is_command_available(archive_compress) then + notify_error(string.format("%s compression not available", archive_compress), "error") + return + end + + -- If file exists show overwrite prompt + local output_url = combine_url(output_dir, output_name) + while true do + if file_exists(output_url) then + local overwrite_answer = ya.input({ + title = "Overwrite " .. output_name .. "? y/N:", + position = { "top-center", y = 3, w = 40 }, + }) + if overwrite_answer:lower() ~= "y" then + notify_error("Operation canceled", "warn") + return -- If no overwrite selected, exit + else + local rm_status, rm_err = os.remove(output_url) + if not rm_status then + notify_error(string.format("Failed to remove %s, exit code %s", output_name, rm_err), "error") + return + end -- If overwrite fails, exit + end + end + if archive_compress and not output_name:match("%.tar$") then + output_name = output_name:match("(.*%.tar)") -- Test for .tar and .tar.* + output_url = combine_url(output_dir, output_name) -- Update output_url + else + break + end + end + + -- Add to output archive in each path, their respective files + for path, names in pairs(path_fnames) do + local archive_status, archive_err = + Command(archive_cmd):args(archive_args):arg(output_url):args(names):cwd(path):spawn():wait() + if not archive_status or not archive_status.success then + notify_error( + string.format( + "%s with selected files failed, exit code %s", + archive_args, + archive_status and archive_status.code or archive_err + ), + "error" + ) + end + end + + -- Use compress command if needed + if archive_compress then + local compress_status, compress_err = + Command(archive_compress):args(archive_compress_args):arg(output_name):cwd(output_dir):spawn():wait() + if not compress_status or not compress_status.success then + notify_error( + string.format( + "%s with %s failed, exit code %s", + archive_compress, + output_name, + compress_status and compress_status.code or compress_err + ), + "error" + ) + end + end + end, +} diff --git a/.config/yazi/plugins/smart-enter.yazi/LICENSE b/.config/yazi/plugins/smart-enter.yazi/LICENSE new file mode 100644 index 0000000..fb5b1d6 --- /dev/null +++ b/.config/yazi/plugins/smart-enter.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/.config/yazi/plugins/smart-enter.yazi/README.md b/.config/yazi/plugins/smart-enter.yazi/README.md new file mode 100644 index 0000000..d4c6bbd --- /dev/null +++ b/.config/yazi/plugins/smart-enter.yazi/README.md @@ -0,0 +1,40 @@ +# smart-enter.yazi + +[`Open`][open] files or [`enter`][enter] directories all in one key! + +## Installation + +```sh +ya pack -a yazi-rs/plugins:smart-enter +``` + +## Usage + +Bind your l key to the plugin, in your `~/.config/yazi/keymap.toml`: + +```toml +[[manager.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/#manager.open +[enter]: https://yazi-rs.github.io/docs/configuration/keymap/#manager.enter diff --git a/.config/yazi/plugins/smart-enter.yazi/main.lua b/.config/yazi/plugins/smart-enter.yazi/main.lua new file mode 100644 index 0000000..37a465a --- /dev/null +++ b/.config/yazi/plugins/smart-enter.yazi/main.lua @@ -0,0 +1,10 @@ +--- @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.manager_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/.config/yazi/theme.toml b/.config/yazi/theme.toml new file mode 100644 index 0000000..651f857 --- /dev/null +++ b/.config/yazi/theme.toml @@ -0,0 +1,2 @@ +[flavor] +use = "nord" diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml new file mode 100644 index 0000000..465b12c --- /dev/null +++ b/.config/yazi/yazi.toml @@ -0,0 +1,2 @@ +[opener] +edit = [{ run = 'nvim "$@"', block = true }] -- cgit v1.2.3