From f6a7cc0e5c47e9e3f959afb3e25ecd88823843ed Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Mon, 8 Dec 2025 16:03:55 +0100 Subject: [PATCH] refactor: get rid of obsolete SSH stuff --- lua/weeheavy/remap.lua | 51 ------------------------------------------ 1 file changed, 51 deletions(-) diff --git a/lua/weeheavy/remap.lua b/lua/weeheavy/remap.lua index 853936f..6950919 100644 --- a/lua/weeheavy/remap.lua +++ b/lua/weeheavy/remap.lua @@ -120,54 +120,3 @@ vim.keymap.set("n", "p", ":TimerStart 30m", { desc = "Pomodoro" }) vim.keymap.set("n", "fc", function() require("treesitter-context").go_to_context(vim.v.count1) end, { silent = true }) - --- Claude wrote this SSH clusterfuck -local function get_ssh_hosts() - local known_hosts_path = vim.fn.expand("~/.ssh/known_hosts") - local hosts = {} - - if vim.fn.filereadable(known_hosts_path) == 1 then - local file = io.open(known_hosts_path, "r") - if file then - for line in file:lines() do - -- Parse known_hosts format: hostname[,hostname] key-type key [comment] - local host = line:match("^([^%s,]+)") - if host and not host:match("^#") and not host:match("^%|") then - -- Remove bracketed IP addresses and ports - host = host:gsub("%[(.-)%].*", "%1") - host = host:gsub(":.*", "") - if host ~= "" and not vim.tbl_contains(hosts, host) then - table.insert(hosts, host) - end - end - end - file:close() - end - end - - return hosts -end - -vim.keymap.set("n", "ss", function() - local hosts = get_ssh_hosts() - - if #hosts == 0 then - vim.notify("No SSH hosts found in ~/.ssh/known_hosts", vim.log.levels.WARN) - return - end - - require("fzf-lua").fzf_exec(hosts, { - prompt = "SSH target: ", - actions = { - ["default"] = function(selected) - if selected and #selected > 0 then - local host = selected[1] - local ssh_url = "oil-ssh://" .. host .. "/" - require("oil").open(ssh_url) - end - end, - }, - -- winopts = { height = 0.2, width = 0.2, row = 0.5, border = "single", treesitter = true }, - winopts = { height = 0.3, width = 0.5, row = 0.5, title = "Where do you want to go today?", backdrop = 100 }, - }) -end, { desc = "SSH to host" })