I often use ido for auto-completion and tramp to access remote server via ssh. My .emacs
includes the following lines:
(require 'tramp)
(setq tramp-default-method "ssh")
(ido-mode 1)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
I want to disable Ido completion, when i'm browsing contents of remote server. Note that variable ido-enable-tramp-completion
has nothing to do with my problem. Consider line /[email protected]#1234:/var/www/file.txt
. I need Ido not to deduct the part after the colon (remote file path), i don't care about the part before the colon. I use ssh, and Ido makes Emacs lag for a few seconds every time i run ido-find-file
, and when ssh timeout is over, Tramp tries to reconnect, asks me for a password and so on. This behavior is undesirable.
Emacs version - 24.0.94.1
Edit (20.03.12): After contact with Ido author I tried to change the ido-file-name-all-completions-1
to the following:
(defun ido-file-name-all-completions-1 (dir)
(cond
((ido-nonreadable-directory-p dir) '())
;; do not check (ido-directory-too-big-p dir) here.
;; Caller must have done that if necessary.
((and ido-enable-tramp-completion
(or (fboundp 'tramp-completion-mode-p)
(require 'tramp nil t))
(string-match "\\`/[^/]+[:@]\\'" dir))
;; TRAMP RELATED CODE DELETED
nil)
(t
(file-name-all-completions "" dir))))
No success. I then changed regex to
"\\`/[^/]+[:@]"
and it worked - Ido was disabled, when minibuffer contained that match. However as Ido couldn't see files on a remote server, it started calling ido-make-merged-file-list
to search for files in other directories every time i enter something. This made working with Ido on remote servers even more pain.
I also tried setting up variables ido-slow-ftp-hosts
and ido-slow-ftp-host-regexps
to /[email protected]#1234
, didn't help.
If you enter C-x C-f
again you temporally disable ido-find and fall back to the default find-file.
For more information C-h f ido-find-file RET
To do this every time ido found a colon, I guess you have to write your own function for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With