Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: How to view sftp folders

Tags:

emacs

gnome

I'm running Ubuntu and playing with Emacs for the first time but unfortunately it doesn't seem to see any sftp folders I currently have mounted. These folder are visible to nautilus and gedit.

Can any experienced emac users point me in the right direction?

like image 697
ChrisInCambo Avatar asked Oct 14 '25 15:10

ChrisInCambo


2 Answers

I'm not sure how to get Emacs to pick up specifically those servers that have been mounted under Nautilus.

However (and hopefully this meets your needs), you can still view and edit remote files and directories using Tramp if you know the server name:

C-x C-f /sftp:[email protected]:path/to/file.txt RET

or

C-x C-f /sftp:[email protected]:path/to/directory/ RET

Tramp documentation

like image 141
Phil Avatar answered Oct 19 '25 13:10

Phil


Although tramp is more efficient, you can "drag and drop" it from $HOME/.gvfs/server.net/ into emacs. $HOME/.gvfs/server.net/ is where it's mounted locally.

Typically I drop the file into scratch where (as you've seen) it's expanded to a filename. Just modify that into an evaluatable function, evaluate it with "C-M-x":

(find-file "/sftp:[email protected]:/path/to/file.txt")

like image 26
Heow Goodman Avatar answered Oct 19 '25 15:10

Heow Goodman