mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-02-04 06:32:03 +00:00
Update 2025-08-07
This commit is contained in:
@@ -32,6 +32,7 @@ plugin.
|
||||
- [Arrow (`arrow`)](#arrow-arrow)
|
||||
- [New commands](#new-commands)
|
||||
- [Parent arrow (`parent_arrow`)](#parent-arrow-parent_arrow)
|
||||
- [First file (`first_file`)](#first-file-first_file)
|
||||
- [Archive (`archive`)](#archive-archive)
|
||||
- [Emit (`emit`)](#emit-emit)
|
||||
- [Editor (`editor`)](#editor-editor)
|
||||
@@ -995,6 +996,33 @@ in your `keymap.toml` file.
|
||||
wrapping around,
|
||||
even when `wraparound_file_navigation` is set to `true`.
|
||||
|
||||
### First file (`first_file`)
|
||||
|
||||
- This command just moves the cursor to the first file
|
||||
in the current directory, regardless of the current cursor position.
|
||||
- It is useful for quickly getting to the first file
|
||||
in the current directory when `sort_dir_first` is set to `true`,
|
||||
which is the case by default.
|
||||
|
||||
Video:
|
||||
|
||||
[first-file-video]
|
||||
|
||||
- It also works with smooth scrolling, so when `smooth_scrolling`
|
||||
is set to `true`, the command will smoothly scroll the cursor
|
||||
to the first file.
|
||||
|
||||
Video:
|
||||
|
||||
[smooth-first-file-video]
|
||||
|
||||
- Alternatively, if you just want to get to a file
|
||||
in the current directory, you can use the built-in `G` key bind
|
||||
that calls `arrow bot` to get to the last item
|
||||
in the current directory, which would be a file
|
||||
if `sort_dir_first` is set to `true`,
|
||||
which is the case by default.
|
||||
|
||||
### Archive (`archive`)
|
||||
|
||||
- The `archive` command adds the selected or hovered items
|
||||
@@ -1410,7 +1438,7 @@ and [my `yazi.toml` file][my-yazi-toml].
|
||||
|
||||
## [Licence]
|
||||
|
||||
This plugin is licenced under the [GNU AGPL v3 licence][Licence].
|
||||
This plugin is licensed under the [GNU AGPL v3 licence][Licence].
|
||||
You can view the full licence in the [`LICENSE`][Licence] file.
|
||||
|
||||
<!-- Regular links -->
|
||||
@@ -1426,15 +1454,15 @@ You can view the full licence in the [`LICENSE`][Licence] file.
|
||||
[gnu-tar-link]: https://www.gnu.org/software/tar/
|
||||
[apple-tar-link]: https://ss64.com/mac/tar.html
|
||||
[brew-link]: https://brew.sh/
|
||||
[yazi-yazi-toml-extract-openers]: https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/yazi-default.toml#L51-L54
|
||||
[yazi-yazi-toml-extract-openers]: https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/yazi-default.toml#L50-L53
|
||||
[yazi-yazi-toml]: https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/yazi-default.toml
|
||||
[yazi-shell-variables]: https://yazi-rs.github.io/docs/configuration/keymap/#manager.shell
|
||||
[thunderbird-tip]: https://yazi-rs.github.io/docs/tips#email-selected-files-using-thunderbird
|
||||
[yazi-shell-variables]: https://yazi-rs.github.io/docs/configuration/keymap/#mgr.shell
|
||||
[thunderbird-tip]: https://yazi-rs.github.io/docs/tips/#email-selected-files
|
||||
[input-configuration]: https://yazi-rs.github.io/docs/configuration/yazi#input
|
||||
[confirm-configuration]: https://yazi-rs.github.io/docs/configuration/yazi#confirm
|
||||
[yazi-keymap-toml]: https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/keymap-default.toml
|
||||
[my-keymap-toml]: https://github.com/hankertrix/Dotfiles/blob/main/.config/yazi/keymap.toml
|
||||
[my-yazi-toml]: https://github.com/hankertrix/Dotfiles/blob/main/.config/yazi/yazi.toml
|
||||
[my-keymap-toml]: https://github.com/hankertrix/Dotfiles/blob/main/tilde/dot_config/yazi/keymap.toml.tmpl
|
||||
[my-yazi-toml]: https://github.com/hankertrix/Dotfiles/blob/main/tilde/dot_config/yazi/yazi.toml
|
||||
[Licence]: LICENSE
|
||||
|
||||
<!-- Videos -->
|
||||
@@ -1532,6 +1560,11 @@ You can view the full licence in the [`LICENSE`][Licence] file.
|
||||
[wraparound-parent-arrow-video]: https://github.com/user-attachments/assets/ce35b55f-98dc-485d-a5e4-005ebe3ea169
|
||||
[smooth-wraparound-parent-arrow-video]: https://github.com/user-attachments/assets/5256f0c5-b96b-4f4c-ac1d-f4a3f087cc57
|
||||
|
||||
<!-- First file command -->
|
||||
|
||||
[first-file-video]: https://github.com/user-attachments/assets/4b4a1e6d-b013-47b5-919f-90279977fd98
|
||||
[smooth-first-file-video]: https://github.com/user-attachments/assets/f4c9c191-fa9f-428e-87e2-9bf654e60f72
|
||||
|
||||
<!-- Archive command -->
|
||||
|
||||
[archive-must-have-hovered-item-video]: https://github.com/user-attachments/assets/a49929b3-3b0d-4a50-b5d6-9dae7c119e7e
|
||||
|
||||
@@ -131,6 +131,7 @@ local Commands = {
|
||||
Emit = "emit",
|
||||
Editor = "editor",
|
||||
Pager = "pager",
|
||||
FirstFile = "first_file",
|
||||
}
|
||||
|
||||
-- The enum for which group of items to operate on
|
||||
@@ -4233,6 +4234,56 @@ local function handle_parent_arrow(args, config)
|
||||
)
|
||||
end
|
||||
|
||||
-- Function to execute the first file command
|
||||
---@type fun(): nil
|
||||
local execute_first_file = ya.sync(function()
|
||||
--
|
||||
|
||||
-- Get the current working directory
|
||||
local current = cx.active.current
|
||||
|
||||
-- Get the files in the current working directory
|
||||
local files = current.files
|
||||
|
||||
-- Initialise the index of the first file
|
||||
local first_file_index = nil
|
||||
|
||||
-- Iterate over the files
|
||||
for index, file in ipairs(files) do
|
||||
--
|
||||
|
||||
-- If the file isn't a directory,
|
||||
if not file.cha.is_dir then
|
||||
--
|
||||
|
||||
-- Set the first file index
|
||||
first_file_index = index
|
||||
|
||||
-- Break out of the loop
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- Get the amount to move the cursor by.
|
||||
--
|
||||
-- The cursor index needs to be increased by 1
|
||||
-- because the cursor index is 0-indexed
|
||||
-- while Lua tables are 1-indexed.
|
||||
local move_by = first_file_index - (current.cursor + 1)
|
||||
|
||||
-- Emit the augmented arrow command
|
||||
emit_augmented_command("arrow", { move_by })
|
||||
end)
|
||||
|
||||
-- Function to handle the first file command
|
||||
---@type CommandFunction
|
||||
local function handle_first_file()
|
||||
--
|
||||
|
||||
-- Call the function to execute the first file command
|
||||
execute_first_file()
|
||||
end
|
||||
|
||||
-- Function to check if an archive supports header encryption
|
||||
---@param archive_path string The path to the archive
|
||||
---@param wanted boolean Whether header encryption is wanted
|
||||
@@ -4666,6 +4717,7 @@ local function run_command_func(command, args, config)
|
||||
[Commands.Quit] = handle_quit,
|
||||
[Commands.Arrow] = handle_arrow,
|
||||
[Commands.ParentArrow] = handle_parent_arrow,
|
||||
[Commands.FirstFile] = handle_first_file,
|
||||
[Commands.Archive] = handle_archive,
|
||||
[Commands.Emit] = handle_emit,
|
||||
[Commands.Editor] = handle_editor,
|
||||
|
||||
@@ -34,7 +34,7 @@ using `ffmpeg` if available and media metadata using `mediainfo`.
|
||||

|
||||
|
||||
- SVG+XML file doesn't have useful information, so it only show the image preview.
|
||||
- There are more file extensions which are supported by mediainfo. Just add file's MIME type to `previewers`, `preloaders`.
|
||||
- There are more file extensions which are supported by mediainfo. Just add file's MIME type to `prepend_previewers`, `prepend_preloaders`.
|
||||
Use `spotter` to determine File's MIME type. [Default is `<Tab>` key](https://github.com/sxyazi/yazi/blob/1a6abae974370702c8865459344bf256de58359e/yazi-config/preset/keymap-default.toml#L59)
|
||||
|
||||
## Installation
|
||||
@@ -58,8 +58,10 @@ using `ffmpeg` if available and media metadata using `mediainfo`.
|
||||
|
||||
## Configuration:
|
||||
|
||||
> [!IMPORTANT] > `mediainfo` use video, image, svg, magick built-in plugins behind the scene to render preview image, song cover.
|
||||
> So you can remove those 3 plugins from `preloaders` and `previewers` sections in `yazi.toml`.
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> `mediainfo` use built-in video, image, svg, magick plugins behind the scene to render preview image, song cover.
|
||||
> So you can remove those 4 plugins from `prepend_preloaders` and `prepend_previewers` sections in `yazi.toml`.
|
||||
|
||||
If you have cache problem, run this cmd, and follow the tips: `yazi --clear-cache`
|
||||
|
||||
@@ -67,25 +69,36 @@ Config folder for each OS: https://yazi-rs.github.io/docs/configuration/overview
|
||||
|
||||
Create `.../yazi/yazi.toml` and add:
|
||||
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> For yazi nightly replace `name` with `url`
|
||||
|
||||
```toml
|
||||
[plugin]
|
||||
prepend_preloaders = [
|
||||
# Replace magick, image, video with mediainfo
|
||||
{ mime = "{audio,video,image}/*", run = "mediainfo" },
|
||||
{ mime = "application/subrip", run = "mediainfo" },
|
||||
# Adobe Illustrator
|
||||
# Adobe Illustrator, Adobe Photoshop is image/adobe.photoshop, already handled above
|
||||
{ mime = "application/postscript", run = "mediainfo" },
|
||||
]
|
||||
prepend_previewers = [
|
||||
# Replace magick, image, video with mediainfo
|
||||
{ mime = "{audio,video,image}/*", run = "mediainfo"},
|
||||
{ mime = "application/subrip", run = "mediainfo" },
|
||||
# Adobe Illustrator
|
||||
# Adobe Illustrator, Adobe Photoshop is image/adobe.photoshop, already handled above
|
||||
{ mime = "application/postscript", run = "mediainfo" },
|
||||
]
|
||||
# There are more extensions which are supported by mediainfo.
|
||||
# Just add file's MIME type to `previewers`, `preloaders` above.
|
||||
# https://mediaarea.net/en/MediaInfo/Support/Formats
|
||||
|
||||
# For a large file like Adobe Illustrator, Adobe Photoshop, etc
|
||||
# you may need to increase the memory limit if no image is rendered.
|
||||
# https://yazi-rs.github.io/docs/configuration/yazi#tasks
|
||||
[tasks]
|
||||
image_alloc = 1073741824 # = 1024*1024*1024 = 1024MB
|
||||
|
||||
```
|
||||
|
||||
## Custom theme
|
||||
|
||||
@@ -165,7 +165,8 @@ function M:peek(job)
|
||||
or (is_video and job.skip >= 90)
|
||||
or (
|
||||
(job.mime == "image/adobe.photoshop" or job.mime == "application/postscript")
|
||||
and image_layer_count(job) < (1 + math.floor(math.max(0, job.skip / (get_state("units") or 0))))
|
||||
and image_layer_count(job)
|
||||
< (1 + math.floor(math.max(0, get_state("units") and (job.skip / get_state("units")) or 0)))
|
||||
)
|
||||
)
|
||||
then
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
>
|
||||
> To install it with `ya` run:
|
||||
> ```sh
|
||||
> ya pack -a macydnah/office
|
||||
> ya pkg add macydnah/office
|
||||
> ```
|
||||
|
||||
> Or if you prefer a manual approach:
|
||||
|
||||
@@ -43,6 +43,7 @@ local function entry()
|
||||
elseif event == 1 then
|
||||
ya.emit("escape", { filter = true })
|
||||
ya.emit(h.is_dir and "enter" or "open", { h.url })
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Kristofers Solo
|
||||
|
||||
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.
|
||||
@@ -1,29 +0,0 @@
|
||||
# vidir.yazi
|
||||
|
||||
This plugin is a bulk-rename plugin using [vidir](https://linux.die.net/man/1/vidir).
|
||||
|
||||
## Requirements
|
||||
|
||||
- [yazi >= v25.2.7](https://github.com/sxyazi/yazi)
|
||||
- [vidir](https://linux.die.net/man/1/vidir) (sometimes included in [moreutils](https://man.archlinux.org/listing/extra/moreutils/) package)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
ya pack -a kristoferssolo/vidir
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Add this to your `~/.config/yazi/keymap.toml`:
|
||||
|
||||
```toml
|
||||
[[manager.prepend_keymap]]
|
||||
on = "B"
|
||||
run = [ "escape --visual", "plugin --sync vidir" ]
|
||||
desc = "Bulk rename with vidir"
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
|
||||
@@ -1,9 +0,0 @@
|
||||
--- @sync entry
|
||||
--- @since 25.2.7
|
||||
|
||||
return {
|
||||
entry = function()
|
||||
-- If no selection, use current directory (.)
|
||||
ya.manager_emit("shell", { "vidir .", block = true, confirm = true })
|
||||
end,
|
||||
}
|
||||
Reference in New Issue
Block a user