TRAMP (Transparent Remote Access, Multiple Protocols) is for transparently accessing remote files from within Emacs. TRAMP enables an easy, convenient, and consistent interface to remote files as if they are local files.
使用方法:直接按如下格式打开远程文件即可,
C-x C-f /ssh:username@server.net:path/to/file.txt RET
C-x C-f /ssh:username@server.net:path/to/directory/ RET
注:
sftp是Secure File Transfer Protocol的缩写,即安全文件传送协议。
Tramp Mode不支持sftp协议,在打开/sftp:username@server.net:path/to/file.txt
时会提示:
byte-code: Unknown method "sftp"
原因:
解决方案:
如果服务器还支持ssh的话,可以使用/ssh:username@server.net:path/to/file.txt
代替。