summaryrefslogtreecommitdiff
path: root/mac/.config/yazi/plugins.bak/diff.yazi
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-09-13 17:14:51 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-09-13 17:14:51 +0900
commita3ed0a3cb36d192c37e040d0dfe57c42113f2161 (patch)
treec216d680c4bfbe2e53232af1496c9655e347d79b /mac/.config/yazi/plugins.bak/diff.yazi
parent2e6d3671d0e01ff5751893075e7fc5c53b288f95 (diff)
updates
Diffstat (limited to 'mac/.config/yazi/plugins.bak/diff.yazi')
-rw-r--r--mac/.config/yazi/plugins.bak/diff.yazi/README.md28
-rw-r--r--mac/.config/yazi/plugins.bak/diff.yazi/main.lua41
2 files changed, 0 insertions, 69 deletions
diff --git a/mac/.config/yazi/plugins.bak/diff.yazi/README.md b/mac/.config/yazi/plugins.bak/diff.yazi/README.md
deleted file mode 100644
index 1976541..0000000
--- a/mac/.config/yazi/plugins.bak/diff.yazi/README.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# diff.yazi
-
-Diff the selected file with the hovered file, create a living patch, and copy it to the clipboard.
-
-https://github.com/yazi-rs/plugins/assets/17523360/eff5e949-386a-44ea-82f9-4cb4a2c37aad
-
-## Installation
-
-```sh
-ya pkg add yazi-rs/plugins:diff
-```
-
-## Usage
-
-Add this to your `~/.config/yazi/keymap.toml`:
-
-```toml
-[[mgr.prepend_keymap]]
-on = "<C-d>"
-run = "plugin diff"
-desc = "Diff the selected with the hovered file"
-```
-
-Make sure the <kbd>C</kbd> + <kbd>d</kbd> key is not used elsewhere.
-
-## License
-
-This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
diff --git a/mac/.config/yazi/plugins.bak/diff.yazi/main.lua b/mac/.config/yazi/plugins.bak/diff.yazi/main.lua
deleted file mode 100644
index 21dde6d..0000000
--- a/mac/.config/yazi/plugins.bak/diff.yazi/main.lua
+++ /dev/null
@@ -1,41 +0,0 @@
---- @since 25.2.7
-
-local function info(content)
- return ya.notify {
- title = "Diff",
- content = content,
- timeout = 5,
- }
-end
-
-local selected_url = ya.sync(function()
- for _, u in pairs(cx.active.selected) do
- return u
- end
-end)
-
-local hovered_url = ya.sync(function()
- local h = cx.active.current.hovered
- return h and h.url
-end)
-
-return {
- entry = function()
- local a, b = selected_url(), hovered_url()
- if not a then
- return info("No file selected")
- elseif not b then
- return info("No file hovered")
- end
-
- local output, err = Command("diff"):arg("-Naur"):arg(tostring(a)):arg(tostring(b)):output()
- if not output then
- return info("Failed to run diff, error: " .. err)
- elseif output.stdout == "" then
- return info("No differences found")
- end
-
- ya.clipboard(output.stdout)
- info("Diff copied to clipboard")
- end,
-}