diff --git a/.gitmodules b/.gitmodules index 7ac98fa..faa9a5d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,9 +31,6 @@ [submodule "dot_config/yazi/plugins/starship.yazi"] path = dot_config/yazi/plugins/starship.yazi url = https://github.com/Rolv-Apneseth/starship.yazi -[submodule "dot_config/yazi/plugins/glow.yazi"] - path = dot_config/yazi/plugins/glow.yazi - url = https://github.com/Reledia/glow.yazi [submodule "dot_config/yazi/plugins/wl-clipboard.yazi"] path = dot_config/yazi/plugins/wl-clipboard.yazi url = https://github.com/grappas/wl-clipboard.yazi diff --git a/dot_config/yazi/plugins/core b/dot_config/yazi/plugins/core index 1962818..43c6978 160000 --- a/dot_config/yazi/plugins/core +++ b/dot_config/yazi/plugins/core @@ -1 +1 @@ -Subproject commit 196281844b8cbcac658a59013e4805300c2d6126 +Subproject commit 43c69783a674108472eadd5c1b81a3c4d9ff78b5 diff --git a/dot_config/yazi/plugins/glow.yazi b/dot_config/yazi/plugins/glow.yazi new file mode 160000 index 0000000..2da96e3 --- /dev/null +++ b/dot_config/yazi/plugins/glow.yazi @@ -0,0 +1 @@ +Subproject commit 2da96e3ffd9cd9d4dd53e0b2636f83ff69fe9af0 diff --git a/dot_config/yazi/plugins/glow.yazi/LICENSE b/dot_config/yazi/plugins/glow.yazi/LICENSE deleted file mode 100644 index de882e5..0000000 --- a/dot_config/yazi/plugins/glow.yazi/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright © 2024 Reledia - -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. diff --git a/dot_config/yazi/plugins/glow.yazi/README.md b/dot_config/yazi/plugins/glow.yazi/README.md deleted file mode 100644 index ba66ae7..0000000 --- a/dot_config/yazi/plugins/glow.yazi/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# glow.yazi - -Plugin for [Yazi](https://github.com/sxyazi/yazi) to preview markdown files with [glow](https://github.com/charmbracelet/glow). To install, run the below mentioned command: - -```bash -ya pack -a Reledia/glow -``` - -then include it in your `yazi.toml` to use: - -```toml -[plugin] -prepend_previewers = [ - { name = "*.md", run = "glow" }, -] -``` - -Make sure you have [glow](https://github.com/charmbracelet/glow) installed, and can be found in `PATH`. - -## Feature - -+ You can modify line wrap in `main.lua`, the current value is 55. -+ You can press `ctrl+e` to scroll up and `ctrl+y` to scroll down the readme file in preview panel in yazi: (add this to `keymap.toml`) -```toml -prepend_keymap = [ - # glow.yazi - { on = [""], run = "seek 5" }, - { on = [""], run = "seek -5" }, -] -``` diff --git a/dot_config/yazi/plugins/glow.yazi/main.lua b/dot_config/yazi/plugins/glow.yazi/main.lua deleted file mode 100644 index 8883feb..0000000 --- a/dot_config/yazi/plugins/glow.yazi/main.lua +++ /dev/null @@ -1,64 +0,0 @@ -local M = {} - -function M:peek(job) - -- Set a fixed width of 50 characters for the preview - local preview_width = 55 - - local child = Command("glow") - :args({ - "--style", - "dark", - "--width", - tostring(preview_width), -- Use fixed width instead of job.area.w - tostring(job.file.url), - }) - :env("CLICOLOR_FORCE", "1") - :stdout(Command.PIPED) - :stderr(Command.PIPED) - :spawn() - - if not child then - return require("code").peek(job) - end - - local limit = job.area.h - local i, lines = 0, "" - repeat - local next, event = child:read_line() - if event == 1 then - return require("code").peek(job) - elseif event ~= 0 then - break - end - - i = i + 1 - if i > job.skip then - lines = lines .. next - end - until i >= job.skip + limit - - child:start_kill() - if job.skip > 0 and i < job.skip + limit then - ya.mgr_emit("peek", { - tostring(math.max(0, i - limit)), - only_if = job.file.url, - upper_bound = true - }) - else - lines = lines:gsub("\t", string.rep(" ", rt.preview.tab_size)) - ya.preview_widgets(job, { ui.Text.parse(lines):area(job.area) }) - end -end - -function M:seek(job) - local h = cx.active.current.hovered - if not h or h.url ~= job.file.url then - return - end - ya.mgr_emit('peek', { - math.max(0, cx.active.preview.skip + job.units), - only_if = job.file.url, - }) -end - -return M diff --git a/dot_config/yazi/plugins/ouch.yazi b/dot_config/yazi/plugins/ouch.yazi index 594b8a2..406ce6c 160000 --- a/dot_config/yazi/plugins/ouch.yazi +++ b/dot_config/yazi/plugins/ouch.yazi @@ -1 +1 @@ -Subproject commit 594b8a2b246633d46b03a3261c9aebd1c4b5abf3 +Subproject commit 406ce6c13ec3a18d4872b8f64b62f4a530759b2c diff --git a/dot_config/yazi/plugins/starship.yazi b/dot_config/yazi/plugins/starship.yazi index eca1861..a837101 160000 --- a/dot_config/yazi/plugins/starship.yazi +++ b/dot_config/yazi/plugins/starship.yazi @@ -1 +1 @@ -Subproject commit eca186171c5f2011ce62712f95f699308251c749 +Subproject commit a83710153ab5625a64ef98d55e6ddad480a3756f diff --git a/dot_config/yazi/plugins/wl-clipboard.yazi b/dot_config/yazi/plugins/wl-clipboard.yazi index e9a38e4..8cc5524 160000 --- a/dot_config/yazi/plugins/wl-clipboard.yazi +++ b/dot_config/yazi/plugins/wl-clipboard.yazi @@ -1 +1 @@ -Subproject commit e9a38e47d07549968019702bdafdc4ed07151b7d +Subproject commit 8cc55242dbbc0b60fde27ab0d17bf11d91a14e14