mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
fix(yazi): nvim env
This commit is contained in:
parent
57314ec659
commit
ed917492f1
@ -1,7 +1,6 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
typeset -U PATH path
|
typeset -U PATH path
|
||||||
|
|
||||||
|
|
||||||
# profile file. Runs on login. Environmental variables are set here.
|
# profile file. Runs on login. Environmental variables are set here.
|
||||||
|
|
||||||
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
|
# If you don't plan on reverting to bash, you can remove the link in ~/.profile
|
||||||
@ -20,7 +19,6 @@ export LIBSEAT_BACKEND=logind
|
|||||||
|
|
||||||
unsetopt PROMPT_SP
|
unsetopt PROMPT_SP
|
||||||
|
|
||||||
|
|
||||||
# Default Apps
|
# Default Apps
|
||||||
export BROWSER="floorp"
|
export BROWSER="floorp"
|
||||||
export EDITOR="nvim"
|
export EDITOR="nvim"
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
"$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
|
"$schema" = "https://yazi-rs.github.io/schemas/keymap.json"
|
||||||
|
|
||||||
[manager]
|
[manager]
|
||||||
|
|
||||||
keymap = [
|
keymap = [
|
||||||
{on = [ "<Esc>" ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search"},
|
{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 = [ "<C-[>" ], run = "escape", desc = "Exit visual mode, clear selected, or cancel search"},
|
||||||
@ -153,8 +152,8 @@ keymap = [
|
|||||||
]
|
]
|
||||||
prepend_keymap = [
|
prepend_keymap = [
|
||||||
# Custom
|
# Custom
|
||||||
{on = [ "y" ], run = [ ''' shell 'fd -a "$1" | xclip -selection clipboard' --confirm ''', "yank" ], desc = "Yank the selected files"},
|
{on = [ "y" ], run = [ 'shell -- echo "$@" | xclip -selection clipboard', "yank" ], desc = "Yank the selected files"},
|
||||||
{on = [ "y" ], run = [ ''' shell 'fd -a "$1" | wl-copy' --confirm ''', "yank" ], desc = "Yank the selected files"},
|
{on = [ "y" ], run = [ 'shell -- for path in "$@"; do echo "file://$path"; done | wl-copy -t text/uri-list', "yank" ], desc = "Yank the selected files"},
|
||||||
{on = [ "b", "g" ], run = [ ''' shell 'setbg "$1"' --confirm ''' ], desc = "Set the background image"},
|
{on = [ "b", "g" ], run = [ ''' shell 'setbg "$1"' --confirm ''' ], desc = "Set the background image"},
|
||||||
# vidir
|
# vidir
|
||||||
{on = "B", run = [ "escape --visual", "plugin --sync vidir" ], desc = "Bulk rename with vidir"},
|
{on = "B", run = [ "escape --visual", "plugin --sync vidir" ], desc = "Bulk rename with vidir"},
|
||||||
@ -169,8 +168,8 @@ prepend_keymap = [
|
|||||||
{on = [ "R" ], run = "plugin augment-command -- rename", desc = "Rename a file or directory"},
|
{on = [ "R" ], run = "plugin augment-command -- rename", desc = "Rename a file or directory"},
|
||||||
{on = [ "D" ], run = "plugin augment-command -- remove --permanently", desc = "Permanently delete the files"},
|
{on = [ "D" ], run = "plugin augment-command -- remove --permanently", desc = "Permanently delete the files"},
|
||||||
# Dragon
|
# Dragon
|
||||||
{on = [ "m", "a" ], run = ''' shell 'ripdrag -atk "$@"' --confirm ''', desc = "Drag and drop all"},
|
{on = [ "m", "m" ], run = 'shell -- ripdrag -atk "$@"', desc = "Drag and drop all"},
|
||||||
{on = [ "m", "i" ], run = ''' shell 'ripdrag -tk "$@"' --confirm ''', desc = "Drag and drop individual"},
|
{on = "<C-n>", run = 'shell -- ripdrag -atk "$@"', desc = "Drag and drop all"},
|
||||||
# Max Preview
|
# Max Preview
|
||||||
{on = "T", run = "plugin --sync max-preview", desc = "Maximize or restore preview"},
|
{on = "T", run = "plugin --sync max-preview", desc = "Maximize or restore preview"},
|
||||||
# Hide Preview
|
# Hide Preview
|
||||||
|
|||||||
@ -10,8 +10,8 @@ hash = "23915860e59348bf4166778bb0e606f7"
|
|||||||
|
|
||||||
[[plugin.deps]]
|
[[plugin.deps]]
|
||||||
use = "hankertrix/augment-command"
|
use = "hankertrix/augment-command"
|
||||||
rev = "91ba6c5"
|
rev = "04cda98"
|
||||||
hash = "6ac13898ec80c623e2d9ea90b947c86a"
|
hash = "3ec6486539188b1e1932ac27f3582917"
|
||||||
|
|
||||||
[[plugin.deps]]
|
[[plugin.deps]]
|
||||||
use = "kirasok/torrent-preview"
|
use = "kirasok/torrent-preview"
|
||||||
@ -53,11 +53,6 @@ use = "yazi-rs/plugins:smart-filter"
|
|||||||
rev = "864a021"
|
rev = "864a021"
|
||||||
hash = "f0c4b41b5d19a3144958383333eff6e7"
|
hash = "f0c4b41b5d19a3144958383333eff6e7"
|
||||||
|
|
||||||
[[plugin.deps]]
|
|
||||||
use = "yazi-rs/plugins:mime-ext"
|
|
||||||
rev = "864a021"
|
|
||||||
hash = "5e24c167e9ae9a203a48f2a438b8c705"
|
|
||||||
|
|
||||||
[[plugin.deps]]
|
[[plugin.deps]]
|
||||||
use = "yazi-rs/plugins:diff"
|
use = "yazi-rs/plugins:diff"
|
||||||
rev = "864a021"
|
rev = "864a021"
|
||||||
|
|||||||
@ -403,7 +403,7 @@ local bat_command_pattern = "%f[%a]bat%f[%A]"
|
|||||||
--
|
--
|
||||||
-- Pass true as the first parameter to get the function
|
-- Pass true as the first parameter to get the function
|
||||||
-- to merge the tables recursively.
|
-- to merge the tables recursively.
|
||||||
---@param deep_or_target table<any, any>|boolean Whether to merge recursively
|
---@param deep_or_target table<any, any>|boolean|nil Recursively merge or not
|
||||||
---@param target table<any, any> The target table to merge
|
---@param target table<any, any> The target table to merge
|
||||||
---@param ... table<any, any>[] The tables to merge
|
---@param ... table<any, any>[] The tables to merge
|
||||||
---@return table<any, any> merged_table The merged table
|
---@return table<any, any> merged_table The merged table
|
||||||
@ -419,13 +419,13 @@ local function merge_tables(deep_or_target, target, ...)
|
|||||||
-- Initialise the recursive variable
|
-- Initialise the recursive variable
|
||||||
local recursive = false
|
local recursive = false
|
||||||
|
|
||||||
-- If the deep or target variable not a table
|
-- If the deep or target variable is a boolean
|
||||||
if type(deep_or_target) ~= "table" then
|
if type(deep_or_target) == "boolean" then
|
||||||
--
|
--
|
||||||
|
|
||||||
-- Set the recursive variable to the boolean value of the
|
-- Set the recursive variable to the boolean value of the
|
||||||
-- deep or target variable
|
-- deep or target variable
|
||||||
recursive = not not deep_or_target
|
recursive = deep_or_target
|
||||||
|
|
||||||
-- Set the target table to the target variable
|
-- Set the target table to the target variable
|
||||||
target_table = target
|
target_table = target
|
||||||
@ -433,12 +433,14 @@ local function merge_tables(deep_or_target, target, ...)
|
|||||||
-- Set the arguments to the rest of the arguments
|
-- Set the arguments to the rest of the arguments
|
||||||
args = { ... }
|
args = { ... }
|
||||||
|
|
||||||
-- Otherwise, the deep or target variable is a table
|
-- Otherwise, the deep or target variable is not a boolean,
|
||||||
|
-- and is most likely a table.
|
||||||
else
|
else
|
||||||
--
|
--
|
||||||
|
|
||||||
-- Set the target table to the deep or target variable
|
-- Set the target table to the deep or target variable
|
||||||
target_table = deep_or_target
|
-- if it is a table, otherwise, set it to an empty table
|
||||||
|
target_table = type(deep_or_target) == "table" and deep_or_target or {}
|
||||||
|
|
||||||
-- Set the arguments to the target variable
|
-- Set the arguments to the target variable
|
||||||
-- and the rest of the arguments
|
-- and the rest of the arguments
|
||||||
@ -1570,6 +1572,9 @@ function SevenZip:retry_extractor(extractor_function, clean_up_wanted)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Clean up the extracted files
|
||||||
|
clean_up()
|
||||||
|
|
||||||
-- Set the error message to the standard error
|
-- Set the error message to the standard error
|
||||||
error_message = output.stderr
|
error_message = output.stderr
|
||||||
|
|
||||||
@ -1585,9 +1590,6 @@ function SevenZip:retry_extractor(extractor_function, clean_up_wanted)
|
|||||||
then
|
then
|
||||||
--
|
--
|
||||||
|
|
||||||
-- Clean up the extracted files
|
|
||||||
clean_up()
|
|
||||||
|
|
||||||
-- Return the extractor function result
|
-- Return the extractor function result
|
||||||
return {
|
return {
|
||||||
successful = false,
|
successful = false,
|
||||||
@ -1627,13 +1629,10 @@ function SevenZip:retry_extractor(extractor_function, clean_up_wanted)
|
|||||||
if event == 1 and user_input ~= nil then
|
if event == 1 and user_input ~= nil then
|
||||||
self.password = user_input
|
self.password = user_input
|
||||||
|
|
||||||
-- Otherwise
|
-- Otherwise, the user has cancelled the input
|
||||||
else
|
else
|
||||||
--
|
--
|
||||||
|
|
||||||
-- Call the clean up function
|
|
||||||
clean_up()
|
|
||||||
|
|
||||||
-- Return the result of the extractor command
|
-- Return the result of the extractor command
|
||||||
return {
|
return {
|
||||||
successful = false,
|
successful = false,
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
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.
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
# mime-ext.yazi
|
|
||||||
|
|
||||||
A mime-type provider based on a file extension database, replacing the [builtin `file(1)`](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/mime.lua) to speed up mime-type retrieval at the expense of accuracy.
|
|
||||||
|
|
||||||
See https://yazi-rs.github.io/docs/tips#make-yazi-even-faster for more information.
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```sh
|
|
||||||
ya pack -a yazi-rs/plugins:mime-ext
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Add this to your `~/.config/yazi/yazi.toml`:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[[plugin.prepend_fetchers]]
|
|
||||||
id = "mime"
|
|
||||||
name = "*"
|
|
||||||
run = "mime-ext"
|
|
||||||
prio = "high"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Advanced
|
|
||||||
|
|
||||||
You can also customize it in your `~/.config/yazi/init.lua` with:
|
|
||||||
|
|
||||||
```lua
|
|
||||||
require("mime-ext"):setup {
|
|
||||||
-- Expand the existing filename database (lowercase), for example:
|
|
||||||
with_files = {
|
|
||||||
makefile = "text/makefile",
|
|
||||||
-- ...
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Expand the existing extension database (lowercase), for example:
|
|
||||||
with_exts = {
|
|
||||||
mk = "text/makefile",
|
|
||||||
-- ...
|
|
||||||
},
|
|
||||||
|
|
||||||
-- If the mime-type is not in both filename and extension databases,
|
|
||||||
-- then fallback to Yazi's preset `mime` plugin, which uses `file(1)`
|
|
||||||
fallback_file1 = false,
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
|
|
||||||
- Add more file types (PRs welcome!).
|
|
||||||
- Compress mime-type tables.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -14,11 +14,13 @@ show_symlink = true
|
|||||||
scrolloff = 8
|
scrolloff = 8
|
||||||
|
|
||||||
[preview]
|
[preview]
|
||||||
|
wrap = "yes"
|
||||||
tab_size = 2
|
tab_size = 2
|
||||||
max_width = 600
|
max_width = 600
|
||||||
max_height = 900
|
max_height = 900
|
||||||
cache_dir = ""
|
cache_dir = ""
|
||||||
image_filter = "triangle"
|
image_filter = "triangle"
|
||||||
|
image_delay = 0
|
||||||
image_quality = 75
|
image_quality = 75
|
||||||
sixel_fraction = 15
|
sixel_fraction = 15
|
||||||
ueberzug_scale = 1
|
ueberzug_scale = 1
|
||||||
@ -26,7 +28,7 @@ ueberzug_offset = [ 0, 0, 0, 0 ]
|
|||||||
|
|
||||||
[opener]
|
[opener]
|
||||||
edit = [
|
edit = [
|
||||||
{run = '${EDITOR:=vim} "$@"', desc = "$EDITOR", block = true, for = "unix"},
|
{run = '/usr/bin/nvim "$@"', desc = "$EDITOR", block = true, for = "unix"},
|
||||||
{run = 'code "%*"', orphan = true, desc = "code", for = "windows"},
|
{run = 'code "%*"', orphan = true, desc = "code", for = "windows"},
|
||||||
{run = 'code -w "%*"', block = true, desc = "code (block)", for = "windows"},
|
{run = 'code -w "%*"', block = true, desc = "code (block)", for = "windows"},
|
||||||
]
|
]
|
||||||
@ -35,7 +37,6 @@ open = [
|
|||||||
{run = 'open "$@"', desc = "Open", for = "macos"},
|
{run = 'open "$@"', desc = "Open", for = "macos"},
|
||||||
{run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows"},
|
{run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows"},
|
||||||
]
|
]
|
||||||
|
|
||||||
reveal = [
|
reveal = [
|
||||||
{run = 'xdg-open "$(dirname "$0")"', desc = "Reveal", for = "linux"},
|
{run = 'xdg-open "$(dirname "$0")"', desc = "Reveal", for = "linux"},
|
||||||
{run = 'open -R "$1"', desc = "Reveal", for = "macos"},
|
{run = 'open -R "$1"', desc = "Reveal", for = "macos"},
|
||||||
@ -54,16 +55,23 @@ play = [
|
|||||||
|
|
||||||
[open]
|
[open]
|
||||||
rules = [
|
rules = [
|
||||||
|
# Folder
|
||||||
{name = "*/", use = [ "edit", "open", "reveal" ]},
|
{name = "*/", use = [ "edit", "open", "reveal" ]},
|
||||||
|
# Text
|
||||||
{mime = "text/*", use = [ "edit", "reveal" ]},
|
{mime = "text/*", use = [ "edit", "reveal" ]},
|
||||||
{mime = "image/*", use = [ "reveal" ]},
|
# Image
|
||||||
|
{mime = "image/*", use = [ "open", "reveal" ]},
|
||||||
|
# Media
|
||||||
{mime = "{audio,video}/*", use = [ "play", "reveal" ]},
|
{mime = "{audio,video}/*", use = [ "play", "reveal" ]},
|
||||||
{mime = "inode/x-empty", use = [ "edit", "reveal" ]},
|
# Archive
|
||||||
{mime = "application/*zip", use = [ "extract", "reveal" ]},
|
{mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", use = [ "extract", "reveal" ]},
|
||||||
{mime = "application/x-{tar,bzip*,7z-compressed,xz,rar}", use = [ "extract", "reveal" ]},
|
# JSON
|
||||||
{mime = "application/json", use = [ "edit", "reveal" ]},
|
{mime = "application/{json,ndjson}", use = [ "edit", "reveal" ]},
|
||||||
{mime = "*/javascript", use = [ "edit", "reveal" ]},
|
{mime = "*/javascript", use = [ "edit", "reveal" ]},
|
||||||
{mime = "*", use = [ "open", "reveal" ]},
|
# Empty file
|
||||||
|
{mime = "inode/empty", use = [ "edit", "reveal" ]},
|
||||||
|
# Fallback
|
||||||
|
{name = "*", use = [ "open", "reveal" ]},
|
||||||
]
|
]
|
||||||
|
|
||||||
[tasks]
|
[tasks]
|
||||||
@ -75,7 +83,6 @@ image_bound = [ 0, 0 ]
|
|||||||
suppress_preload = false
|
suppress_preload = false
|
||||||
|
|
||||||
[plugin]
|
[plugin]
|
||||||
|
|
||||||
preloaders = [
|
preloaders = [
|
||||||
{mime = "image/*", run = "image"},
|
{mime = "image/*", run = "image"},
|
||||||
{mime = "video/*", run = "video"},
|
{mime = "video/*", run = "video"},
|
||||||
@ -135,7 +142,6 @@ append_previewers = [
|
|||||||
prepend_fetchers = [
|
prepend_fetchers = [
|
||||||
{id = "git", name = "*", run = "git"},
|
{id = "git", name = "*", run = "git"},
|
||||||
{id = "git", name = "*/", run = "git"},
|
{id = "git", name = "*/", run = "git"},
|
||||||
{id = "mime", name = "*", run = "mime-ext", prio = "high"},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user