Javascript --Emacs

first go into the offical web   js2mode

then goto the download page https://github.com/mooz/js2-mode 

download and compile step:

$ git clone git://github.com/mooz/js2-mode.git
$ cd js2-mode
$ emacs --batch -f batch-byte-compile js2-mode.el
compilation is for the speed up the startup. then put the .elc file to your directory;at last config .emacs 

(add-to-list 'load-path "/home/ryu/emacs/site/javascript")
(autoload 'js2-mode "js2-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(add-hook 'js2-mode-hook 'my-common-mode-auto-pair)    #for auto-pair

js-mode is shiped with Emacs, so if you want to make specified setup for js-mode, you should use js-mode-hook.otherwise, as to js2-mode we should use js2-mode-hook. 

now i use nxhtml-mode for my web programming, but now it just compatible with js-mode default mode in emacs. we still not able to use mix js2 and nxhtml in nxhtml-mode.




http://blog.deadpansincerity.com/2011/05/setting-up-emacs-as-a-javascript-editing-environment-for-fun-and-profit/

http://www.emacswiki.org/emacs/JavaScriptMode


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值