1

I use ssh-mode when I need to work on remote hosts. As I only establish ssh connections to hosts, that are stored in my ssh config file I want this list of hosts to be displayed in a helm-buffer.

1

I have found How to write helm extensions. Only thing I had to do was return the list of known hosts with pcmpl-ssh-hosts for the helm-source.

(setq ssh-helm-source
      `((name . "Known hosts")
        (candidates . ,(pcmpl-ssh-hosts))
        (action . (lambda (candidate)
                    (helm-marked-candidates)))))

(defun helm-ssh ()
  (interactive)
  (ssh
   (mapconcat 'identity
              (helm :sources '(ssh-helm-source))
              ",")))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.