summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
authorMike Vink <mike.vink@stater.nl>2023-05-04 17:47:31 +0200
committerMike Vink <mike.vink@stater.nl>2023-05-04 17:47:31 +0200
commitc4e46a38d3a8d41bab5ac532ed367028b4dd0c3d (patch)
treee6ddf14c303fa8bf2b37ed4b8d8d1c0285e4b0d5 /fnl
parentfabd499cd49965a8cf3c8c69b7349d6981a8bd4b (diff)
add sshables command
Diffstat (limited to 'fnl')
-rw-r--r--fnl/conf/init.fnl14
1 files changed, 14 insertions, 0 deletions
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 :<c-p> ":Telescope find_files<cr>")
(map :n "`<Backspace>" ":FocusDispatch ")
(map :n "`k" ":K9s ")
+ (map :n "`s" ":Ssh ")
(map :n :<leader>p ":NewTab<cr>")
(map :n :<leader>cf ":tabedit ~/flake|tc ~/flake|G<cr><c-w>o")
(map :n :<leader>cn ":tabedit ~/neovim|tc ~/neovim|G<cr><c-w>o"))
@@ -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)})