diff --git a/README.md b/README.md index b6c9063..c4b8615 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,14 @@ If you don't make a backup files and lockfiles at remote server, it will be save ## Misc setting +Besides ~/.ssh/config, you can add connections manually. + + (setq counsel-tramp-custom-connections '(/ssh:domain|sudo:user@localhost:/)) + +Example when adding more than two connections manually. + + (setq counsel-tramp-custom-connections '(/ssh:domain|sudo:user@localhost:/ /ssh:domain2|sudo:user@localhost:/)) + If the shell of the server is zsh it is recommended to connect with bash. (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash")) diff --git a/counsel-tramp.el b/counsel-tramp.el index a0500bb..d1ce8ff 100644 --- a/counsel-tramp.el +++ b/counsel-tramp.el @@ -4,7 +4,7 @@ ;; Author: Masashı Mıyaura ;; URL: https://github.com/masasam/emacs-counsel-tramp -;; Version: 0.4.2 +;; Version: 0.5.2 ;; Package-Requires: ((emacs "24.3") (counsel "0.10")) ;; This program is free software; you can redistribute it and/or modify @@ -62,6 +62,11 @@ The hook is called with one argument that is non-nil." The hook is called with one argument that is non-nil." :type 'hook) +(defcustom counsel-tramp-custom-connections '() + "A list to manually add extra connections. +E.g.: '(\"/ssh:domain|sudo:user@localhost:/\")." + :type 'string) + (defun counsel-tramp-quit () "Quit counsel-tramp. Kill all remote buffers." @@ -76,7 +81,7 @@ Kill all remote buffers." (insert-file-contents "~/.ssh/config") (buffer-string)) "\n")) - (hosts (list))) + (hosts counsel-tramp-custom-connections)) (dolist (host source) (when (string-match "[H\\|h]ost +\\(.+?\\)$" host) (setq host (match-string 1 host))