windows下使用emacs+plink远程编辑erlang文件

    1)plink.exe属于putty套件, 注册到环境变量;emacs的bin目录也要注册到环境变量中;

    2)在.emacs中增加如下:

(require 'tramp)
(setq tramp-default-method "plink") ;; 这样在emacs的minibuffer中C-x C-f之后就不必再输入/plink:
(byte-compile-file "E:/tools/emacs-24.3/lisp/net/tramp-sh.el") ;; 避免错误: Couldn't find proper 'ls' command

    3)打开控制台, 输入emacs打开编辑器(注意如果是双击emacs.exe会出现plink命令找不到的问题), 然后输入:

C-x C-f /username@remote_ip:directory

    输入密码便可打开远程目录。

    注意:在使用某版本的emacs时,出现连接到远程shell卡住的情况,于是下载了最新版本的emacs26.1。经测试,不需要编译tramh-sh.el文件,但是登陆时需要输入命令:

C-x C-f /plink:username@remote_ip:directory

 

    在win平台安装了erlang后,便可以在.emacs增加如下配置:(参见The erlang mode for Emacs:http://erlang.org/doc/apps/tools/erlang_mode_chapter.html)

(setq load-path (cons "C:/Program Files/erl<Ver>/lib/tools-<ToolsVer>/emacs" load-path))

(setq erlang-root-dir "C:/Program Files/erl<Ver>")

(setq exec-path (cons "C:/Program Files/erl<Ver>/bin" exec-path))

(require 'erlang-start)

 

posted on 2018-06-10 20:47  莫行  阅读(666)  评论(0编辑  收藏  举报

导航