17

I've been using Tramp mode on my Emacs to edit files remotely. I'm also using ido mode. When I add a new file in the same directory of a file I opened using Tramp, I couldn't get Tramp to find the new file(with C-x C-f). Is there a way to refresh Tramp?

liangzan
  • 6,804
  • 4
  • 29
  • 28

2 Answers2

29

Your question is about ido-mode used with tramp. To refresh ido auto-complete while in the process of finding a file, you can press C-l, to execute: ido-reread-directory.

trey-jones
  • 3,329
  • 1
  • 27
  • 35
killdash9
  • 2,314
  • 2
  • 23
  • 17
  • 1
    Worked for me once, but not any more. No Idea why. Says: `Symbol's value as variable is void: ido-cur-item`. Any solutions? – reza.safiyat Jan 18 '16 at 15:07
  • 2
    @reza.safiyat that is because you need to call it within the context of opening a file or a directory. To try this, using `ido-find-file` go to a directory you want to refresh and hit "C-l" (within the ido buffer). It will refresh the directory you are currently looking at. – Shlomi Feb 23 '16 at 20:12
  • Funny: for me, I just went to directory I would like to refresh with `C-f` then I just press `C-l` and it have refreshed. – Felipe Sep 10 '19 at 00:24
13

As documented here, you can press g in the dired buffer to run revert-buffer and refresh the directory listing.

Ryan
  • 888
  • 1
  • 11
  • 29
louxiu
  • 2,830
  • 3
  • 28
  • 42
  • `g` is the usual 'refresh the buffer contents' binding, and works in lots of Emacs modes. – phils Jul 22 '14 at 23:00