From c4e46a38d3a8d41bab5ac532ed367028b4dd0c3d Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Thu, 4 May 2023 17:47:31 +0200 Subject: add sshables command --- fnl/conf/init.fnl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fnl/conf/init.fnl b/fnl/conf/init.fnl index 881cbbe..1bcb1a7 100644 --- a/fnl/conf/init.fnl +++ b/fnl/conf/init.fnl @@ -31,6 +31,7 @@ (map :n : ":Telescope find_files") (map :n "`" ":FocusDispatch ") (map :n "`k" ":K9s ") + (map :n "`s" ":Ssh ") (map :n :p ":NewTab") (map :n :cf ":tabedit ~/flake|tc ~/flake|Go") (map :n :cn ":tabedit ~/neovim|tc ~/neovim|Go")) @@ -118,3 +119,16 @@ (vim.cmd (.. ":Start k9s --context " (. ctx.fargs 1)))) {:nargs 1}) + +(vim.api.nvim_create_user_command :Ssh + (fn [ctx] + (vim.cmd (.. ":Start ssh " (. ctx.fargs 1)))) + {:nargs 1 + :complete (fn [lead cmdline cursor] + (local p + (io.popen :get-sshables)) + (local lines + (icollect [line (p:lines)] + line)) + (p:close) + lines)}) -- cgit v1.2.3