10

I recently started using Helm with the configuration below

(require 'helm-config)
(helm-mode 1)
(define-key global-map [remap occur] 'helm-occur)
(define-key global-map [remap list-buffers] 'helm-buffers-list)
(define-key global-map [remap dabbrev-expand] 'helm-dabbrev)
(global-set-key (kbd "M-x") 'helm-M-x)
(setq helm-M-x-fuzzy-match t)

Today I figured out that Tramp mode doesn't work anymore. When I try to open a file with C-x C-f and enter /sudo:root@TAB nothing happens. Usually I'd expect that localhost is substituted and tramp asks for a password.

How can I have a still functional tramp mode plus a working Helm?

Drew
  • 75,699
  • 9
  • 109
  • 225
Jens Kubieziel
  • 681
  • 10
  • 26

2 Answers2

5

the way it works for me is the following:

  1. call helm-find-files (usually C-xC-f)
  2. write /scp:
  3. if you have used tramp before you get a list with previous locations which you can select with C-j (or type a new remote by hand), pressing now C-j a second time or typing a : will connect you to the remote server
  4. now helm completion on the remote starts, type / if you want to be located in the root directory or ~, if you want to access your home directory
djames
  • 66
  • 1
1

Ok, this is an issue and it's odd Helm doesn't recognize the /ssh: as usual Emacs does with Tramp.

The way I worked around this is as follows.

With Helm you rewrite the C-x C-f command to use helm-find-files. What I did then is to remap this to another keybinding, one that is not in use. For instance, in my .emacs I did:

(global-set-key (kbd "C-x C-h") #'helm-find-files)`

I bound helm-find-files to C-x c-h whenever I want to use the helm files finder. Then with the usual C-x C-f I keep connecting with the remote servers or vm's using Tramp.

And the nice thing about this is that after you connect with Tramp, then using the helm-find-files works ok with the ssh remote connection.

Edit (another option):

Another option, and it's one I ended up doing is to remap the Emacs Elisp function find-file, usually bound to C-x C-f to a different keybinding, like this:

(global-set-key (kbd "C-x C-h") 'find-file)

And then the C-x C-f can be used by Helm with helm-find-file.

Stefan
  • 26,154
  • 3
  • 46
  • 84
MarkSkayff
  • 111
  • 4