Files
dotfiles/yazi/.config/yazi/yazi.toml
T

142 lines
4.7 KiB
TOML

[mgr]
# it also support --mode=or when using with --input or --keys=!1q or --key=!1q or --tag=!1q or --tags=!1q
ratio = [2, 3, 5]
sort_by = "natural"
sort_sensitive = false
sort_reverse = false
sort_dir_first = true
linemode = "none"
show_hidden = true
show_symlink = true
scrolloff = 5
[preview]
tab_size = 2
max_width = 600
max_height = 900
cache_dir = ""
image_delay = 30
image_filter = "triangle"
image_quality = 75
[opener]
# edit = [
# { run = '$EDITOR "$@"', block = true, for = "unix" },
# ]
open = [{ run = 'xdg-open "$1"', desc = "Open", orphan = true }]
edit = [{ run = 'nvim "$@"', block = true, desc = "nvim", for = "unix" }]
reveal = [
{ run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" },
]
play = [{ run = 'mpv --force-window "$@"', orphan = true, for = "unix" }]
pdf = [{ run = 'zathura "$@"', orphan = true, for = "linux" }]
text = [{ run = 'nvim "$@"', block = true, for = "linux" }]
[open]
rules = [
# Empty files
{ mime = "inode/empty", use = "edit" },
# { mime = "inode/x-empty", use = "edit" },
# Text files - use edit (which uses $EDITOR/nvim)
{ mime = "text/*", use = "edit" }, # Changed from "text" to "edit"
# { mime = "text/x-tex", use = "edit" }, # Changed from "text" to "edit"
{ mime = "application/json", use = "edit" },
{ mime = "application/x-sh", use = "edit" },
{ mime = "application/x-shellscript", use = "edit" },
{ mime = "application/javascript", use = "edit" },
# Fallback by extension
{ name = "*.sh", use = "edit" },
{ name = "*.json", use = "edit" },
{ name = "*.md", use = "edit" },
{ name = "*.txt", use = "edit" },
{ name = "*.css", use = "edit" },
{ name = "*.js", use = "edit" },
{ name = "*.toml", use = "edit" },
{ name = "*.yaml", use = "edit" },
{ name = "*.yml", use = "edit" },
{ name = "*.tex", use = "edit" }, # Uncommented!
{ name = "*.text", use = "edit" },
# Media files
{ mime = "image/*", use = "open" },
{ mime = "video/*", use = "play" },
{ mime = "audio/*", use = "play" },
{ mime = "application/pdf", use = "pdf" },
# Fallback
{ mime = "*", use = "open" },
]
[tasks]
micro_workers = 10
macro_workers = 25
bizarre_retry = 5
suppress_preload = false
[plugin]
prepend_fetchers = [
{ id = "mime", url = "*", run = "mime-ext", prio = "high" },
# git plugin
{ id = "git", url = "*", run = "git" },
{ id = "git", url = "*/", run = "git" },
# mime plugin
{ id = "simple-tag", url = "*", run = "simple-tag" },
{ id = "simple-tag", url = "*/", run = "simple-tag" },
]
preloaders = [
# Image
{ mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" },
{ mime = "image/*", run = "image" },
# Video
# { mime = "video/*", run = "video" },
# PDF
{ mime = "application/pdf", run = "pdf" },
# Font
{ mime = "font/*", run = "font" },
{ mime = "application/ms-opentype", run = "font" },
]
prepend_preloaders = [
# Replace magick, image, video with mediainfo
{ mime = "{audio,video,image}/*", run = "mediainfo" },
{ mime = "application/subrip", run = "mediainfo" },
# Adobe Illustrator, Adobe Photoshop is image/adobe.photoshop, already handled above
{ mime = "application/postscript", run = "mediainfo" },
]
spotters = [
# extra-metadata plugin
{ url = "*", run = "file-extra-metadata" },
]
previewers = [
{ name = "*/", run = "folder", sync = true },
# Code
{ mime = "text/*", run = "code" },
{ mime = "*/{xml,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" },
# extra-metadata plugin
{ url = "*", run = "file-extra-metadata" },
]
prepend_previewers = [
# mediainfo MUST come before the catch-all piper rule
{ mime = "{audio,video,image}/*", run = "mediainfo" },
{ mime = "application/subrip", run = "mediainfo" },
{ mime = "application/postscript", run = "mediainfo" },
# ouch plugin for archives
{ mime = "application/{*zip,tar,bzip2,7z*,rar,xz,zstd,java-archive}", run = "ouch" },
# piper for directories
{ url = "*/", run = 'piper -- eza -TL=3 --color=always --icons=always --group-directories-first --no-quotes "$1"' },
# piper markdown (commented out as you had it)
# rich preview plugin
{ url = "*.csv", run = "rich-preview" }, # for csv files
{ url = "*.md", run = "rich-preview" }, # for markdown (.md) files
{ url = "*.rst", run = "rich-preview" }, # for restructured text (.rst) files
{ url = "*.ipynb", run = "rich-preview" }, # for jupyter notebooks (.ipynb)
{ url = "*.json", run = "rich-preview" }, # for json (.json) files
# { url = "*.lang_type", run = "rich-preview"} # for particular language files eg. .py, .go., .lua, etc.
]