yazi - init commit
This commit is contained in:
2
.taplo.toml
Normal file
2
.taplo.toml
Normal file
@@ -0,0 +1,2 @@
|
||||
[formatting]
|
||||
inline_table_expand = false
|
||||
21
flavors/catppuccin-mocha.yazi/LICENSE
Normal file
21
flavors/catppuccin-mocha.yazi/LICENSE
Normal 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.
|
||||
21
flavors/catppuccin-mocha.yazi/LICENSE-tmtheme
Normal file
21
flavors/catppuccin-mocha.yazi/LICENSE-tmtheme
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Catppuccin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
36
flavors/catppuccin-mocha.yazi/README.md
Normal file
36
flavors/catppuccin-mocha.yazi/README.md
Normal file
@@ -0,0 +1,36 @@
|
||||
<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">
|
||||
Catppuccin Mocha Flavor for <a href="https://github.com/sxyazi/yazi">Yazi</a>
|
||||
</h3>
|
||||
|
||||
## 👀 Preview
|
||||
|
||||
<img src="preview.png" width="600" />
|
||||
|
||||
## 🎨 Installation
|
||||
|
||||
```sh
|
||||
ya pack -a yazi-rs/flavors:catppuccin-mocha
|
||||
```
|
||||
|
||||
## ⚙️ Usage
|
||||
|
||||
Set the content of your `theme.toml` to enable it as your _dark_ flavor:
|
||||
|
||||
```toml
|
||||
[flavor]
|
||||
dark = "catppuccin-mocha"
|
||||
```
|
||||
|
||||
Make sure your `theme.toml` doesn't contain anything other than `[flavor]`, unless you want to override certain styles of this flavor.
|
||||
|
||||
See the [Yazi flavor documentation](https://yazi-rs.github.io/docs/flavors/overview) for more details.
|
||||
|
||||
## 📜 License
|
||||
|
||||
The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed.
|
||||
|
||||
Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details.
|
||||
170
flavors/catppuccin-mocha.yazi/flavor.toml
Normal file
170
flavors/catppuccin-mocha.yazi/flavor.toml
Normal file
@@ -0,0 +1,170 @@
|
||||
# vim:fileencoding=utf-8:foldmethod=marker
|
||||
|
||||
# : Manager {{{
|
||||
|
||||
[manager]
|
||||
cwd = { fg = "#94e2d5" }
|
||||
|
||||
# Hovered
|
||||
hovered = { reversed = true }
|
||||
preview_hovered = { underline = true }
|
||||
|
||||
# Find
|
||||
find_keyword = { fg = "#f9e2af", bold = true, italic = true, underline = true }
|
||||
find_position = { fg = "#f5c2e7", bg = "reset", bold = true, italic = true }
|
||||
|
||||
# Marker
|
||||
marker_copied = { fg = "#a6e3a1", bg = "#a6e3a1" }
|
||||
marker_cut = { fg = "#f38ba8", bg = "#f38ba8" }
|
||||
marker_marked = { fg = "#94e2d5", bg = "#94e2d5" }
|
||||
marker_selected = { fg = "#f9e2af", bg = "#f9e2af" }
|
||||
|
||||
# Tab
|
||||
tab_active = { reversed = true }
|
||||
tab_inactive = {}
|
||||
tab_width = 1
|
||||
|
||||
# Count
|
||||
count_copied = { fg = "#1e1e2e", bg = "#a6e3a1" }
|
||||
count_cut = { fg = "#1e1e2e", bg = "#f38ba8" }
|
||||
count_selected = { fg = "#1e1e2e", bg = "#f9e2af" }
|
||||
|
||||
# Border
|
||||
border_symbol = "│"
|
||||
border_style = { fg = "#7f849c" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Mode {{{
|
||||
|
||||
[mode]
|
||||
|
||||
normal_main = { fg = "#1e1e2e", bg = "#89b4fa", bold = true }
|
||||
normal_alt = { fg = "#89b4fa", bg = "#313244" }
|
||||
|
||||
# Select mode
|
||||
select_main = { fg = "#1e1e2e", bg = "#94e2d5", bold = true }
|
||||
select_alt = { fg = "#94e2d5", bg = "#313244" }
|
||||
|
||||
# Unset mode
|
||||
unset_main = { fg = "#1e1e2e", bg = "#f2cdcd", bold = true }
|
||||
unset_alt = { fg = "#f2cdcd", bg = "#313244" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Status bar {{{
|
||||
|
||||
[status]
|
||||
# Permissions
|
||||
perm_sep = { fg = "#7f849c" }
|
||||
perm_type = { fg = "#89b4fa" }
|
||||
perm_read = { fg = "#f9e2af" }
|
||||
perm_write = { fg = "#f38ba8" }
|
||||
perm_exec = { fg = "#a6e3a1" }
|
||||
|
||||
# Progress
|
||||
progress_label = { fg = "#ffffff", bold = true }
|
||||
progress_normal = { fg = "#89b4fa", bg = "#45475a" }
|
||||
progress_error = { fg = "#f38ba8", bg = "#45475a" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Pick {{{
|
||||
|
||||
[pick]
|
||||
border = { fg = "#89b4fa" }
|
||||
active = { fg = "#f5c2e7", bold = true }
|
||||
inactive = {}
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Input {{{
|
||||
|
||||
[input]
|
||||
border = { fg = "#89b4fa" }
|
||||
title = {}
|
||||
value = {}
|
||||
selected = { reversed = true }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Completion {{{
|
||||
|
||||
[cmp]
|
||||
border = { fg = "#89b4fa" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Tasks {{{
|
||||
|
||||
[tasks]
|
||||
border = { fg = "#89b4fa" }
|
||||
title = {}
|
||||
hovered = { fg = "#f5c2e7", underline = true }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Which {{{
|
||||
|
||||
[which]
|
||||
mask = { bg = "#313244" }
|
||||
cand = { fg = "#94e2d5" }
|
||||
rest = { fg = "#9399b2" }
|
||||
desc = { fg = "#f5c2e7" }
|
||||
separator = " "
|
||||
separator_style = { fg = "#585b70" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Help {{{
|
||||
|
||||
[help]
|
||||
on = { fg = "#94e2d5" }
|
||||
run = { fg = "#f5c2e7" }
|
||||
hovered = { reversed = true, bold = true }
|
||||
footer = { fg = "#313244", bg = "#cdd6f4" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : Notify {{{
|
||||
|
||||
[notify]
|
||||
title_info = { fg = "#a6e3a1" }
|
||||
title_warn = { fg = "#f9e2af" }
|
||||
title_error = { fg = "#f38ba8" }
|
||||
|
||||
# : }}}
|
||||
|
||||
|
||||
# : File-specific styles {{{
|
||||
|
||||
[filetype]
|
||||
|
||||
rules = [
|
||||
# Images
|
||||
{ mime = "image/*", fg = "#94e2d5" },
|
||||
|
||||
# Media
|
||||
{ mime = "{audio,video}/*", fg = "#f9e2af" },
|
||||
|
||||
# Archives
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "#f5c2e7" },
|
||||
|
||||
# Documents
|
||||
{ mime = "application/{pdf,doc,rtf}", fg = "#a6e3a1" },
|
||||
|
||||
# Fallback
|
||||
{ name = "*", fg = "#cdd6f4" },
|
||||
{ name = "*/", fg = "#89b4fa" }
|
||||
]
|
||||
|
||||
# : }}}
|
||||
BIN
flavors/catppuccin-mocha.yazi/preview.png
Normal file
BIN
flavors/catppuccin-mocha.yazi/preview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 660 KiB |
2081
flavors/catppuccin-mocha.yazi/tmtheme.xml
Normal file
2081
flavors/catppuccin-mocha.yazi/tmtheme.xml
Normal file
File diff suppressed because it is too large
Load Diff
1
flavors/tokyo-night.yazi
Submodule
1
flavors/tokyo-night.yazi
Submodule
Submodule flavors/tokyo-night.yazi added at 9e6f8997c7
51
init.lua
Normal file
51
init.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
-- function Status:name()
|
||||
-- local h = cx.active.current.hovered
|
||||
-- if not h then
|
||||
-- return ui.Span("")
|
||||
-- end
|
||||
-- local linked = ""
|
||||
-- if h.link_to ~= nil then
|
||||
-- linked = " -> " .. tostring(h.link_to)
|
||||
-- end
|
||||
|
||||
-- return ui.Span(" " .. h.name .. linked)
|
||||
-- end
|
||||
|
||||
-- Status:children_add(function()
|
||||
-- local h = cx.active.current.hovered
|
||||
-- if h == nil or ya.target_family() ~= "unix" then
|
||||
-- return ui.Line({})
|
||||
-- end
|
||||
|
||||
-- return ui.Line({
|
||||
-- ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("#6495ED"),
|
||||
-- ui.Span(":"):fg("#87CEFA"),
|
||||
-- ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("#6495ED"),
|
||||
-- ui.Span(" "),
|
||||
-- })
|
||||
-- end, 500, Status.RIGHT)
|
||||
|
||||
-- Header:children_add(function()
|
||||
-- if ya.target_family() ~= "unix" then
|
||||
-- return ui.Line({})
|
||||
-- end
|
||||
-- return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("#87CEFA")
|
||||
-- end, 500, Header.LEFT)
|
||||
|
||||
require("full-border"):setup({
|
||||
-- Available values: ui.Border.PLAIN, ui.Border.ROUNDED
|
||||
type = ui.Border.ROUNDED,
|
||||
})
|
||||
|
||||
require("eza-preview"):setup({
|
||||
-- Determines the directory depth level to tree preview (default: 3)
|
||||
level = 3,
|
||||
|
||||
-- Whether to follow symlinks when previewing directories (default: false)
|
||||
follow_symlinks = false,
|
||||
|
||||
-- Whether to show target file info instead of symlink info (default: false)
|
||||
dereference = false
|
||||
})
|
||||
|
||||
|
||||
18
keymap.toml
Normal file
18
keymap.toml
Normal file
@@ -0,0 +1,18 @@
|
||||
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
|
||||
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
|
||||
"$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
|
||||
|
||||
[mgr]
|
||||
prepend_keymap = [
|
||||
{ on = ['c', 'm'], run = "plugin chmod", desc = "Chmod on selected files" },
|
||||
{ on = "<A-p>", run = "plugin toggle-pane min-preview", desc = "Hide or show preview" },
|
||||
{ on = "M", run = "plugin toggle-pane max-preview", desc = "Maximize or restore preview" },
|
||||
# { on = "f", run = "plugin jump-to-char", desc = "Jump to char" },
|
||||
{ on = "<C-y>", run = "plugin wl-clipboard", desc = "Copy wl-clipboard" },
|
||||
{ on = ['g', 'D'], run = "cd ~/Downloads/", desc = "Go to Downloads" },
|
||||
{ on = ['g', 'd'], run = "cd ~/Documents/", desc = "Go to Documents" },
|
||||
{ on = ['g', 'c'], run = "cd ~/.config/", desc = "Go to Config" },
|
||||
{ on = ['g', 'o'], run = "cd /mnt/SSD-playing\\ games/Workspace/obsidian_aio/", desc = "Go to Obsidian_aio" },
|
||||
{ on = ['g', 'k'], run = "cd ~/Documents/obsidian_aio/Code model/Knowledge/", desc = "Go to Knowledge note" },
|
||||
{ on = ['i', 'c'], run = "plugin ouch --args=zip", desc = "Compress with ouch" },
|
||||
]
|
||||
18
keymap.toml-1748921996817036
Normal file
18
keymap.toml-1748921996817036
Normal file
@@ -0,0 +1,18 @@
|
||||
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
|
||||
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
|
||||
"$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
|
||||
|
||||
[manager]
|
||||
prepend_keymap = [
|
||||
{ on = ['c', 'm'], run = "plugin chmod", desc = "Chmod on selected files" },
|
||||
{ on = "<A-p>", run = "plugin toggle-pane min-preview", desc = "Hide or show preview" },
|
||||
{ on = "M", run = "plugin toggle-pane max-preview", desc = "Maximize or restore preview" },
|
||||
# { on = "f", run = "plugin jump-to-char", desc = "Jump to char" },
|
||||
{ on = "<C-y>", run = "plugin wl-clipboard", desc = "Copy wl-clipboard" },
|
||||
{ on = ['g', 'D'], run = "cd ~/Downloads/", desc = "Go to Downloads" },
|
||||
{ on = ['g', 'd'], run = "cd ~/Documents/", desc = "Go to Documents" },
|
||||
{ on = ['g', 'c'], run = "cd ~/.config/", desc = "Go to Config" },
|
||||
{ on = ['g', 'o'], run = "cd ~/Documents/obsidian_aio/", desc = "Go to Obsidian_aio" },
|
||||
{ on = ['g', 'k'], run = "cd ~/Documents/obsidian_aio/Code model/Knowledge/", desc = "Go to Knowledge note" },
|
||||
{ on = ['i', 'c'], run = "plugin ouch --args=zip", desc = "Compress with ouch" },
|
||||
]
|
||||
49
package.toml
Normal file
49
package.toml
Normal file
@@ -0,0 +1,49 @@
|
||||
[[plugin.deps]]
|
||||
use = "GrzegorzKozub/mdcat"
|
||||
rev = "d3d5089"
|
||||
hash = "40c20e6c1085d1f45309b9f148bf4f6e"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "Reledia/glow"
|
||||
rev = "c76bf4f"
|
||||
hash = "a6b78bf9af5390e3a85a6951fbb7b93"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "AnirudhG07/nbpreview"
|
||||
rev = "f8879b3"
|
||||
hash = "d378328e5d0a1b9fb9f04ab3aade4575"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "AnirudhG07/rich-preview"
|
||||
rev = "2559e5f"
|
||||
hash = "c9a3d0731e7d7340e2c6d6126b1f3aa3"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "ahkohd/eza-preview"
|
||||
rev = "6575a9a"
|
||||
hash = "72355a6c8b7c8de6ed4dda0f98f86fee"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "grappas/wl-clipboard"
|
||||
rev = "c4edc4f"
|
||||
hash = "51ff959c3c26cb3889589a0f8d394f14"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "yazi-rs/plugins:max-preview"
|
||||
rev = "de9814b"
|
||||
hash = "a8025f2bb311e869069364fba01abffc"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "yazi-rs/plugins:toggle-pane"
|
||||
rev = "de9814b"
|
||||
hash = "812fd49667ab6823250f0411f8cf793a"
|
||||
|
||||
[[plugin.deps]]
|
||||
use = "josephschmitt/auto-layout"
|
||||
rev = "2149c8f"
|
||||
hash = "ee6440a6a6cf85baa377dfaa2265b777"
|
||||
|
||||
[[flavor.deps]]
|
||||
use = "yazi-rs/flavors:catppuccin-mocha"
|
||||
rev = "c023460"
|
||||
hash = "2ac87e1b3a61f5887472899e86535d29"
|
||||
21
plugins/eza-preview.yazi/LICENSE
Normal file
21
plugins/eza-preview.yazi/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 sharklasers996
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
63
plugins/eza-preview.yazi/README.md
Normal file
63
plugins/eza-preview.yazi/README.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# eza-preview.yazi
|
||||
|
||||
[Yazi](https://github.com/sxyazi/yazi) plugin to preview directories using [eza](https://github.com/eza-community/eza), can be switched between list and tree modes.
|
||||
|
||||
List mode:
|
||||

|
||||
|
||||
Tree mode:
|
||||

|
||||
|
||||
## Requirements
|
||||
|
||||
- [yazi (0.4+) or nightly](https://github.com/sxyazi/yazi)
|
||||
- [eza (0.20+)](https://github.com/eza-community/eza)
|
||||
|
||||
## Installation
|
||||
|
||||
### Linux/MacOS
|
||||
|
||||
```sh
|
||||
ya pack -a ahkohd/eza-preview
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Add `eza-preview` to previewers in `yazi.toml`:
|
||||
|
||||
```toml
|
||||
[[plugin.prepend_previewers]]
|
||||
name = "*/"
|
||||
run = "eza-preview"
|
||||
```
|
||||
|
||||
Set key binding to switch between list and tree modes in `keymap.toml`:
|
||||
|
||||
```toml
|
||||
[manager]
|
||||
prepend_keymap = [
|
||||
{ on = [ "E" ], run = "plugin eza-preview", desc = "Toggle tree/list dir preview" },
|
||||
{ on = [ "-" ], run = "plugin eza-preview --args='--inc-level'", desc = "Increment tree level" },
|
||||
{ on = [ "_" ], run = "plugin eza-preview --args='--dec-level'", desc = "Decrement tree level" },
|
||||
{ on = [ "$" ], run = "plugin eza-preview --args='--toggle-follow-symlinks'", desc = "Toggle tree follow symlinks" },
|
||||
]
|
||||
```
|
||||
|
||||
List mode is the default, if you want to have tree mode instead when starting yazi - update `init.lua` with:
|
||||
|
||||
```lua
|
||||
require("eza-preview"):setup({
|
||||
-- Determines the directory depth level to tree preview (default: 3)
|
||||
level = 3,
|
||||
|
||||
-- Whether to follow symlinks when previewing directories (default: false)
|
||||
follow_symlinks = false
|
||||
|
||||
-- Whether to show target file info instead of symlink info (default: false)
|
||||
dereference = false
|
||||
})
|
||||
|
||||
-- Or use default settings with empty table
|
||||
require("eza-preview"):setup({})
|
||||
|
||||
```
|
||||
157
plugins/eza-preview.yazi/main.lua
Normal file
157
plugins/eza-preview.yazi/main.lua
Normal file
@@ -0,0 +1,157 @@
|
||||
local M = {}
|
||||
|
||||
local function fail(s, ...)
|
||||
ya.notify({ title = "Eza Preview", content = string.format(s, ...), timeout = 5, level = "error" })
|
||||
end
|
||||
|
||||
local toggle_view_mode = ya.sync(function(state, _)
|
||||
if state.tree == nil then
|
||||
state.tree = false
|
||||
end
|
||||
|
||||
state.tree = not state.tree
|
||||
end)
|
||||
|
||||
local is_tree_view_mode = ya.sync(function(state, _)
|
||||
return state.tree
|
||||
end)
|
||||
|
||||
local set_opts = ya.sync(function(state, opts)
|
||||
if state.opts == nil then
|
||||
state.opts = { level = 3, follow_symlinks = false, dereference = false }
|
||||
end
|
||||
|
||||
for key, value in pairs(opts or {}) do
|
||||
state.opts[key] = value
|
||||
end
|
||||
end)
|
||||
|
||||
local get_opts = ya.sync(function(state)
|
||||
return state.opts
|
||||
end)
|
||||
|
||||
local inc_level = ya.sync(function(state)
|
||||
state.opts.level = state.opts.level + 1
|
||||
end)
|
||||
|
||||
local dec_level = ya.sync(function(state)
|
||||
if state.opts.level > 1 then
|
||||
state.opts.level = state.opts.level - 1
|
||||
end
|
||||
end)
|
||||
|
||||
local toggle_follow_symlinks = ya.sync(function(state)
|
||||
state.opts.follow_symlinks = not state.opts.follow_symlinks
|
||||
end)
|
||||
|
||||
function M:setup(opts)
|
||||
set_opts(opts)
|
||||
|
||||
toggle_view_mode()
|
||||
end
|
||||
|
||||
function M:entry(job)
|
||||
local arg = job.arg
|
||||
|
||||
if arg["inc_level"] ~= nil then
|
||||
inc_level()
|
||||
elseif arg["dec_level"] ~= nil then
|
||||
dec_level()
|
||||
elseif arg["toggle_follow_symlinks"] ~= nil then
|
||||
toggle_follow_symlinks()
|
||||
else
|
||||
set_opts()
|
||||
toggle_view_mode()
|
||||
end
|
||||
|
||||
ya.manager_emit("seek", { 0 })
|
||||
end
|
||||
|
||||
function M:peek(job)
|
||||
local opts = get_opts()
|
||||
|
||||
local arg = {
|
||||
"--all",
|
||||
"--color=always",
|
||||
"--icons=always",
|
||||
"--group-directories-first",
|
||||
"--no-quotes",
|
||||
tostring(job.file.url),
|
||||
}
|
||||
|
||||
if is_tree_view_mode() then
|
||||
table.insert(arg, "--tree")
|
||||
table.insert(arg, string.format("--level=%d", opts.level))
|
||||
end
|
||||
|
||||
if opts then
|
||||
if opts.follow_symlinks then
|
||||
table.insert(arg, "--follow-symlinks")
|
||||
end
|
||||
|
||||
if opts.dereference then
|
||||
table.insert(arg, "--dereference")
|
||||
end
|
||||
end
|
||||
|
||||
local child = Command("eza"):arg(arg):stdout(Command.PIPED):stderr(Command.PIPED):spawn()
|
||||
|
||||
local limit = job.area.h
|
||||
local lines = ""
|
||||
local num_lines = 1
|
||||
local num_skip = 0
|
||||
local empty_output = false
|
||||
|
||||
repeat
|
||||
local line, event = child:read_line()
|
||||
if event == 1 then
|
||||
fail(tostring(event))
|
||||
elseif event ~= 0 then
|
||||
break
|
||||
end
|
||||
|
||||
if num_skip >= job.skip then
|
||||
lines = lines .. line
|
||||
num_lines = num_lines + 1
|
||||
else
|
||||
num_skip = num_skip + 1
|
||||
end
|
||||
until num_lines >= limit
|
||||
|
||||
if num_lines == 1 and not is_tree_view_mode() then
|
||||
empty_output = true
|
||||
elseif num_lines == 2 and is_tree_view_mode() then
|
||||
empty_output = true
|
||||
end
|
||||
|
||||
child:start_kill()
|
||||
if job.skip > 0 and num_lines < limit then
|
||||
ya.manager_emit("peek", {
|
||||
tostring(math.max(0, job.skip - (limit - num_lines))),
|
||||
only_if = tostring(job.file.url),
|
||||
upper_bound = "",
|
||||
})
|
||||
elseif empty_output then
|
||||
ya.preview_widgets(job, {
|
||||
ui.Text({ ui.Line("No items") }):area(job.area):align(ui.Text.CENTER),
|
||||
})
|
||||
else
|
||||
ya.preview_widgets(job, { ui.Text.parse(lines):area(job.area) })
|
||||
end
|
||||
end
|
||||
|
||||
function M:seek(job)
|
||||
local h = cx.active.current.hovered
|
||||
|
||||
if h and h.url == job.file.url then
|
||||
local step = math.floor(job.units * job.area.h / 10)
|
||||
|
||||
ya.manager_emit("peek", {
|
||||
math.max(0, cx.active.preview.skip + step),
|
||||
only_if = tostring(job.file.url),
|
||||
force = true,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
49
plugins/full-border.yazi/main.lua
Normal file
49
plugins/full-border.yazi/main.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
--- @since 25.2.26
|
||||
|
||||
local function setup(_, opts)
|
||||
local type = opts and opts.type or ui.Border.ROUNDED
|
||||
local old_build = Tab.build
|
||||
|
||||
Tab.build = function(self, ...)
|
||||
local bar = function(c, x, y)
|
||||
if x <= 0 or x == self._area.w - 1 then
|
||||
return ui.Bar(ui.Bar.TOP)
|
||||
end
|
||||
|
||||
return ui.Bar(ui.Bar.TOP)
|
||||
:area(
|
||||
ui.Rect({
|
||||
x = x,
|
||||
y = math.max(0, y),
|
||||
w = ya.clamp(0, self._area.w - x, 1),
|
||||
h = math.min(1, self._area.h),
|
||||
})
|
||||
)
|
||||
:symbol(c)
|
||||
end
|
||||
|
||||
local c = self._chunks
|
||||
self._chunks = {
|
||||
c[1]:pad(ui.Pad.y(1)),
|
||||
c[2]:pad(ui.Pad(1, c[3].w > 0 and 0 or 1, 1, c[1].w > 0 and 0 or 1)),
|
||||
c[3]:pad(ui.Pad.y(1)),
|
||||
}
|
||||
|
||||
local style = th.mgr.border_style
|
||||
self._base = ya.list_merge(self._base or {}, {
|
||||
ui.Border(ui.Border.ALL):area(self._area):type(type):style(style),
|
||||
ui.Bar(ui.Bar.RIGHT):area(self._chunks[1]):style(style),
|
||||
ui.Bar(ui.Bar.LEFT):area(self._chunks[3]):style(style),
|
||||
|
||||
bar("┬", c[1].right - 1, c[1].y),
|
||||
bar("┴", c[1].right - 1, c[1].bottom - 1),
|
||||
bar("┬", c[2].right, c[2].y),
|
||||
bar("┴", c[2].right, c[2].bottom - 1),
|
||||
})
|
||||
|
||||
old_build(self, ...)
|
||||
end
|
||||
end
|
||||
|
||||
return { setup = setup }
|
||||
|
||||
1
plugins/ouch.yazi
Submodule
1
plugins/ouch.yazi
Submodule
Submodule plugins/ouch.yazi added at ce6fb75431
1
plugins/rich-preview.yazi
Submodule
1
plugins/rich-preview.yazi
Submodule
Submodule plugins/rich-preview.yazi added at 843c3faf0a
21
plugins/toggle-pane.yazi/LICENSE
Normal file
21
plugins/toggle-pane.yazi/LICENSE
Normal 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.
|
||||
78
plugins/toggle-pane.yazi/README.md
Normal file
78
plugins/toggle-pane.yazi/README.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# toggle-pane.yazi
|
||||
|
||||
Toggle the show, hide, and maximize states for different panes: parent, current, and preview. It respects the user's [`ratio` settings](https://yazi-rs.github.io/docs/configuration/yazi#manager.ratio)!
|
||||
|
||||
Assume the user's `ratio` is $$[A, B, C]$$, that is, $$\text{parent}=A, \text{current}=B, \text{preview}=C$$:
|
||||
|
||||
- `min-parent`: Toggles between $$0$$ and $$A$$ - the parent is either completely hidden or showed with width $$A$$.
|
||||
- `max-parent`: Toggles between $$A$$ and $$\infty$$ - the parent is either showed with width $$A$$ or fills the entire screen.
|
||||
- `min-current`: Toggles between $$0$$ and $$B$$ - the current is either completely hidden or showed with width $$B$$.
|
||||
- `max-current`: Toggles between $$B$$ and $$\infty$$ - the current is either showed with width $$B$$ or fills the entire screen.
|
||||
- `min-preview`: Toggles between $$0$$ and $$C$$ - the preview is either completely hidden or showed with width $$C$$.
|
||||
- `max-preview`: Toggles between $$C$$ and $$\infty$$ - the preview is either showed with width $$C$$ or fills the entire screen.
|
||||
- `reset`: Resets to the user's configured `ratio`.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
ya pack -a yazi-rs/plugins:toggle-pane
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Hide/Show preview:
|
||||
|
||||
```toml
|
||||
# keymap.toml
|
||||
[[manager.prepend_keymap]]
|
||||
on = "T"
|
||||
run = "plugin toggle-pane min-preview"
|
||||
desc = "Show or hide the preview pane"
|
||||
```
|
||||
|
||||
Maximize/Restore preview:
|
||||
|
||||
```toml
|
||||
# keymap.toml
|
||||
[[manager.prepend_keymap]]
|
||||
on = "T"
|
||||
run = "plugin toggle-pane max-preview"
|
||||
desc = "Maximize or restore the preview pane"
|
||||
```
|
||||
|
||||
You can replace `preview` with `current` or `parent` to toggle the other panes.
|
||||
|
||||
## Advanced
|
||||
|
||||
In addition to triggering the plugin with a keypress, you can also trigger it in your `init.lua` file:
|
||||
|
||||
```lua
|
||||
if os.getenv("NVIM") then
|
||||
require("toggle-pane"):entry("min-preview")
|
||||
end
|
||||
```
|
||||
|
||||
In the example above, when it detects that you're [using Yazi in nvim](https://yazi-rs.github.io/docs/resources#vim), the preview is hidden by default — you can always press `T` (or any key you've bound) to show it again.
|
||||
|
||||
## Tips
|
||||
|
||||
This plugin only maximizes the "available preview area", without actually changing the content size.
|
||||
|
||||
This means that the appearance of your preview largely depends on the previewer you are using.
|
||||
However, most previewers tend to make the most of the available space, so this usually isn't an issue.
|
||||
|
||||
For image previews, you may want to tune up the [`max_width`][max-width] and [`max_height`][max-height] options in your `yazi.toml`:
|
||||
|
||||
```toml
|
||||
[preview]
|
||||
# Change them to your desired values
|
||||
max_width = 1000
|
||||
max_height = 1000
|
||||
```
|
||||
|
||||
[max-width]: https://yazi-rs.github.io/docs/configuration/yazi/#preview.max_width
|
||||
[max-height]: https://yazi-rs.github.io/docs/configuration/yazi/#preview.max_height
|
||||
|
||||
## License
|
||||
|
||||
This plugin is MIT-licensed. For more information, check the [LICENSE](LICENSE) file.
|
||||
46
plugins/toggle-pane.yazi/main.lua
Normal file
46
plugins/toggle-pane.yazi/main.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
--- @since 25.2.26
|
||||
--- @sync entry
|
||||
|
||||
local function entry(st, job)
|
||||
local R = rt.mgr.ratio
|
||||
job = type(job) == "string" and { args = { job } } or job
|
||||
|
||||
st.parent = st.parent and st.parent or R.parent
|
||||
st.current = st.current and st.current or R.current
|
||||
st.preview = st.preview and st.preview or R.preview
|
||||
|
||||
local act, to = string.match(job.args[1] or "", "(.-)-(.+)")
|
||||
if act == "min" then
|
||||
st[to] = st[to] == R[to] and 0 or R[to]
|
||||
elseif act == "max" then
|
||||
local max = st[to] == 65535 and R[to] or 65535
|
||||
st.parent = st.parent == 65535 and R.parent or st.parent
|
||||
st.current = st.current == 65535 and R.current or st.current
|
||||
st.preview = st.preview == 65535 and R.preview or st.preview
|
||||
st[to] = max
|
||||
end
|
||||
|
||||
if not st.old then
|
||||
st.old = Tab.layout
|
||||
Tab.layout = function(self)
|
||||
local all = st.parent + st.current + st.preview
|
||||
self._chunks = ui.Layout()
|
||||
:direction(ui.Layout.HORIZONTAL)
|
||||
:constraints({
|
||||
ui.Constraint.Ratio(st.parent, all),
|
||||
ui.Constraint.Ratio(st.current, all),
|
||||
ui.Constraint.Ratio(st.preview, all),
|
||||
})
|
||||
:split(self._area)
|
||||
end
|
||||
end
|
||||
|
||||
if not act then
|
||||
Tab.layout, st.old = st.old, nil
|
||||
st.parent, st.current, st.preview = nil, nil, nil
|
||||
end
|
||||
|
||||
ya.app_emit("resize", {})
|
||||
end
|
||||
|
||||
return { entry = entry }
|
||||
7
plugins/wl-clipboard.yazi/LICENSE
Normal file
7
plugins/wl-clipboard.yazi/LICENSE
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright 2024 grappas
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
34
plugins/wl-clipboard.yazi/README.md
Normal file
34
plugins/wl-clipboard.yazi/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# wl-clipboard.yazi
|
||||
|
||||
Forked from: [orhnk/system-clipboard.yazi](https://github.com/orhnk/system-clipboard.yazi) to work with wayland compositors.
|
||||
|
||||
## Demo
|
||||
|
||||
<https://github.com/user-attachments/assets/74d59f49-266a-497e-b67e-d77e64209026>
|
||||
|
||||
## Config
|
||||
|
||||
> [!NOTE]
|
||||
> You need yazi 3.x for this plugin to work.
|
||||
|
||||
> [!Important]
|
||||
> This plugin utilizes ["wl-clipboard" project](https://github.com/bugaevc/wl-clipboard).
|
||||
> You need to have it installed on your system. (Make sure that It's on your $PATH)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
ya pack -a grappas/wl-clipboard
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Copy or install this plugin and add the following keymap to your `manager.prepend_keymap`:
|
||||
|
||||
```toml
|
||||
on = "<C-y>"
|
||||
run = ["plugin wl-clipboard"]
|
||||
```
|
||||
|
||||
> [!Tip]
|
||||
> If you want to use this plugin with yazi's default yanking behaviour you should use `cx.yanked` instead of `tab.selected` in `init.lua` (See [#1487](https://github.com/sxyazi/yazi/issues/1487))
|
||||
60
plugins/wl-clipboard.yazi/main.lua
Normal file
60
plugins/wl-clipboard.yazi/main.lua
Normal file
@@ -0,0 +1,60 @@
|
||||
-- Meant to run at async context. (yazi system-clipboard)
|
||||
|
||||
local selected_or_hovered = ya.sync(function()
|
||||
local tab, paths = cx.active, {}
|
||||
for _, u in pairs(tab.selected) do
|
||||
paths[#paths + 1] = tostring(u)
|
||||
end
|
||||
if #paths == 0 and tab.current.hovered then
|
||||
paths[1] = tostring(tab.current.hovered.url)
|
||||
end
|
||||
return paths
|
||||
end)
|
||||
|
||||
return {
|
||||
entry = function()
|
||||
ya.manager_emit("escape", { visual = true })
|
||||
|
||||
local urls = selected_or_hovered()
|
||||
|
||||
if #urls == 0 then
|
||||
return ya.notify({ title = "System Clipboard", content = "No file selected", level = "warn", timeout = 5 })
|
||||
end
|
||||
|
||||
-- ya.notify({ title = #urls, content = table.concat(urls, " "), level = "info", timeout = 5 })
|
||||
|
||||
-- Format the URLs for `text/uri-list` specification
|
||||
local function encode_uri(uri)
|
||||
return uri:gsub("([^%w%-%._~:/])", function(c)
|
||||
return string.format("%%%02X", string.byte(c))
|
||||
end)
|
||||
end
|
||||
|
||||
local file_list_formatted = ""
|
||||
for _, path in ipairs(urls) do
|
||||
-- Each file path must be URI-encoded and prefixed with "file://"
|
||||
file_list_formatted = file_list_formatted .. "file://" .. encode_uri(path) .. "\r\n"
|
||||
end
|
||||
|
||||
local status, err =
|
||||
Command("wl-copy"):arg("--type"):arg("text/uri-list"):arg(file_list_formatted):spawn():wait()
|
||||
|
||||
if status or status.succes then
|
||||
ya.notify({
|
||||
title = "System Clipboard",
|
||||
content = "Succesfully copied the file(s) to system clipboard",
|
||||
level = "info",
|
||||
timeout = 5,
|
||||
})
|
||||
end
|
||||
|
||||
if not status or not status.success then
|
||||
ya.notify({
|
||||
title = "System Clipboard",
|
||||
content = string.format("Could not copy selected file(s) %s", status and status.code or err),
|
||||
level = "error",
|
||||
timeout = 5,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
3
theme.toml
Normal file
3
theme.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[flavor]
|
||||
dark = "catppuccin-mocha"
|
||||
|
||||
158
yazi.toml
Normal file
158
yazi.toml
Normal file
@@ -0,0 +1,158 @@
|
||||
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
|
||||
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
|
||||
"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"
|
||||
|
||||
[mgr]
|
||||
ratio = [2, 4, 4]
|
||||
sort_by = "natural"
|
||||
sort_sensitive = false
|
||||
sort_reverse = false
|
||||
sort_dir_first = true
|
||||
sort_translit = false
|
||||
linemode = "size"
|
||||
show_hidden = true
|
||||
show_symlink = true
|
||||
scrolloff = 5
|
||||
mouse_events = ["click", "scroll"]
|
||||
title_format = "Yazi: {cwd}"
|
||||
|
||||
[preview]
|
||||
tab_size = 4
|
||||
max_width = 600
|
||||
max_height = 900
|
||||
cache_dir = ""
|
||||
# image_delay = 30
|
||||
image_filter = "triangle"
|
||||
image_quality = 75
|
||||
sixel_fraction = 15
|
||||
ueberzug_scale = 1
|
||||
ueberzug_offset = [0, 0, 0, 0]
|
||||
|
||||
[opener]
|
||||
edit = [
|
||||
{ run = '${EDITOR:-vi} "$@"', desc = "$EDITOR", block = true, for = "unix" },
|
||||
{ run = 'code %*', orphan = true, desc = "code", for = "windows" },
|
||||
{ run = 'code -w %*', block = true, desc = "code (block)", for = "windows" },
|
||||
]
|
||||
open = [
|
||||
{ run = 'xdg-open "$1"', desc = "Open", for = "linux" },
|
||||
{ run = 'open "$@"', desc = "Open", for = "macos" },
|
||||
{ run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" },
|
||||
]
|
||||
reveal = [
|
||||
{ run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" },
|
||||
{ run = 'open -R "$1"', desc = "Reveal", for = "macos" },
|
||||
{ run = 'explorer /select,"%1"', orphan = true, desc = "Reveal", for = "windows" },
|
||||
{ run = '''exiftool "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" },
|
||||
]
|
||||
extract = [
|
||||
{ run = 'ouch d -y "%*"', desc = "Extract here with ouch", for = "windows" },
|
||||
{ run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" },
|
||||
]
|
||||
play = [
|
||||
{ run = 'mpv --force-window "$@"', orphan = true, for = "unix" },
|
||||
{ run = 'mpv --force-window %*', orphan = true, for = "windows" },
|
||||
{ run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" },
|
||||
]
|
||||
|
||||
[open]
|
||||
rules = [
|
||||
# Folder
|
||||
{ name = "*/", use = ["edit", "open", "reveal"] },
|
||||
# Text
|
||||
{ mime = "text/*", use = ["edit", "reveal"] },
|
||||
# Image
|
||||
{ mime = "image/*", use = ["open", "reveal"] },
|
||||
# Media
|
||||
{ mime = "{audio,video}/*", use = ["play", "reveal"] },
|
||||
# Archive
|
||||
{ mime = "application/{,g}zip", use = ["extract", "reveal"] },
|
||||
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = ["extract", "reveal"] },
|
||||
# JSON
|
||||
{ mime = "application/{json,x-ndjson,jsonl}", use = ["edit", "reveal"] },
|
||||
{ mime = "*/javascript", use = ["edit", "reveal"] },
|
||||
# Empty file
|
||||
{ mime = "inode/x-empty", use = ["edit", "reveal"] },
|
||||
# Fallback
|
||||
{ name = "*", use = ["open", "reveal"] },
|
||||
]
|
||||
|
||||
[tasks]
|
||||
micro_workers = 10
|
||||
macro_workers = 25
|
||||
bizarre_retry = 5
|
||||
image_alloc = 536870912 # 512MB
|
||||
image_bound = [0, 0]
|
||||
suppress_preload = false
|
||||
|
||||
[plugin]
|
||||
fetchers = [
|
||||
# Mimetype
|
||||
{ id = "mime", name = "*", run = "mime", if = "!mime", prio = "high" },
|
||||
]
|
||||
preloaders = [
|
||||
# Image
|
||||
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
|
||||
{ mime = "image/*", run = "image" },
|
||||
# Video
|
||||
{ mime = "video/*", run = "video" },
|
||||
# PDF
|
||||
{ mime = "application/pdf", run = "pdf" },
|
||||
# Font
|
||||
{ mime = "font/*", run = "font" },
|
||||
{ mime = "application/vnd.ms-opentype", run = "font" },
|
||||
]
|
||||
previewers = [
|
||||
{ name = "*/", run = "folder", sync = true },
|
||||
# Code
|
||||
{ mime = "text/*", run = "code" },
|
||||
{ mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code" },
|
||||
# JSON
|
||||
{ mime = "application/{json,x-ndjson}", run = "json" },
|
||||
# Image
|
||||
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
|
||||
{ mime = "image/*", run = "image" },
|
||||
# Video
|
||||
{ mime = "video/*", run = "video" },
|
||||
# PDF
|
||||
{ mime = "application/pdf", run = "pdf" },
|
||||
# Archive
|
||||
{ mime = "application/{,g}zip", run = "archive" },
|
||||
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar,iso9660-image}", run = "archive" },
|
||||
# Font
|
||||
{ mime = "font/*", run = "font" },
|
||||
{ mime = "application/vnd.ms-opentype", run = "font" },
|
||||
# Empty file
|
||||
{ mime = "inode/x-empty", run = "empty" },
|
||||
# Fallback
|
||||
{ name = "*", run = "file" },
|
||||
]
|
||||
prepend_previewers = [
|
||||
{ mime = "application/*zip", run = "ouch" },
|
||||
{ mime = "application/x-tar", run = "ouch" },
|
||||
{ mime = "application/x-bzip2", run = "ouch" },
|
||||
{ mime = "application/x-7z-compressed", run = "ouch" },
|
||||
{ mime = "application/x-rar", run = "ouch" },
|
||||
{ mime = "application/x-xz", run = "ouch" },
|
||||
{ name = "*.csv", run = "rich-preview"}, # for csv files
|
||||
{ name = "*.md", run = "rich-preview" }, # for markdown (.md) files
|
||||
{ name = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files
|
||||
{ name = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb)
|
||||
{ name = "*.json", run = "rich-preview"}, # for json (.json) files
|
||||
{ name = "*.jsonl", run = "rich-preview"}, # for json (.json) files
|
||||
{ name = "*/", run = "eza-preview"}
|
||||
]
|
||||
|
||||
[select]
|
||||
open_title = "Open with:"
|
||||
open_origin = "hovered"
|
||||
open_offset = [0, 1, 50, 7]
|
||||
|
||||
[which]
|
||||
sort_by = "none"
|
||||
sort_sensitive = false
|
||||
sort_reverse = false
|
||||
sort_translit = false
|
||||
|
||||
[log]
|
||||
enabled = false
|
||||
158
yazi.toml-1748921996815259
Normal file
158
yazi.toml-1748921996815259
Normal file
@@ -0,0 +1,158 @@
|
||||
# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
|
||||
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
|
||||
"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"
|
||||
|
||||
[manager]
|
||||
ratio = [2, 4, 4]
|
||||
sort_by = "natural"
|
||||
sort_sensitive = false
|
||||
sort_reverse = false
|
||||
sort_dir_first = true
|
||||
sort_translit = false
|
||||
linemode = "size"
|
||||
show_hidden = true
|
||||
show_symlink = true
|
||||
scrolloff = 5
|
||||
mouse_events = ["click", "scroll"]
|
||||
title_format = "Yazi: {cwd}"
|
||||
|
||||
[preview]
|
||||
tab_size = 4
|
||||
max_width = 600
|
||||
max_height = 900
|
||||
cache_dir = ""
|
||||
# image_delay = 30
|
||||
image_filter = "triangle"
|
||||
image_quality = 75
|
||||
sixel_fraction = 15
|
||||
ueberzug_scale = 1
|
||||
ueberzug_offset = [0, 0, 0, 0]
|
||||
|
||||
[opener]
|
||||
edit = [
|
||||
{ run = '${EDITOR:-vi} "$@"', desc = "$EDITOR", block = true, for = "unix" },
|
||||
{ run = 'code %*', orphan = true, desc = "code", for = "windows" },
|
||||
{ run = 'code -w %*', block = true, desc = "code (block)", for = "windows" },
|
||||
]
|
||||
open = [
|
||||
{ run = 'xdg-open "$1"', desc = "Open", for = "linux" },
|
||||
{ run = 'open "$@"', desc = "Open", for = "macos" },
|
||||
{ run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" },
|
||||
]
|
||||
reveal = [
|
||||
{ run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" },
|
||||
{ run = 'open -R "$1"', desc = "Reveal", for = "macos" },
|
||||
{ run = 'explorer /select,"%1"', orphan = true, desc = "Reveal", for = "windows" },
|
||||
{ run = '''exiftool "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" },
|
||||
]
|
||||
extract = [
|
||||
{ run = 'ouch d -y "%*"', desc = "Extract here with ouch", for = "windows" },
|
||||
{ run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" },
|
||||
]
|
||||
play = [
|
||||
{ run = 'mpv --force-window "$@"', orphan = true, for = "unix" },
|
||||
{ run = 'mpv --force-window %*', orphan = true, for = "windows" },
|
||||
{ run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" },
|
||||
]
|
||||
|
||||
[open]
|
||||
rules = [
|
||||
# Folder
|
||||
{ name = "*/", use = ["edit", "open", "reveal"] },
|
||||
# Text
|
||||
{ mime = "text/*", use = ["edit", "reveal"] },
|
||||
# Image
|
||||
{ mime = "image/*", use = ["open", "reveal"] },
|
||||
# Media
|
||||
{ mime = "{audio,video}/*", use = ["play", "reveal"] },
|
||||
# Archive
|
||||
{ mime = "application/{,g}zip", use = ["extract", "reveal"] },
|
||||
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = ["extract", "reveal"] },
|
||||
# JSON
|
||||
{ mime = "application/{json,x-ndjson,jsonl}", use = ["edit", "reveal"] },
|
||||
{ mime = "*/javascript", use = ["edit", "reveal"] },
|
||||
# Empty file
|
||||
{ mime = "inode/x-empty", use = ["edit", "reveal"] },
|
||||
# Fallback
|
||||
{ name = "*", use = ["open", "reveal"] },
|
||||
]
|
||||
|
||||
[tasks]
|
||||
micro_workers = 10
|
||||
macro_workers = 25
|
||||
bizarre_retry = 5
|
||||
image_alloc = 536870912 # 512MB
|
||||
image_bound = [0, 0]
|
||||
suppress_preload = false
|
||||
|
||||
[plugin]
|
||||
fetchers = [
|
||||
# Mimetype
|
||||
{ id = "mime", name = "*", run = "mime", if = "!mime", prio = "high" },
|
||||
]
|
||||
preloaders = [
|
||||
# Image
|
||||
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
|
||||
{ mime = "image/*", run = "image" },
|
||||
# Video
|
||||
{ mime = "video/*", run = "video" },
|
||||
# PDF
|
||||
{ mime = "application/pdf", run = "pdf" },
|
||||
# Font
|
||||
{ mime = "font/*", run = "font" },
|
||||
{ mime = "application/vnd.ms-opentype", run = "font" },
|
||||
]
|
||||
previewers = [
|
||||
{ name = "*/", run = "folder", sync = true },
|
||||
# Code
|
||||
{ mime = "text/*", run = "code" },
|
||||
{ mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code" },
|
||||
# JSON
|
||||
{ mime = "application/{json,x-ndjson}", run = "json" },
|
||||
# Image
|
||||
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
|
||||
{ mime = "image/*", run = "image" },
|
||||
# Video
|
||||
{ mime = "video/*", run = "video" },
|
||||
# PDF
|
||||
{ mime = "application/pdf", run = "pdf" },
|
||||
# Archive
|
||||
{ mime = "application/{,g}zip", run = "archive" },
|
||||
{ mime = "application/x-{tar,bzip*,7z-compressed,xz,rar,iso9660-image}", run = "archive" },
|
||||
# Font
|
||||
{ mime = "font/*", run = "font" },
|
||||
{ mime = "application/vnd.ms-opentype", run = "font" },
|
||||
# Empty file
|
||||
{ mime = "inode/x-empty", run = "empty" },
|
||||
# Fallback
|
||||
{ name = "*", run = "file" },
|
||||
]
|
||||
prepend_previewers = [
|
||||
{ mime = "application/*zip", run = "ouch" },
|
||||
{ mime = "application/x-tar", run = "ouch" },
|
||||
{ mime = "application/x-bzip2", run = "ouch" },
|
||||
{ mime = "application/x-7z-compressed", run = "ouch" },
|
||||
{ mime = "application/x-rar", run = "ouch" },
|
||||
{ mime = "application/x-xz", run = "ouch" },
|
||||
{ name = "*.csv", run = "rich-preview"}, # for csv files
|
||||
{ name = "*.md", run = "rich-preview" }, # for markdown (.md) files
|
||||
{ name = "*.rst", run = "rich-preview"}, # for restructured text (.rst) files
|
||||
{ name = "*.ipynb", run = "rich-preview"}, # for jupyter notebooks (.ipynb)
|
||||
{ name = "*.json", run = "rich-preview"}, # for json (.json) files
|
||||
{ name = "*.jsonl", run = "rich-preview"}, # for json (.json) files
|
||||
{ name = "*/", run = "eza-preview"}
|
||||
]
|
||||
|
||||
[select]
|
||||
open_title = "Open with:"
|
||||
open_origin = "hovered"
|
||||
open_offset = [0, 1, 50, 7]
|
||||
|
||||
[which]
|
||||
sort_by = "none"
|
||||
sort_sensitive = false
|
||||
sort_reverse = false
|
||||
sort_translit = false
|
||||
|
||||
[log]
|
||||
enabled = false
|
||||
Reference in New Issue
Block a user