Emacs在Windows下可以使用Plink.exe
来通过SSH访问编辑远程服务器上的文件。首先需要下载PuTTY,将PuTTY放在任意目录,然后在.emacs
之中加入:
elisp
(require 'tramp) (setq exec-path (cons "E:/PuTTY" exec-path)) (setq tramp-default-method "plink") (setq tramp-shell-prompt-pattern "^[ $]+")
之后就可以使用命令来打开远程服务器文件了,跟GNU/Linux下不太一样,少了SSH前缀:
/users@localhost:/folder/file