diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-03 04:46:27 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-11-03 04:46:27 +0900 |
| commit | 52685ad6eec6cdc7cc763a785166929719d6a014 (patch) | |
| tree | 470e1296f0f9f5debc33ea0d008af379959aea42 | |
| parent | e924090e00636ab2aa5ab66fea6f8d6ee1a2ca7c (diff) | |
modified plugins/ssh.lua
| -rw-r--r-- | mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua index e9788e0..748191f 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua @@ -173,7 +173,14 @@ return { }) local api = require("remote-sshfs.api") vim.keymap.set("n", "<localleader>rc", api.connect, { desc = "Connect SSH" }) - vim.keymap.set("n", "<localleader>rd", api.disconnect, { desc = "Disconnect SSH" }) + vim.keymap.set("n", "<localleader>rd", function() + local mountpoint = vim.fn.getcwd() + local ok = vim.system({ "diskutil", "unmount", "force", mountpoint }):wait().code == 0 + if not ok then + ok = vim.system({ "umount", "-f", mountpoint }):wait().code == 0 + end + print(ok and ("✅ Unmounted: " .. mountpoint) or ("⚠️ Failed to unmount: " .. mountpoint)) + end, { desc = "Force unmount macFUSE mount (quiet)" }) vim.keymap.set("n", "<localleader>re", api.edit, { desc = "Edit SSH" }) -- (optional) Override telescope find_files and live_grep to make dynamic based on if connected to host |
