Emacs: How to view sftp folders

感情迁移 提交于 2019-12-12 16:26:58

问题


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?


回答1:


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:username@server.net:path/to/file.txt RET

or

C-x C-f /sftp:username@server.net:path/to/directory/ RET

Tramp documentation




回答2:


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:username@server.net:/path/to/file.txt")



来源:https://stackoverflow.com/questions/1546797/emacs-how-to-view-sftp-folders

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!