From 0fef2abc09ecad36144f214e5b1a8e68116769b7 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sun, 11 Feb 2018 13:02:38 +0100 Subject: [PATCH] Allow loading ssh-keys using peco Signed-off-by: Knut Ahlers --- .zsh/peco.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.zsh/peco.sh b/.zsh/peco.sh index 4133b36..1704af7 100644 --- a/.zsh/peco.sh +++ b/.zsh/peco.sh @@ -11,6 +11,16 @@ function peco-kill-process() { } alias killp='peco-kill-process' +# load ssh-key +function peco-load-ssh-key() { + local keys + keys=$(vault list secret/ssh-key | tail -n+3 | peco --query "$LBUFFER") + if [ -n "${keys}" ]; then + echo "${keys}" | xargs vault-sshadd + fi +} +alias psshkey='peco-load-ssh-key' + # select history function peco-select-history() { local tac