yazi play

This commit is contained in:
Matt Nish-Lapidus 2025-06-13 16:57:38 -04:00
parent 26225b7efb
commit a47c7afc26
2 changed files with 118 additions and 12 deletions

View file

@ -5,12 +5,55 @@ th.git = th.git or {}
th.git.modified_sign = "M"
th.git.deleted_sign = "D"
require("dir-rules"):setup()
require("restore"):setup({
position = { "center", w = 70, h = 40 },
show_confirm = true,
})
show_confirm = true })
local pref_by_location = require("pref-by-location")
pref_by_location:setup({
-- Disable this plugin completely.
-- disabled = false -- true|false (Optional)
-- Hide "enable" and "disable" notifications.
-- no_notify = false -- true|false (Optional)
-- You can backup/restore this file. But don't use same file in the different OS.
-- save_path = -- full path to save file (Optional)
-- - Linux/MacOS: os.getenv("HOME") .. "/.config/yazi/pref-by-location"
-- - Windows: os.getenv("APPDATA") .. "\\yazi\\config\\pref-by-location"
-- You don't have to set "prefs". Just use keymaps below work just fine
prefs = { -- (Optional)
-- location: String | Lua pattern (Required)
-- - Support literals full path, lua pattern (string.match pattern): https://www.lua.org/pil/20.2.html
-- And don't put ($) sign at the end of the location. %$ is ok.
-- - If you want to use special characters (such as . * ? + [ ] ( ) ^ $ %) in "location"
-- you need to escape them with a percent sign (%) or use a helper funtion `pref_by_location.is_literal_string`
-- Example: "/home/test/Hello (Lua) [world]" => { location = "/home/test/Hello %(Lua%) %[world%]", ....}
-- or { location = pref_by_location.is_literal_string("/home/test/Hello (Lua) [world]"), .....}
-- sort: {} (Optional) https://yazi-rs.github.io/docs/configuration/yazi#mgr.sort_by
-- - extension: "none"|"mtime"|"btime"|"extension"|"alphabetical"|"natural"|"size"|"random", (Optional)
-- - reverse: true|false (Optional)
-- - dir_first: true|false (Optional)
-- - translit: true|false (Optional)
-- - sensitive: true|false (Optional)
-- linemode: "none" |"size" |"btime" |"mtime" |"permissions" |"owner" (Optional) https://yazi-rs.github.io/docs/configuration/yazi#mgr.linemode
-- - Custom linemode also work. See the example below
-- show_hidden: true|false (Optional) https://yazi-rs.github.io/docs/configuration/yazi#mgr.show_hidden
-- Some examples:
-- Match any folder which has path start with "/mnt/remote/". Example: /mnt/remote/child/child2
-- { location = "^/mnt/remote/.*", sort = { "extension", reverse = false, dir_first = true, sensitive = false} },
-- Match any folder with name "Downloads"
{ location = ".*/Downloads", sort = { "btime", reverse = true, dir_first = true }, linemode = "btime" },
-- Match exact folder with absolute path "/home/test/Videos".
-- Use helper function `pref_by_location.is_literal_string` to prevent the case where the path contains special characters
-- { location = pref_by_location.is_literal_string("/home/test/Videos"), sort = { "btime", reverse = true, dir_first = true }, linemode = "btime" },
},
})
Status:children_add(function()
local h = cx.active.current.hovered