Add files via upload

This commit is contained in:
2025-11-24 19:46:30 +07:00
parent 90cc6d4253
commit a7ab7103a5
365 changed files with 17881 additions and 0 deletions

View File

@@ -0,0 +1,298 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>gutterSettings</key>
<dict>
<key>background</key>
<string>#49483E</string>
<key>divider</key>
<string>#75715E</string>
<key>foreground</key>
<string>#75715E</string>
</dict>
<key>name</key>
<string>Gruvbox Dark</string>
<key>semanticClass</key>
<string>theme.dark.gruvbox</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>
<string>#323232</string>
<key>caret</key>
<string>#ffddc0</string>
<key>foreground</key>
<string>#ffddc0</string>
<key>invisibles</key>
<string>#665c54</string>
<key>lineHighlight</key>
<string>#665c54</string>
<key>selection</key>
<string>#665c54</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Comment</string>
<key>scope</key>
<string>comment</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#282828</string>
<key>background</key>
<string>#9b9b9b</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>String</string>
<key>scope</key>
<string>string</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#bbb93d</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Number</string>
<key>scope</key>
<string>constant.numeric</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#e59bba</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Built-in constant</string>
<key>scope</key>
<string>constant.language</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#ff9734</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>User-defined constant</string>
<key>scope</key>
<string>constant.character, constant.other</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#ff9734</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Variable</string>
<key>scope</key>
<string>variable</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Keyword</string>
<key>scope</key>
<string>keyword</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#e7736e</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage</string>
<key>scope</key>
<string>storage</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#e7736e</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Storage type</string>
<key>scope</key>
<string>storage.type</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#e7736e</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Class name</string>
<key>scope</key>
<string>entity.name.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#93bb9c</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Inherited class</string>
<key>scope</key>
<string>entity.other.inherited-class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#93bb9c</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Function name</string>
<key>scope</key>
<string>entity.name.function</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#93bb9c</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Function argument</string>
<key>scope</key>
<string>variable.parameter</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#ff9734</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tag name</string>
<key>scope</key>
<string>entity.name.tag</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#e7736e</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Tag attribute</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#bbb93d</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library function</string>
<key>scope</key>
<string>support.function</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#ff9734</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library constant</string>
<key>scope</key>
<string>support.constant</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#ff9734</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library class&#x2f;type</string>
<key>scope</key>
<string>support.type, support.class</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#ff9734</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Library variable</string>
<key>scope</key>
<string>support.other.variable</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Invalid</string>
<key>scope</key>
<string>invalid</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#d3869b</string>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#fdf4c1</string>
</dict>
</dict>
<dict>
<key>name</key>
<string>Invalid deprecated</string>
<key>scope</key>
<string>invalid.deprecated</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#8ec07c</string>
<key>foreground</key>
<string>#fdf4c1</string>
</dict>
</dict>
</array>
<key>uuid</key>
<string>D8D5E82E-3D5B-46B5-B38E-8C841C21347D</string>
<key>colorSpaceName</key>
<string>sRGB</string>
</dict>
</plist>

View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2024 Ben Yip
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Subhaditya Nath
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,32 @@
<div align="center">
<img src="https://github.com/sxyazi/yazi/blob/main/assets/logo.png?raw=true" alt="Yazi logo" width="20%">
</div>
<h3 align="center">
Gruvbox Dark Flavor for <a href="https://github.com/sxyazi/yazi">Yazi</a>
</h3>
## 👀 Preview
<img src="preview.png" width="600" />
## 🎨 Installation
```bash
ya pack -a bennyyip/gruvbox-dark
```
## ⚙️ Usage
Add the these lines to your `theme.toml` configuration file to use it:
```toml
[flavor]
dark = "gruvbox-dark"
```
## 📜 License
The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed.
Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details.

View File

@@ -0,0 +1,146 @@
# vim:fileencoding=utf-8:foldmethod=marker
# : Manager {{{
[manager]
cwd = { fg = "#83a598" }
# Hovered
hovered = { reversed = true, bold = true }
# hovered = { bg = "#3c3836", bold = true }
preview_hovered = { underline = true }
# Find
find_keyword = { fg = "#b8bb26", italic = true }
find_position = { fg = "#fe8019", bg = "reset", italic = true }
# Marker
marker_copied = { fg = "#8ec07c", bg = "#8ec07c" }
marker_cut = { fg = "#d3869b", bg = "#d3869b" }
marker_marked = { fg = "#83a598", bg = "#83a598" }
marker_selected = { fg = "#fbf1c7", bg = "#fbf1c7" }
# Tab
tab_active = { fg = "#282828", bg = "#a89984" }
tab_inactive = { fg = "#a89984", bg = "#504945" }
tab_width = 1
# Count
count_copied = { fg = "#282828", bg = "#8ec07c" }
count_cut = { fg = "#282828", bg = "#d3869b" }
count_selected = { fg = "#282828", bg = "#fbf1c7" }
# Border
border_symbol = "│"
border_style = { fg = "#665c54" }
# : }}}
# : Status {{{
[status]
separator_open = "\ue0be"
separator_close = "\ue0b8"
separator_style = { fg = "#3c3836", bg = "#3c3836" }
# Mode
mode_normal = { fg = "#282828", bg = "#a89984", bold = true }
mode_select = { fg = "#282828", bg = "#fe8019", bold = true }
mode_unset = { fg = "#282828", bg = "#b8bb26", bold = true }
# Progress
progress_label = { fg = "#ebdbb2", bold = true }
progress_normal = { fg = "#504945", bg = "#3c3836" }
progress_error = { fg = "#fb4934", bg = "#3c3836" }
# Permissions
permissions_t = { fg = "#504945" }
permissions_r = { fg = "#b8bb26" }
permissions_w = { fg = "#fb4934" }
permissions_x = { fg = "#b8bb26" }
permissions_s = { fg = "#665c54" }
# : }}}
# : Select {{{
[select]
border = { fg = "#458588" }
active = { fg = "#d3869b", bold = true }
inactive = {}
# : }}}
# : Input {{{
[input]
border = { fg = "#ebdbb2" }
title = {}
value = {}
selected = { reversed = true }
# : }}}
# : Tasks {{{
[tasks]
border = { fg = "#504945" }
title = {}
hovered = { underline = true }
# : }}}
# : Which {{{
[which]
mask = { bg = "#3c3836" }
cand = { fg = "#83a598" }
rest = { fg = "#928374" }
desc = { fg = "#fe8019" }
separator = "  "
separator_style = { fg = "#504945" }
# : }}}
# : Help {{{
[help]
on = { fg = "#83a598" }
run = { fg = "#d3869b" }
hovered = { reversed = true, bold = true }
footer = { fg = "#3c3836", bg = "#a89984" }
# : }}}
# : Notify {{{
[notify]
title_info = { fg = "#8ec07c" }
title_warn = { fg = "#fbf1c7" }
title_error = { fg = "#d3869b" }
# : }}}
# : File-specific styles {{{
[filetype]
rules = [
# Images
{ mime = "image/*", fg = "#d3869b" },
# Media
{ mime = "{audio,video}/*", fg = "#fabd2f" },
# Archives
{ mime = "application/*zip", fg = "#fb4934" },
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", fg = "#fb4934" },
# Documents
{ mime = "application/{pdf,doc,rtf,vnd.*}", fg = "#689d6a" },
# Fallback
{ name = "*", fg = "#ebdbb2" },
{ name = "*/", fg = "#83a598" },
]
# : }}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 MiB

File diff suppressed because it is too large Load Diff

105
config/yazi/init.lua Normal file
View File

@@ -0,0 +1,105 @@
require("folder-rules"):setup()
require("smart-enter"):setup({
open_multi = true,
})
require("full-border"):setup()
require("yatline"):setup({
--theme = my_theme,
section_separator = { open = "", close = "" },
part_separator = { open = "", close = "" },
inverse_separator = { open = "", close = "" },
style_a = {
fg = "black",
bg_mode = {
normal = "green",
select = "yellow",
un_set = "brightred",
},
},
style_b = { bg = "#141617", fg = "yellow" },
style_c = { bg = "#1d2021", fg = "#d8a657" },
permissions_t_fg = "green",
permissions_r_fg = "yellow",
permissions_w_fg = "red",
permissions_x_fg = "cyan",
permissions_s_fg = "white",
tab_width = 40,
tab_use_inverse = false,
selected = { icon = "󰻭", fg = "yellow" },
copied = { icon = "", fg = "green" },
cut = { icon = "", fg = "red" },
total = { icon = "󰮍", fg = "yellow" },
succ = { icon = "", fg = "green" },
fail = { icon = "", fg = "red" },
found = { icon = "󰮕", fg = "blue" },
processed = { icon = "󰐍", fg = "green" },
show_background = false,
display_header_line = true,
display_status_line = true,
component_positions = { "header", "tab", "status" },
header_line = {
left = {
section_a = {},
section_b = {
{ type = "coloreds", custom = true, name = { { " 󰇥 ", "#fabd2f" } } },
-- { type = "string", custom = false, name = "hovered_file_extension", params = { true } },
},
section_c = {
{ type = "coloreds", custom = false, name = "count" },
-- { type = "coloreds", custom = false, name = "task_workload" },
-- { type = "string", custom = false, name = "hovered_name" },
-- { type = "string", custom = false, name = "hovered_path" },
},
},
right = {
section_a = {
{ type = "line", custom = false, name = "tabs", params = { "left" } },
--{ type = "string", custom = false, name = "date", params = { "%A, %d %B %Y" } },
-- { type = "line", custom = false, name = "tabs", params = { "right" } },
},
section_b = {
-- { type = "string", custom = false, name = "date", params = { "%X" } },
-- { type = "string", custom = false, name = "tab_path" },
},
section_c = {},
},
},
status_line = {
left = {
section_a = {
{ type = "string", custom = false, name = "tab_mode" },
},
section_b = {
{ type = "string", custom = false, name = "hovered_size" },
},
section_c = {
-- { type = "string", custom = false, name = "hovered_path" },
{ type = "string", custom = false, name = "hovered_path" },
},
},
right = {
section_a = {
{ type = "string", custom = false, name = "cursor_position" },
},
section_b = {
{ type = "string", custom = false, name = "cursor_percentage" },
},
section_c = {
{ type = "coloreds", custom = false, name = "permissions" },
-- { type = "coloreds", custom = false, name = "task_states" },
},
},
},
})

477
config/yazi/keymap.toml Normal file
View File

@@ -0,0 +1,477 @@
# 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 = ["d", "m"]
run = "plugin mount"
desc = "Монтирование дисков"
[[manager.prepend_keymap]]
on = ["F", "g"]
run = "plugin fg"
desc = "Поиск содержимого по файлам (fuzzy match)"
[[manager.prepend_keymap]]
on = "<Right>"
run = "plugin smart-enter"
desc = "Переход по каталогам и открытие файлов на клавишу Вправо"
[[manager.prepend_keymap]]
on = "<F10>"
run = '''
shell 'dragon-drop -a -x "$@"'
'''
desc = "Перетаскивание файлов"
[[manager.prepend_keymap]]
on = "<F12>"
run = '''
shell 'sudo kitty -e yazi'
'''
desc = "Запуск yazi от root"
[[manager.prepend_keymap]]
on = ["y", "s"]
run = '''
shell 'scp -r -P 666 "$@" user@server:/home/zloy_linux && notify-send "Файл(ы) на сервер скопированы"'
'''
desc = "Скопировать файл(ы) на удаленный севрер"
[[manager.prepend_keymap]]
on = "!"
run = 'shell "$SHELL" --block'
desc = "Открыть терминал в этом окне. Для выхода набрать exit"
#[[manager.prepend_keymap]]
#on = "<F8>"
#run = '''
# shell 'trash-put "$@"'
#'''
#desc = "Удаление файлов в корзину"
#[[manager.prepend_keymap]]
#on = "<Delete>"
#run = '''
# shell 'trash-put "$@"'
#'''
#desc = "Удаление файлов в корзину"
[[input.prepend_keymap]]
on = "<Esc>"
run = "close"
desc = "Cancel input"
[[manager.prepend_keymap]]
on = "<Delete>"
run = "remove"
desc = "Удаление файлов в корзину"
[[manager.prepend_keymap]]
on = "<F8>"
run = "remove"
desc = "Удаление файлов в корзину"
#[[manager.prepend_keymap]]
#on = ["c", "a"]
#run = "plugin compress"
#desc = "Архивировать файлы"
[[manager.prepend_keymap]]
on = ["c", "a"]
run = "plugin ouch"
desc = "Создать архив"
[[manager.prepend_keymap]]
on = ["c", "x"]
run = '''
shell 'ouch d -y "$@"'
'''
desc = "Распаковать"
[manager]
keymap = [
{ on = "<Esc>", run = "escape", desc = "Exit visual mode, clear selected, or cancel search" },
{ on = "<C-[>", run = "escape", desc = "Exit visual mode, clear selected, or cancel search" },
{ on = "q", run = "quit", desc = "Quit the process" },
{ on = "Q", run = "quit --no-cwd-file", desc = "Quit the process without outputting cwd-file" },
{ on = "<C-c>", run = "close", desc = "Close the current tab, or quit if it's last" },
{ on = "<C-z>", run = "suspend", desc = "Suspend the process" },
# Hopping
# { on = "k", run = "arrow -1", desc = "Move cursor up" },
#{ on = "j", run = "arrow 1", desc = "Move cursor down" },
{ on = "<Up>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<Down>", run = "arrow 1", desc = "Move cursor down" },
{ on = "<C-u>", run = "arrow -50%", desc = "Move cursor up half page" },
{ on = "<C-d>", run = "arrow 50%", desc = "Move cursor down half page" },
{ on = "<C-b>", run = "arrow -100%", desc = "Move cursor up one page" },
{ on = "<C-f>", run = "arrow 100%", desc = "Move cursor down one page" },
{ on = "<PageUp>", run = "arrow -50%", desc = "Move cursor up half page" },
{ on = "<PageDown>", run = "arrow 50%", desc = "Move cursor down half page" },
{ on = "<S-PageUp>", run = "arrow -100%", desc = "Move cursor up one page" },
{ on = "<S-PageDown>", run = "arrow 100%", desc = "Move cursor down one page" },
{ on = "<Home>", run = "arrow top", desc = "Move cursor to the top" },
{ on = "<End>", run = "arrow bot", desc = "Move cursor to the bottom" },
# Navigation
# { on = "h", run = "leave", desc = "Go back to the parent directory" },
#{ on = "l", run = "enter", desc = "Enter the child directory" },
{ on = "<Left>", run = "leave", desc = "Go back to the parent directory" },
{ on = "<Right>", run = "enter", desc = "Enter the child directory" },
{ on = "H", run = "back", desc = "Go back to the previous directory" },
{ on = "L", run = "forward", desc = "Go forward to the next directory" },
{ on = [ "g", "f", ], run = "forward", desc = "Вперед" },
{ on = [ "g", "b", ], run = "back", desc = "Назад" },
# Toggle
{ on = "<Space>", run = [ "toggle", "arrow 1", ], desc = "Выделение" },
{ on = "<Insert>", run = [ "toggle", "arrow 1", ], desc = "Выделение" },
{ on = "<C-a>", run = "toggle_all --state=on", desc = "Выделить все файлы" },
{ on = "<C-r>", run = "toggle_all", desc = "Инверция выделенных файлов" },
# Visual mode
{ on = "v", run = "visual_mode", desc = "Enter visual mode (selection mode)" },
{ on = "V", run = "visual_mode --unset", desc = "Enter visual mode (unset mode)" },
# Seeking
{ on = "K", run = "seek -5", desc = "Seek up 5 units in the preview" },
{ on = "J", run = "seek 5", desc = "Seek down 5 units in the preview" },
# Spotting
{ on = "<Tab>", run = "spot", desc = "Spot hovered file" },
# Operation
# { on = "o", run = "open", desc = "Open selected files" },
{ on = "o", run = "plugin what-size", desc = "Размер директории" },
{ on = "A", run = "rename --cursor=start", desc = "Переименовать с начала имени" },
{ on = "r", run = "open --interactive", desc = "Open selected files interactively" },
{ on = "<S-Enter>", run = "open", desc = "Open selected files" },
{ on = "<Enter>", run = "open --interactive", desc = "Open selected files interactively" },
#{ on = "y", run = "yank", desc = "Yank selected files (copy)" },
# { on = "x", run = "yank --cut", desc = "Yank selected files (cut)" },
{ on = "p", run = "paste", desc = "Paste yanked files" },
{ on = "P", run = "paste --force", desc = "Paste yanked files (overwrite if the destination exists)" },
{ on = "-", run = "link", desc = "Symlink the absolute path of yanked files" },
{ on = "_", run = "link --relative", desc = "Symlink the relative path of yanked files" },
{ on = "<C-->", run = "hardlink", desc = "Hardlink yanked files" },
{ on = "Y", run = "unyank", desc = "Cancel the yank status" },
{ on = "X", run = "unyank", desc = "Cancel the yank status" },
{ on = [ "D", "D", ], run = "remove", desc = "Удалить файл(ы) в корзину" },
{ on = [ "d", "d", ], run = [ "yank --cut", "escape --visual --select", ], desc = "Вырезать" },
# { on = "D", run = "remove --permanently", desc = "Permanently delete selected files" },
{ on = "<F7>", run = "create", desc = "Create a file (ends with / for directories)" },
{ on = "a", run = "rename --cursor=before_ext", desc = "Rename selected file(s)" },
{ on = ";", run = "shell --interactive", desc = "Run a shell command" },
{ on = ":", run = "shell --block --interactive", desc = "Run a shell command (block until finishes)" },
{ on = ".", run = "hidden toggle", desc = "Toggle the visibility of hidden files" },
{ on = "s", run = "search --via=fd", desc = "Search files by name via fd" },
{ on = "S", run = "search --via=rg", desc = "Search files by content via ripgrep" },
{ on = "<C-s>", run = "escape --search", desc = "Cancel the ongoing search" },
{ on = "z", run = "plugin zoxide", desc = "Jump to a directory via zoxide" },
{ on = "Z", run = "plugin fzf", desc = "Jump to a file/directory via fzf" },
# Linemode
{ on = [ "m", "s", ], run = "linemode size", desc = "Linemode: size" },
{ on = [ "m", "p", ], run = "linemode permissions", desc = "Linemode: permissions" },
{ on = [ "m", "b", ], run = "linemode btime", desc = "Linemode: btime" },
{ on = [ "m", "m", ], run = "linemode mtime", desc = "Linemode: mtime" },
{ on = [ "m", "o", ], run = "linemode owner", desc = "Linemode: owner" },
{ on = [ "m", "n", ], run = "linemode none", desc = "Linemode: none" },
# Copy
{ on = [ "y", "y", ], run = [ "yank", "escape --visual --select", ], desc = "Копировать" },
{ on = [ "y", "p", ], run = "copy path", desc = "Копировать путь" },
{ on = [ "y", "d", ], run = "copy dirname", desc = "Копировать путь до текущего" },
{ on = [ "y", "f", ], run = "copy filename", desc = "Копировать имя файла" },
{ on = [ "y", "n", ], run = "copy name_without_ext", desc = "Копировать имя без расширения" },
# Filter
{ on = "f", run = "filter --smart", desc = "Filter files" },
# Find
{ on = "/", run = "find --smart", desc = "Find next file" },
{ on = "?", run = "find --previous --smart", desc = "Find previous file" },
{ on = "n", run = "find_arrow", desc = "Goto the next found" },
{ on = "N", run = "find_arrow --previous", desc = "Goto the previous found" },
# Sorting
{ on = [ ",", "m", ], run = [ "sort mtime --reverse=no", "linemode mtime", ], desc = "Sort by modified time" },
{ on = [ ",", "M", ], run = [ "sort mtime --reverse", "linemode mtime", ], desc = "Sort by modified time (reverse)" },
{ on = [ ",", "b", ], run = [ "sort btime --reverse=no", "linemode btime", ], desc = "Sort by birth time" },
{ on = [ ",", "B", ], run = [ "sort btime --reverse", "linemode btime", ], desc = "Sort by birth time (reverse)" },
{ on = [ ",", "e", ], run = "sort extension --reverse=no", desc = "Sort by extension" },
{ on = [ ",", "E", ], run = "sort extension --reverse", desc = "Sort by extension (reverse)" },
{ on = [ ",", "a", ], run = "sort alphabetical --reverse=no", desc = "Sort alphabetically" },
{ on = [ ",", "A", ], run = "sort alphabetical --reverse", desc = "Sort alphabetically (reverse)" },
{ on = [ ",", "n", ], run = "sort natural --reverse=no", desc = "Sort naturally" },
{ on = [ ",", "N", ], run = "sort natural --reverse", desc = "Sort naturally (reverse)" },
{ on = [ ",", "s", ], run = [ "sort size --reverse=no", "linemode size", ], desc = "Sort by size" },
{ on = [ ",", "S", ], run = [ "sort size --reverse", "linemode size", ], desc = "Sort by size (reverse)" },
{ on = [ ",", "r", ], run = "sort random --reverse=no", desc = "Sort randomly" },
# Goto
{ on = [ "g", "h", ], run = "cd ~", desc = "Домой" },
# { on = [ "`", "c" ], run = "cd /media/cloud/", desc = "/media/cloud" },
{ on = [ "`", "d", ], run = "cd ~/Загрузки", desc = "Загрузки" },
# { on = [ "`", "m", ], run = "cd ~/MEGA", desc = "MEGA" },
#{ on = [ "`", "n", ], run = "cd ~/Nextcloud/", desc = "Nextcloud" },
{ on = [ "`", "c", ], run = "cd ~/Seafile", desc = "Seafile" },
{ on = [ "`", "p", ], run = "cd ~/Public/", desc = "Public" },
{ on = [ "`", "u", ], run = "cd /mnt/sshfs/", desc = "Довашняя директория на сервере" },
{ on = [ "`", "i", ], run = "cd ~/Изображения", desc = "Изображения" },
{ on = [ "`", "s", ], run = "cd ~/Скриншоты/", desc = "Скриншоты" },
{ on = [ "`", "t", ], run = "cd ~/Загрузки/Telegram/", desc = "Telegram" },
{ on = [ "`", "v", ], run = "cd ~/Видео", desc = "Видео" },
{ on = [ "`", "y", ], run = "cd ~/Видео/My_YOUTUBE/", desc = "Мои видео для видеохостинга" },
{ on = [ "`", "w", ], run = "cd ~/Изображения/my_wallpapers/", desc = "My Wallpapers" },
{ on = [ "`", "z", ], run = "cd ~/Изображения/znam2/", desc = "Znam2" },
{ on = [ "g", "<Space>", ], run = "cd --interactive", desc = "Перейти в директорию" },
# Tabs
{ on = [ "t", "n", ], run = "tab_create --current", desc = "Новая вкладка" },
{ on = [ "t", "q", ], run = "tab_close", desc = "Закрыть вкладку" },
{ on = "1", run = "tab_switch 0", desc = "Switch to the first tab" },
{ on = "2", run = "tab_switch 1", desc = "Switch to the second tab" },
{ on = "3", run = "tab_switch 2", desc = "Switch to the third tab" },
{ on = "4", run = "tab_switch 3", desc = "Switch to the fourth tab" },
{ on = "5", run = "tab_switch 4", desc = "Switch to the fifth tab" },
{ on = "6", run = "tab_switch 5", desc = "Switch to the sixth tab" },
{ on = "7", run = "tab_switch 6", desc = "Switch to the seventh tab" },
{ on = "8", run = "tab_switch 7", desc = "Switch to the eighth tab" },
{ on = "9", run = "tab_switch 8", desc = "Switch to the ninth tab" },
{ on = "<[>", run = "tab_switch -1 --relative", desc = "Switch to the previous tab" },
{ on = "<]>", run = "tab_switch 1 --relative", desc = "Switch to the next tab" },
{ on = "{", run = "tab_swap -1", desc = "Swap current tab with previous tab" },
{ on = "}", run = "tab_swap 1", desc = "Swap current tab with next tab" },
# Tasks
{ on = "w", run = "tasks_show", desc = "Show task manager" },
# Help
# { on = "~", run = "help", desc = "Open help" },
{ on = "<F1>", run = "help", desc = "Open help" },
]
[tasks]
keymap = [
{ on = "<Esc>", run = "close", desc = "Close task manager" },
{ on = "<C-[>", run = "close", desc = "Close task manager" },
{ on = "<C-c>", run = "close", desc = "Close task manager" },
{ on = "w", run = "close", desc = "Close task manager" },
{ on = "k", run = "arrow -1", desc = "Move cursor up" },
{ on = "j", run = "arrow 1", desc = "Move cursor down" },
{ on = "<Up>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<Down>", run = "arrow 1", desc = "Move cursor down" },
{ on = "<Enter>", run = "inspect", desc = "Inspect the task" },
{ on = "x", run = "cancel", desc = "Cancel the task" },
# Help
{ on = "~", run = "help", desc = "Open help" },
{ on = "<F1>", run = "help", desc = "Open help" },
]
[spot]
keymap = [
{ on = "<Esc>", run = "close", desc = "Close the spot" },
{ on = "<C-[>", run = "close", desc = "Close the spot" },
{ on = "<C-c>", run = "close", desc = "Close the spot" },
{ on = "<Tab>", run = "close", desc = "Close the spot" },
{ on = "k", run = "arrow -1", desc = "Move cursor up" },
{ on = "j", run = "arrow 1", desc = "Move cursor down" },
{ on = "h", run = "swipe -1", desc = "Swipe to the previous file" },
{ on = "l", run = "swipe 1", desc = "Swipe to the next file" },
{ on = "<Up>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<Down>", run = "arrow 1", desc = "Move cursor down" },
{ on = "<Left>", run = "swipe -1", desc = "Swipe to the next file" },
{ on = "<Right>", run = "swipe 1", desc = "Swipe to the previous file" },
# Copy
{ on = ["c", "c"], run = "copy cell", desc = "Copy selected cell" },
# Help
{ on = "~", run = "help", desc = "Open help" },
{ on = "<F1>", run = "help", desc = "Open help" },
]
[pick]
keymap = [
{ on = "<Esc>", run = "close", desc = "Cancel pick" },
{ on = "<C-[>", run = "close", desc = "Cancel pick" },
{ on = "<C-c>", run = "close", desc = "Cancel pick" },
{ on = "<Enter>", run = "close --submit", desc = "Submit the pick" },
{ on = "k", run = "arrow -1", desc = "Move cursor up" },
{ on = "j", run = "arrow 1", desc = "Move cursor down" },
{ on = "<Up>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<Down>", run = "arrow 1", desc = "Move cursor down" },
# Help
{ on = "~", run = "help", desc = "Open help" },
{ on = "<F1>", run = "help", desc = "Open help" },
]
[input]
keymap = [
{ on = "<C-c>", run = "close", desc = "Cancel input" },
{ on = "<Enter>", run = "close --submit", desc = "Submit input" },
{ on = "<Esc>", run = "escape", desc = "Go back the normal mode, or cancel input" },
{ on = "<C-[>", run = "escape", desc = "Go back the normal mode, or cancel input" },
# Mode
{ on = "i", run = "insert", desc = "Enter insert mode" },
{ on = "I", run = [ "move first-char", "insert", ], desc = "Move to the BOL, and enter insert mode" },
{ on = "a", run = "insert --append", desc = "Enter append mode" },
{ on = "A", run = [ "move eol", "insert --append", ], desc = "Move to the EOL, and enter append mode" },
{ on = "v", run = "visual", desc = "Enter visual mode" },
{ on = "V", run = [ "move bol", "visual", "move eol", ], desc = "Enter visual mode and select all" },
{ on = "r", run = "replace", desc = "Replace a single character" },
# Character-wise movement
{ on = "h", run = "move -1", desc = "Move back a character" },
{ on = "l", run = "move 1", desc = "Move forward a character" },
{ on = "<Left>", run = "move -1", desc = "Move back a character" },
{ on = "<Right>", run = "move 1", desc = "Move forward a character" },
{ on = "<C-b>", run = "move -1", desc = "Move back a character" },
{ on = "<C-f>", run = "move 1", desc = "Move forward a character" },
# Word-wise movement
{ on = "b", run = "backward", desc = "Move back to the start of the current or previous word" },
{ on = "B", run = "backward --far", desc = "Move back to the start of the current or previous WORD" },
{ on = "w", run = "forward", desc = "Move forward to the start of the next word" },
{ on = "W", run = "forward --far", desc = "Move forward to the start of the next WORD" },
{ on = "e", run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" },
{ on = "E", run = "forward --far --end-of-word", desc = "Move forward to the end of the current or next WORD" },
{ on = "<A-b>", run = "backward", desc = "Move back to the start of the current or previous word" },
{ on = "<A-f>", run = "forward --end-of-word", desc = "Move forward to the end of the current or next word" },
# Line-wise movement
{ on = "0", run = "move bol", desc = "Move to the BOL" },
{ on = "$", run = "move eol", desc = "Move to the EOL" },
{ on = "_", run = "move first-char", desc = "Move to the first non-whitespace character" },
{ on = "^", run = "move first-char", desc = "Move to the first non-whitespace character" },
{ on = "<C-a>", run = "move bol", desc = "Move to the BOL" },
{ on = "<C-e>", run = "move eol", desc = "Move to the EOL" },
{ on = "<Home>", run = "move bol", desc = "Move to the BOL" },
{ on = "<End>", run = "move eol", desc = "Move to the EOL" },
# Delete
{ on = "<Backspace>", run = "backspace", desc = "Delete the character before the cursor" },
{ on = "<Delete>", run = "backspace --under", desc = "Delete the character under the cursor" },
{ on = "<C-h>", run = "backspace", desc = "Delete the character before the cursor" },
{ on = "<C-d>", run = "backspace --under", desc = "Delete the character under the cursor" },
# Kill
{ on = "<C-u>", run = "kill bol", desc = "Kill backwards to the BOL" },
{ on = "<C-k>", run = "kill eol", desc = "Kill forwards to the EOL" },
{ on = "<C-w>", run = "kill backward", desc = "Kill backwards to the start of the current word" },
{ on = "<A-d>", run = "kill forward", desc = "Kill forwards to the end of the current word" },
# Cut/Yank/Paste
# { on = "d", run = "delete --cut", desc = "Cut the selected characters" },
#{ on = "D", run = [ "delete --cut", "move eol" ], desc = "Cut until the EOL" },
#{ on = "c", run = "delete --cut --insert", desc = "Cut the selected characters, and enter insert mode" },
#{ on = "C", run = [ "delete --cut --insert", "move eol" ], desc = "Cut until the EOL, and enter insert mode" },
#{ on = "x", run = [ "delete --cut", "move 1 --in-operating" ], desc = "Cut the current character" },
#{ on = "y", run = "yank", desc = "Copy the selected characters" },
#{ on = "p", run = "paste", desc = "Paste the copied characters after the cursor" },
{ on = "P", run = "paste --before", desc = "Paste the copied characters before the cursor" },
# Undo/Redo
{ on = "u", run = "undo", desc = "Undo the last operation" },
{ on = "<C-r>", run = "redo", desc = "Redo the last operation" },
# Help
{ on = "~", run = "help", desc = "Open help" },
{ on = "<F1>", run = "help", desc = "Open help" },
]
[confirm]
keymap = [
{ on = "<Esc>", run = "close", desc = "Cancel the confirm" },
{ on = "<C-[>", run = "close", desc = "Cancel the confirm" },
{ on = "<C-c>", run = "close", desc = "Cancel the confirm" },
{ on = "<Enter>", run = "close --submit", desc = "Submit the confirm" },
{ on = "n", run = "close", desc = "Cancel the confirm" },
{ on = "y", run = "close --submit", desc = "Submit the confirm" },
{ on = "k", run = "arrow -1", desc = "Move cursor up" },
{ on = "j", run = "arrow 1", desc = "Move cursor down" },
{ on = "<Up>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<Down>", run = "arrow 1", desc = "Move cursor down" },
# Help
{ on = "~", run = "help", desc = "Open help" },
{ on = "<F1>", run = "help", desc = "Open help" },
]
[completion]
keymap = [
{ on = "<C-c>", run = "close", desc = "Cancel completion" },
{ on = "<Tab>", run = "close --submit", desc = "Submit the completion" },
{ on = "<Enter>", run = [ "close --submit", "close_input --submit", ], desc = "Submit the completion and input" },
{ on = "<A-k>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<A-j>", run = "arrow 1", desc = "Move cursor down" },
{ on = "<Up>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<Down>", run = "arrow 1", desc = "Move cursor down" },
{ on = "<C-p>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<C-n>", run = "arrow 1", desc = "Move cursor down" },
# Help
{ on = "~", run = "help", desc = "Open help" },
{ on = "<F1>", run = "help", desc = "Open help" },
]
[help]
keymap = [
{ on = "<Esc>", run = "escape", desc = "Clear the filter, or hide the help" },
{ on = "<C-[>", run = "escape", desc = "Clear the filter, or hide the help" },
{ on = "<C-c>", run = "close", desc = "Hide the help" },
# Navigation
{ on = "k", run = "arrow -1", desc = "Move cursor up" },
{ on = "j", run = "arrow 1", desc = "Move cursor down" },
{ on = "<Up>", run = "arrow -1", desc = "Move cursor up" },
{ on = "<Down>", run = "arrow 1", desc = "Move cursor down" },
# Filtering
{ on = "f", run = "filter", desc = "Apply a filter for the help items" },
]

34
config/yazi/package.toml Normal file
View File

@@ -0,0 +1,34 @@
[[plugin.deps]]
use = "yazi-rs/plugins:smart-enter"
rev = "beb586a"
hash = "aef2b1a805b80cce573bb766f1459d88"
[[plugin.deps]]
use = "KKV9/compress"
rev = "60b24af"
hash = "ee025be766240cc98e671754ac836da3"
[[plugin.deps]]
use = "pirafrank/what-size"
rev = "b23e3a4"
hash = "98e5f5af3efd3ba8bc2db0720187cc83"
[[plugin.deps]]
use = "imsi32/yatline"
rev = "9328205"
hash = "3e51d1fd8a2e481fcfa8eab1251d1c5f"
[[plugin.deps]]
use = "yazi-rs/plugins:full-border"
rev = "beb586a"
hash = "ae9e1d0c6bfd68cdebc98cc684c22b45"
[[plugin.deps]]
use = "yazi-rs/plugins:mount"
rev = "beb586a"
hash = "5c4d8080367dd2561a18c1cf5a1dd295"
[[flavor.deps]]
use = "bennyyip/gruvbox-dark"
rev = "b4cc9f2"
hash = "f44c42bcbed3c8564100e45e2fe3649a"

View File

@@ -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.

View File

@@ -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.

View File

@@ -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,
}

Submodule config/yazi/plugins/fg.yazi added at 2cb5b49c34

View File

@@ -0,0 +1,12 @@
local function setup()
ps.sub("cd", function()
local cwd = cx.active.current.cwd
if cwd:ends_with("Загрузки") then
ya.manager_emit("sort", { "mtime", reverse = true, dir_first = false })
else
ya.manager_emit("sort", { "alphabetical", reverse = false, dir_first = true })
end
end)
end
return { setup = setup }

View File

@@ -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.

View File

@@ -0,0 +1,32 @@
# full-border.yazi
Add a full border to Yazi to make it look fancier.
![full-border](https://github.com/yazi-rs/plugins/assets/17523360/ef81b560-2465-4d36-abf2-5d21dcb7b987)
## Installation
```sh
ya pack -a yazi-rs/plugins:full-border
```
## Usage
Add this to your `init.lua` to enable the plugin:
```lua
require("full-border"):setup()
```
Or you can customize the border type:
```lua
require("full-border"):setup {
-- Available values: ui.Border.PLAIN, ui.Border.ROUNDED
type = ui.Border.ROUNDED,
}
```
## License
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.

View File

@@ -0,0 +1,36 @@
--- @since 25.2.7
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)),
}
old_build(self, ...)
end
end
return { setup = setup }

View File

@@ -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.

View File

@@ -0,0 +1,51 @@
# mount.yazi
> [!NOTE]
> Yazi v25.2.7 or later is required for this plugin to work.
A mount manager for Yazi, providing disk mount, unmount, and eject functionality.
Supported platforms:
- Linux with [`udisksctl`](https://github.com/storaged-project/udisks) and [`lsblk`](https://github.com/util-linux/util-linux)
- macOS with `diskutil`
https://github.com/user-attachments/assets/c6f780ab-458b-420f-85cf-2fc45fcfe3a2
## Installation
```sh
ya pack -a yazi-rs/plugins:mount
```
## Usage
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
on = "M"
run = "plugin mount"
```
Available keybindings:
| Key binding | Alternate key | Action |
| ------------ | ------------- | --------------------- |
| <kbd>q</kbd> | - | Quit the plugin |
| <kbd>k</kbd> | <kbd>↑</kbd> | Move up |
| <kbd>j</kbd> | <kbd>↓</kbd> | Move down |
| <kbd>l</kbd> | <kbd>→</kbd> | Enter the mount point |
| <kbd>m</kbd> | - | Mount the partition |
| <kbd>u</kbd> | - | Unmount the partition |
| <kbd>e</kbd> | - | Eject the disk |
## TODO
- Custom keybindings
- Windows support (I don't have an Windows machine for testing, PRs welcome!)
- Support mount, unmount, and eject the entire disk
## License
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.

View File

@@ -0,0 +1,285 @@
--- @since 25.2.7
local toggle_ui = ya.sync(function(self)
if self.children then
Modal:children_remove(self.children)
self.children = nil
else
self.children = Modal:children_add(self, 10)
end
ya.render()
end)
local subscribe = ya.sync(function(self)
ps.unsub("mount")
ps.sub("mount", function() ya.manager_emit("plugin", { self._id, "refresh" }) end)
end)
local update_partitions = ya.sync(function(self, partitions)
self.partitions = partitions
self.cursor = math.max(0, math.min(self.cursor or 0, #self.partitions - 1))
ya.render()
end)
local active_partition = ya.sync(function(self) return self.partitions[self.cursor + 1] end)
local update_cursor = ya.sync(function(self, cursor)
if #self.partitions == 0 then
self.cursor = 0
else
self.cursor = ya.clamp(0, self.cursor + cursor, #self.partitions - 1)
end
ya.render()
end)
local M = {
keys = {
{ on = "q", run = "quit" },
{ on = "k", run = "up" },
{ on = "j", run = "down" },
{ on = "l", run = { "enter", "quit" } },
{ on = "<Up>", run = "up" },
{ on = "<Down>", run = "down" },
{ on = "<Right>", run = { "enter", "quit" } },
{ on = "m", run = "mount" },
{ on = "u", run = "unmount" },
{ on = "e", run = "eject" },
},
}
function M:new(area)
self:layout(area)
return self
end
function M:layout(area)
local chunks = ui.Layout()
:constraints({
ui.Constraint.Percentage(10),
ui.Constraint.Percentage(80),
ui.Constraint.Percentage(10),
})
:split(area)
local chunks = ui.Layout()
:direction(ui.Layout.HORIZONTAL)
:constraints({
ui.Constraint.Percentage(10),
ui.Constraint.Percentage(80),
ui.Constraint.Percentage(10),
})
:split(chunks[2])
self._area = chunks[2]
end
function M:entry(job)
if job.args[1] == "refresh" then
return update_partitions(self.obtain())
end
toggle_ui()
update_partitions(self.obtain())
subscribe()
local tx1, rx1 = ya.chan("mpsc")
local tx2, rx2 = ya.chan("mpsc")
function producer()
while true do
local cand = self.keys[ya.which { cands = self.keys, silent = true }] or { run = {} }
for _, r in ipairs(type(cand.run) == "table" and cand.run or { cand.run }) do
tx1:send(r)
if r == "quit" then
toggle_ui()
return
end
end
end
end
function consumer1()
repeat
local run = rx1:recv()
if run == "quit" then
tx2:send(run)
break
elseif run == "up" then
update_cursor(-1)
elseif run == "down" then
update_cursor(1)
elseif run == "enter" then
local active = active_partition()
if active and active.dist then
ya.manager_emit("cd", { active.dist })
end
else
tx2:send(run)
end
until not run
end
function consumer2()
repeat
local run = rx2:recv()
if run == "quit" then
break
elseif run == "mount" then
self.operate("mount")
elseif run == "unmount" then
self.operate("unmount")
elseif run == "eject" then
self.operate("eject")
end
until not run
end
ya.join(producer, consumer1, consumer2)
end
function M:reflow() return { self } end
function M:redraw()
local rows = {}
for _, p in ipairs(self.partitions or {}) do
if not p.sub then
rows[#rows + 1] = ui.Row { p.main }
elseif p.sub == "" then
rows[#rows + 1] = ui.Row { p.main, p.label or "", p.dist or "", p.fstype or "" }
else
rows[#rows + 1] = ui.Row { " " .. p.sub, p.label or "", p.dist or "", p.fstype or "" }
end
end
return {
ui.Clear(self._area),
ui.Border(ui.Border.ALL)
:area(self._area)
:type(ui.Border.ROUNDED)
:style(ui.Style():fg("blue"))
:title(ui.Line("Mount"):align(ui.Line.CENTER)),
ui.Table(rows)
:area(self._area:pad(ui.Pad(1, 2, 1, 2)))
:header(ui.Row({ "Src", "Label", "Dist", "FSType" }):style(ui.Style():bold()))
:row(self.cursor)
:row_style(ui.Style():fg("blue"):underline())
:widths {
ui.Constraint.Length(20),
ui.Constraint.Length(20),
ui.Constraint.Percentage(70),
ui.Constraint.Length(10),
},
}
end
function M.obtain()
local tbl = {}
local last
for _, p in ipairs(fs.partitions()) do
local main, sub = M.split(p.src)
if main and last ~= main then
if p.src == main then
last, p.main, p.sub, tbl[#tbl + 1] = p.src, p.src, "", p
else
last, tbl[#tbl + 1] = main, { src = main, main = main, sub = "" }
end
end
if sub then
if tbl[#tbl].sub == "" and tbl[#tbl].main == main then
tbl[#tbl].sub = nil
end
p.main, p.sub, tbl[#tbl + 1] = main, sub, p
end
end
table.sort(M.fillin(tbl), function(a, b)
if a.main == b.main then
return (a.sub or "") < (b.sub or "")
else
return a.main > b.main
end
end)
return tbl
end
function M.split(src)
local pats = {
{ "^/dev/sd[a-z]", "%d+$" }, -- /dev/sda1
{ "^/dev/nvme%d+n%d+", "p%d+$" }, -- /dev/nvme0n1p1
{ "^/dev/mmcblk%d+", "p%d+$" }, -- /dev/mmcblk0p1
{ "^/dev/disk%d+", ".+$" }, -- /dev/disk1s1
}
for _, p in ipairs(pats) do
local main = src:match(p[1])
if main then
return main, src:sub(#main + 1):match(p[2])
end
end
end
function M.fillin(tbl)
if ya.target_os() ~= "linux" then
return tbl
end
local sources, indices = {}, {}
for i, p in ipairs(tbl) do
if p.sub and not p.fstype then
sources[#sources + 1], indices[p.src] = p.src, i
end
end
if #sources == 0 then
return tbl
end
local output, err = Command("lsblk"):args({ "-p", "-o", "name,fstype", "-J" }):args(sources):output()
if err then
ya.dbg("Failed to fetch filesystem types for unmounted partitions: " .. err)
return tbl
end
local t = ya.json_decode(output and output.stdout or "")
for _, p in ipairs(t and t.blockdevices or {}) do
tbl[indices[p.name]].fstype = p.fstype
end
return tbl
end
function M.operate(type)
local active = active_partition()
if not active then
return
elseif not active.sub then
return -- TODO: mount/unmount main disk
end
local output, err
if ya.target_os() == "macos" then
output, err = Command("diskutil"):args({ type, active.src }):output()
end
if ya.target_os() == "linux" then
if type == "eject" then
Command("udisksctl"):args({ "unmount", "-b", active.src }):status()
output, err = Command("udisksctl"):args({ "power-off", "-b", active.src }):output()
else
output, err = Command("udisksctl"):args({ type, "-b", active.src }):output()
end
end
if not output then
M.fail("Failed to %s `%s`: %s", type, active.src, err)
elseif not output.status.success then
M.fail("Failed to %s `%s`: %s", type, active.src, output.stderr)
end
end
function M.fail(s, ...) ya.notify { title = "Mount", content = string.format(s, ...), timeout = 10, level = "error" } end
function M:click() end
function M:scroll() end
function M:touch() end
return M

Submodule config/yazi/plugins/ouch.yazi added at 2496cd9ac2

View File

@@ -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.

View File

@@ -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 <kbd>l</kbd> 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

View File

@@ -0,0 +1,11 @@
--- @since 25.2.26
--- @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.mgr_emit(h and h.cha.is_dir and "enter" or "open", { hovered = not self.open_multi })
end
return { entry = entry, setup = setup }

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 Francesco Pira
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,44 @@
# what-size.yazi
A plugin for [yazi](https://github.com/sxyazi/yazi) to calculate the size of the current selection or the current working directory (if no selection is made).
## Compatibility
- yazi `0.4.x` since commit `2780de5aeef1ed16d1973dd6e0cd4d630c900d56` ([link](https://github.com/pirafrank/what-size.yazi/commit/2780de5aeef1ed16d1973dd6e0cd4d630c900d56)).
- yazi `0.3.x` up to commit `f08f7f2d5c94958ac4cb66c51a7c24b4319c6c93` ([link](https://github.com/pirafrank/what-size.yazi/commit/f08f7f2d5c94958ac4cb66c51a7c24b4319c6c93)).
## Requirements
- `du` on Linux. macOS and Windows support is planned.
## Installation
```sh
ya pack -a 'pirafrank/what-size'
```
## Usage
Add this to your `~/.config/yazi/keymap.toml`:
```toml
[manager]
prepend_keymap = [
{ on = [ ".", "s" ], run = "plugin what-size", desc = "Calc size of selection or cwd" },
]
```
If you want to copy the result to clipboard, you can add `--clipboard` or `-c` as first argument:
```toml
[manager]
prepend_keymap = [
{ on = [ ".", "s" ], run = "plugin what-size --args='--clipboard'", desc = "Calc size of selection or cwd" },
]
```
Change to whatever keybinding you like.
## License
MIT

View File

@@ -0,0 +1,75 @@
-- function to get paths of selected elements or current directory
-- of no elements are selected
local get_paths = ya.sync(function()
local paths = {}
-- get selected files
for _, u in pairs(cx.active.selected) do
paths[#paths + 1] = tostring(u)
end
-- if no files are selected, get current directory
if #paths == 0 then
if cx.active.current.cwd then
paths[1] = tostring(cx.active.current.cwd)
else
ya.err("what-size would return nil paths")
end
end
return paths
end)
-- Function to get total size from du output
local get_total_size = function(s)
local lines = {}
for line in s:gmatch("[^\n]+") do
lines[#lines + 1] = line
end
local last_line = lines[#lines]
local last_line_parts = {}
for part in last_line:gmatch("%S+") do
last_line_parts[#last_line_parts + 1] = part
end
local total_size = last_line_parts[1]
return total_size
end
-- Function to format file size
local function format_size(size)
local units = { "B", "KB", "MB", "GB", "TB" }
local unit_index = 1
while size > 1024 and unit_index < #units do
size = size / 1024
unit_index = unit_index + 1
end
return string.format("%.2f %s", size, units[unit_index])
end
return {
entry = function(self, job)
-- defaults not to use clipboard, use it only if required by the user
local clipboard = job.args.clipboard or job.args[1] == "-c"
local items = get_paths()
local cmd = "du"
local output, err = Command(cmd):arg("-scb"):args(items):output()
if not output then
ya.err("Failed to run diff, error: " .. err)
else
local total_size = get_total_size(output.stdout)
local formatted_size = format_size(tonumber(total_size))
local notification_content = "Total size: " .. formatted_size
if clipboard then
ya.clipboard(formatted_size)
notification_content = notification_content .. "\nCopied to clipboard."
end
ya.notify({
title = "Размер ",
content = notification_content,
timeout = 5,
})
end
end,
}

Submodule config/yazi/plugins/yatline-gruvbox-material.yazi added at 05ab2e308f

View File

@@ -0,0 +1,23 @@
MIT License
Copyright (c) 2024 imsi32
Copyright (c) 2023 - sxyazi
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.

View File

@@ -0,0 +1,19 @@
# yatline.yazi
The first Yazi plugin for customizing both header-line and status-line.
![yatline](https://github.com/user-attachments/assets/61013ec8-7fd9-42df-a9f4-f254663871fe)
> [!NOTE]
> Check out [wiki](https://github.com/imsi32/yatline.yazi/wiki) for installation steps, configuration and further information.
## Features
- Lualine-like Design
- Flexible
- Simple
- Automatic Configuration
- Themes (See: [yatline-themes](https://github.com/imsi32/yatline-themes))
- Add-ons (See: [yatline-addons](https://github.com/imsi32/yatline-addons))
## Credits
- [Lualine](https://github.com/nvim-lualine/lualine.nvim)
- [Yazi](https://github.com/sxyazi/yazi)

File diff suppressed because it is too large Load Diff

364
config/yazi/theme.toml Normal file
View File

@@ -0,0 +1,364 @@
# vim:fileencoding=utf-8:foldmethod=marker
# : Manager {{{
[manager]
cwd = { fg = "#83a598" }
# Hovered
hovered = { fg = "#282828", bg = "#83a598" }
#preview_hovered = { underline = false }
preview_hovered = { fg = "#282828", bg = "#83a598" }
# Find
find_keyword = { fg = "#b8bb26", italic = true }
find_position = { fg = "#fe8019", bg = "reset", italic = true }
# Marker
marker_selected = { fg = "#b8bb26", bg = "#b8bb26" }
marker_copied = { fg = "#fabd2f", bg = "#fabd2f" }
marker_cut = { fg = "#fb4934", bg = "#fb4934" }
marker_marked = { fg = "#282828", bg = "#83a598" }
# Tab
tab_active = { fg = "#a89984", bg = "#504945" }
tab_inactive = { fg = "#282828", bg = "#3c3836" }
tab_width = 1
# Count
count_copied = { fg = "black", bg = "lightgreen" }
count_cut = { fg = "black", bg = "lightred" }
count_selected = { fg = "black", bg = "lightblue" }
# Border
border_symbol = " "
border_style = { fg = "#83a598" }
# Highlighting
syntect_theme = "~/.config/yazi/Gruvbox-Dark.tmTheme"
# : }}}
# : Status {{{
[status]
overall = { fg = "#cad3f5", bg = "#181926" }
separator_open = ""
separator_close = ""
separator_style = { fg = "#3c3836", bg = "#3c3836" }
#sep_left = { open = "", close = "" }
#sep_right = { open = "", close = "" }
# Progress
progress_label = { fg = "#ebdbb2", bold = true }
progress_normal = { fg = "#504945", bg = "#3c3836" }
progress_error = { fg = "#fb4934", bg = "#3c3836" }
# Permissions
permissions_t = { fg = "#504945" }
permissions_r = { fg = "#b8bb26" }
permissions_w = { fg = "#fb4934" }
permissions_x = { fg = "#b8bb26" }
permissions_s = { fg = "#665c54" }
# : }}}
# : mode {{{
[mode]
normal_main = { fg = "#282828", bg = "#A89984", bold = true }
normal_alt = { fg = "#282828", bg = "#458588", bold = true }
select_main = { fg = "#282828", bg = "#fe8019", bold = true }
select_alt = { fg = "#282828", bg = "#458588", bold = true }
unset_main = { fg = "#282828", bg = "#d3869b", bold = true }
unset_alt = { fg = "#282828", bg = "#458588", bold = true }
# : }}}
# : Input {{{
[input]
border = { fg = "#83a598" }
title = {}
value = {}
selected = { reversed = true }
# : }}}
# : Select {{{
[select]
border = { fg = "#504945" }
active = { fg = "#fe8019" }
inactive = {}
# : }}}
# : Tasks {{{
[tasks]
border = { fg = "#504945" }
title = {}
hovered = { underline = true }
# : }}}
# : Which {{{
[which]
mask = { bg = "#3c3836" }
cand = { fg = "#83a598" }
rest = { fg = "#928374" }
desc = { fg = "#fe8019" }
separator = "  "
separator_style = { fg = "#504945" }
# : }}}
# : Help {{{
[help]
on = { fg = "#fe8019" }
exec = { fg = "#83a598" }
desc = { fg = "#928374" }
hovered = { bg = "#504945", bold = true }
footer = { fg = "#3c3836", bg = "#a89984" }
# : }}}
# Icons
icon_info = ""
icon_warn = ""
icon_error = ""
# : File-specific styles {{{
[filetype]
rules = [
# Images
{ mime = "image/*", text = "", fg = "#d79921" },
# { name = "*.HEIC", text = "", fg = "#d79921" },
# { name = "*.avif", text = "", fg = "#d79921" },
# { name = "*.bmp" , text = "", fg = "#d79921" },
# { name = "*.gif" , text = "", fg = "#d79921" },
# { name = "*.ico" , text = "", fg = "#cbcb41" },
# { name = "*.jpeg", text = "", fg = "#d79921" },
# { name = "*.jpg" , text = "", fg = "#d79921" },
# { name = "*.png" , text = "", fg = "#d79921" },
# { name = "*.svg" , text = "", fg = "#d79921" },
# { name = "*.webp", text = "", fg = "#d79921" },
# Videos
{ mime = "video/*", text = "", fg = "#b16286" },
# { name = "*.avi", text = "", fg = "#b16286" },
# { mime = "video/msvideo", text = "", fg = "#fe8019" },
# { name = "*.mkv" , text = "", fg = "#FD971F" },
# { name = "*.mov" , text = "", fg = "#FD971F" },
# { name = "*.mp4" , text = "", fg = "#FD971F" },
# { name = "*.webm", text = "", fg = "#FD971F" },
# Audio
{ mime = "audio/*", text = "", fg = "#b8bb26" },
#{ name = "*.aac" , text = "", fg = "#66D8EF" },
# { name = "*.flac", text = "", fg = "#66D8EF" },
# { name = "*.m4a" , text = "", fg = "#66D8EF" },
# { name = "*.mp3" , text = "", fg = "#66D8EF" },
# { name = "*.ogg" , text = "", fg = "#66D8EF" },
# { name = "*.wav" , text = "", fg = "#66D8EF" },
# Documents
{ name = "*.csv" , text = "", fg = "#89e051" },
{ name = "*.doc" , text = "", fg = "#458588" },
{ name = "*.doct", text = "", fg = "#185abd" },
{ name = "*.docx", text = "", fg = "#458588" },
{ name = "*.dot" , text = "", fg = "#185abd" },
{ name = "*.ods" , text = "", fg = "#207245" },
{ name = "*.ots" , text = "", fg = "#207245" },
{ name = "*.pdf" , text = "", fg = "#fb4934" },
{ name = "*.pom" , text = "", fg = "#cc3e44" },
{ name = "*.pot" , text = "", fg = "#cb4a32" },
{ name = "*.potx", text = "", fg = "#cb4a32" },
{ name = "*.ppm" , text = "", fg = "#a074c4" },
{ name = "*.ppmx", text = "", fg = "#cb4a32" },
{ name = "*.pps" , text = "", fg = "#cb4a32" },
{ name = "*.ppsx", text = "", fg = "#cb4a32" },
{ name = "*.ppt" , text = "", fg = "#cb4a32" },
{ name = "*.pptx", text = "", fg = "#cb4a32" },
{ name = "*.xlc" , text = "", fg = "#207245" },
{ name = "*.xlm" , text = "", fg = "#207245" },
{ name = "*.xls" , text = "", fg = "#207245" },
{ name = "*.xlsm", text = "", fg = "#207245" },
{ name = "*.xlsx", text = "", fg = "#b57614" },
{ name = "*.xlt" , text = "", fg = "#207245" },
# Archives
# { mime = "application/zip", fg = "#fe8019" },
# { mime = "application/gzip", fg = "#fe8019" },
# { mime = "application/x-tar", fg = "#fe8019" },
# { mime = "application/x-bzip", fg = "#fe8019" },
# { mime = "application/bzip2", fg = "#fe8019" },
# { mime = "application/x-bzip2", fg = "#fe8019" },
# { mime = "application/x-7z-compressed", fg = "#fe8019" },
# { mime = "application/x-rar", fg = "#fe8019" },
# { mime = "application/rar", fg = "#fe8019" },
# { mime = "application/xz", fg = "#fe8019" },
{ name = "*.7z", text = "", fg = "#fe8019" },
{ name = "*.bz2", text = "", fg = "#fe8019" },
{ name = "*.gz" , text = "", fg = "#fe8019" },
{ name = "*.rar", text = "", fg = "#fe8019" },
{ name = "*.tar", text = "", fg = "#fe8019" },
{ name = "*.xz" , text = "", fg = "#fe8019" },
{ name = "*.zip", text = "", fg = "#fe8019" },
{ name = "*.gzip", text = "", fg = "#fe8019" },
# Fallback
# { name = "*", fg = "#a89984" },
{ name = "*/", fg = "#83a598" },
# Programming
{ name = "*.c" , text = "", fg = "#98971a" },
{ name = "*.cpp" , text = "", fg = "#98971a" },
{ name = "*.class", text = "", fg = "#98971a" },
{ name = "*.cs" , text = "󰌛", fg = "#98971a" },
{ name = "*.css" , text = "", fg = "#98971a" },
{ name = "*.elm" , text = "", fg = "#98971a" },
{ name = "*.fish" , text = "", fg = "#98971a" },
{ name = "*.go" , text = "", fg = "#98971a" },
{ name = "*.h" , text = "", fg = "#98971a" },
{ name = "*.hpp" , text = "", fg = "#98971a" },
{ name = "*.html" , text = "", fg = "#98971a" },
{ name = "*.jar" , text = "", fg = "#98971a" },
{ name = "*.java" , text = "", fg = "#98971a" },
{ name = "*.js" , text = "", fg = "#98971a" },
{ name = "*.jsx" , text = "", fg = "#98971a" },
{ name = "*.lua" , text = "", fg = "#98971a" },
{ name = "*.nix" , text = "", fg = "#98971a" },
{ name = "*.nu" , text = ">", fg = "#98971a" },
{ name = "*.php" , text = "", fg = "#98971a" },
{ name = "*.py" , text = "", fg = "#98971a" },
{ name = "*.rb" , text = "", fg = "#98971a" },
{ name = "*.rs" , text = "", fg = "#98971a" },
{ name = "*.sbt" , text = "", fg = "#98971a" },
{ name = "*.scala", text = "", fg = "#98971a" },
{ name = "*.scss" , text = "", fg = "#98971a" },
{ name = "*.sh" , text = "", fg = "#98971a" },
{ name = "*.swift", text = "", fg = "#98971a" },
{ name = "*.ts" , text = "", fg = "#98971a" },
{ name = "*.tsx" , text = "", fg = "#98971a" },
{ name = "*.vim" , text = "", fg = "#98971a" },
{ name = "*.vue" , text = "󰡄", fg = "#98971a" },
# Text
{ name = "*.conf", text = "", fg = "#a89984" },
{ name = "*.ini" , text = "", fg = "#a89984" },
{ name = "*.json", text = "", fg = "#a89984" },
{ name = "*.kdl" , text = "", fg = "#a89984" },
{ name = "*.md" , text = "", fg = "#a89984" },
{ name = "*.toml", text = "", fg = "#a89984" },
{ name = "*.txt" , text = "", fg = "#a89984" },
{ name = "*.yaml", text = "", fg = "#a89984" },
{ name = "*.yml" , text = "", fg = "#a89984" },
{ name = "*.theme" , text = "", fg = "#076678" },
# Misc
{ name = "*.bin", text = "", fg = "#427b58" },
{ name = "*.exe", text = "", fg = "#427b58" },
{ name = "*.pkg", text = "", fg = "#427b58" },
# Dotfiles
# { name = ".DS_Store" , text = "", fg = "#41535b" },
#{ name = ".bashprofile" , text = "", fg = "#89e051" },
#{ name = ".bashrc" , text = "", fg = "#89e051" },
#{ name = ".gitattributes", text = "", fg = "#41535b" },
#{ name = ".gitignore" , text = "", fg = "#41535b" },
#{ name = ".gitmodules" , text = "", fg = "#41535b" },
#{ name = ".vimrc" , text = "", fg = "#019833" },
#{ name = ".zprofile" , text = "", fg = "#89e051" },
#{ name = ".zshenv" , text = "", fg = "#89e051" },
#{ name = ".zshrc" , text = "", fg = "#89e051" },
# Named files
{ name = "COPYING" , text = "󰿃", fg = "#cbcb41" },
{ name = "Containerfile", text = "󰡨", fg = "#458ee6" },
{ name = "Dockerfile" , text = "󰡨", fg = "#458ee6" },
{ name = "LICENSE" , text = "󰿃", fg = "#d0bf41" },
# Directories
# { name = ".config/" , text = "" },
# { name = ".git/" , text = "" },
# { name = "Desktop/" , text = "" },
# { name = "Development/", text = "" },
# { name = "Documents/" , text = "" },
# { name = "Downloads/" , text = "" },
# { name = "Library/" , text = "" },
# { name = "Movies/" , text = "" },
# { name = "Music/" , text = "" },
# { name = "Pictures/" , text = "" },
# { name = "Public/" , text = "" },
# { name = "Videos/" , text = "" },
]
[icon]
globs = []
dirs = [
{ name = ".config", text = "" },
{ name = ".git", text = "" },
{ name = "Рабочий стол", text = "" },
{ name = "Development", text = "" },
{ name = "Документы", text = "" },
{ name = "Загрузки", text = "" },
{ name = "Seafile", text = "󰅟" },
{ name = "ownCloud", text = "󰅟" },
{ name = "Telegram Desktop", text = "" },
{ name = "Фильмы", text = "" },
{ name = "Музыка", text = "" },
{ name = "Изображения", text = "" },
{ name = "Public", text = "" },
{ name = "Видео", text = "" },
{ name = "FOTO", text = "󰄄" },
{ name = "build", text = "󰖷" },
{ name = "Dropbox", text = "" },
{ name = "iso", text = "" },
{ name = "MEGA", text = "󱇱" },
{ name = "Камера", text = "󰄀" },
{ name = "Скриншоты", text = "󰹑" },
{ name = "Шаблоны", text = "󰛪" },
{ name = "VirtualBox VMs", text = "󰨇" },
{ name = "go", text = "" },
]
conds = [
# Special files
{ if = "orphan", text = "" },
{ if = "link", text = "" },
{ if = "block", text = "" },
{ if = "char", text = "" },
{ if = "fifo", text = "" },
{ if = "sock", text = "" },
{ if = "sticky", text = "" },
{ if = "dummy", text = "" },
# Fallback
{ if = "dir", text = "󰉋" },
{ if = "exec", text = "" },
{ if = "!dir", text = "󰈔" },
]
# : }}}

284
config/yazi/yazi.toml Normal file
View File

@@ -0,0 +1,284 @@
# 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 = [0, 4, 3]
sort_by = "natural"
sort_sensitive = false
sort_reverse = false
sort_dir_first = true
sort_translit = false
linemode = "size"
show_hidden = false
show_symlink = false
scrolloff = 5
mouse_events = ["scroll"]
title_format = ""
[preview]
wrap = "no"
tab_size = 2
max_width = 600
max_height = 900
#cache_dir = "~/.cache/yazi/"
image_delay = 10
image_filter = "lanczos3"
image_quality = 75
sixel_fraction = 15
ueberzug_scale = 1
ueberzug_offset = [0, 0, 0, 0]
[opener]
edit = [
{ run = 'nvim "$@"', block = true, for = "unix" },
]
open = [
# { run = 'xdg-open "$@"', orphan = true, desc = "Open", for = "linux" },
{ run = 'xdg-open "$@"', desc = "Open", for = "linux" },
# { run = 'gimp "$1"', desc = "Gimp", for = "linux" },
# { run = 'mpv-single "$1"', desc = "Play MPV", for = "linux" },
]
reveal = [
# { run = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show EXIF", for = "unix" },
# { run = 'nvim "$@"', block = true, for = "unix" },
{ run = '''exiftool "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" },
]
extract = [
# { run = 'unrar e "$1"', desc = "Unrar Extract here", for = "unix" },
# { run = 'unzip "$1"', desc = "Unzip Extract here", for = "unix" },
# { run = 'ya pub extract --list "$@"', desc = "Extract here", for = "unix" },
{ run = 'atool --extract --each "$1"', desc = "Atool Extract here", for = "unix" },
{ run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" },
]
play = [
{ run = 'mpv-single "$@"', desc = "Play MPV (single)", orphan = true, for = "unix" },
{ run = 'mpv "$@"', desc = "Play MPV", orphan = true, for = "unix" },
#{ run = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show media info", for = "unix" },
{ run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" },
]
# Открытие в файлов в GIMP
imgedit = [
{ run = 'gimp "$@"', desc = "Gimp", orphan = true, for = "unix" },
]
#extrar = [
# { run = 'unrar e "$@"', desc = "Extract RAR", for = "unix" },
#]
plaympvs = [
{ run = 'mpv-single "$@"', desc = "Mpv-single", for = "unix" },
]
plaympv = [
{ run = 'mpv "$@"', desc = "Mpv", for = "unix" },
]
editaudio = [
{ run = 'QT_FONT_DPI=140 ocenaudio "$@"', desc = "Ocenaudio", for = "unix" },
]
#tarxf = [
# { run = 'tar xf "$@"', desc = "tar -xf", for = "unix" },
#]
#unrar = [
# { run = 'unrar x "$@"', desc = "unrar", for = "unix" },
#]
[open]
rules = [
# { name = "*/", use = [ "edit", "open", "plaympv", "reveal" ] },
{ name = "*/", use = ["edit", "plaympvs", "plaympv"] },
# { mime = "inode/directory", use = [ "plaympvs", "open", "reveal" ] },
{ name = "*.html", use = ["open", "edit"] },
{ mime = "text/*", use = ["edit", "reveal"] },
{ mime = "image/*", use = ["open", "imgedit", "reveal"] },
{ mime = "video/*", use = ["play", "reveal"] },
{ mime = "audio/*", use = ["play", "editaudio"] },
{ mime = "inode/x-empty", use = ["edit", "reveal"] },
{ mime = "application/json", use = ["edit", "reveal"] },
{ mime = "*/javascript", use = ["edit", "reveal"] },
{ mime = "message/rfc822", use = ["open", "edit", "reveal"] },
{ mime = "*", use = ["open", "edit", "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", prio = "high" },
]
spotters = [
{ name = "*/", run = "folder" },
# Code
{ mime = "text/*", run = "edit" },
{ mime = "application/{mbox,javascript,wine-extension-ini}", run = "code" },
# Image
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
{ mime = "image/*", run = "image" },
# Video
{ mime = "video/*", run = "video" },
# Fallback
{ name = "*", run = "file" },
]
preloaders = [
# Image
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
{ mime = "image/*", run = "image" },
# Video
{ mime = "video/*", run = "video" },
# PDF
{ mime = "application/pdf", run = "pdf" },
# Font
{ mime = "font/*", run = "font" },
{ mime = "application/ms-opentype", run = "font" },
]
previewers = [
{ name = "*/", run = "folder", sync = true },
# Code
{ mime = "text/*", run = "code" },
{ mime = "application/{mbox,javascript,wine-extension-ini}", run = "code" },
# JSON
{ mime = "application/{json,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/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", run = "archive" },
{ 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" },
{ mime = "application/xz", run = "ouch" },
{ mime = "application/{debian*-package,redhat-package-manager,rpm,android.package-archive}", run = "archive" },
{ name = "*.{AppImage,appimage}", run = "archive" },
# Virtual Disk / Disk Image
{ mime = "application/{iso9660-image,qemu-disk,ms-wim,apple-diskimage}", run = "archive" },
{ mime = "application/virtualbox-{vhd,vhdx}", run = "archive" },
{ name = "*.{img,fat,ext,ext2,ext3,ext4,squashfs,ntfs,hfs,hfsx}", run = "archive" },
# Font
{ mime = "font/*", run = "font" },
{ mime = "application/ms-opentype", run = "font" },
# Empty file
{ mime = "inode/empty", run = "empty" },
# Fallback
{ name = "*", run = "file" },
]
#[[commands]]
#name = "Open in GIMP"
#match = "\\.(jpg|jpeg|png|bmp|gif|tiff|webp|xcf)$"
#run = "gimp '$1'"
#[[commands]]
#name = "Play in MPV"
#match = "\\.(mp4|mkv|avi|mov|webm|flv)$"
#run = "mpv-single '$1'"
#[[directories]]
#path = "/home/crud/Загрузки"
#sort_by = "modified"
#sort_order = "desc"
[input]
cursor_blink = false
# cd
cd_title = "Change directory:"
cd_origin = "top-center"
cd_offset = [0, 2, 50, 3]
# create
#create_title = "Create:", "Create (dir):"
create_title = ["Create:", "Create (dir):"]
create_origin = "top-center"
create_offset = [0, 2, 50, 3]
# rename
rename_title = "Rename:"
rename_origin = "hovered"
rename_offset = [0, 1, 50, 3]
# filter
filter_title = "Filter:"
filter_origin = "top-center"
filter_offset = [0, 2, 50, 3]
# find
find_title = ["Find next:", "Find previous:"]
find_origin = "top-center"
find_offset = [0, 2, 50, 3]
# search
search_title = "Search via {n}:"
search_origin = "top-center"
search_offset = [0, 2, 50, 3]
# shell
shell_title = ["Shell:", "Shell (block):"]
shell_origin = "top-center"
shell_offset = [0, 2, 50, 3]
[confirm]
# trash
trash_title = "Trash {n} selected file{s}?"
trash_origin = "center"
trash_offset = [0, 2, 50, 3]
# delete
delete_title = "Permanently delete {n} selected file{s}?"
delete_origin = "center"
delete_offset = [ 0, 0, 70, 20 ]
# overwrite
overwrite_title = "Overwrite file?"
overwrite_content = "Will overwrite the following file:"
overwrite_origin = "center"
overwrite_offset = [ 0, 0, 50, 15 ]
# quit
quit_title = "Quit?"
quit_content = "The following tasks are still running, are you sure you want to quit?"
quit_origin = "center"
quit_offset = [ 0, 0, 50, 15 ]
#[select]
#open_title = "Open with:"
#open_origin = "hovered"
#open_offset = [0, 1, 50, 7]
[pick]
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