/emacs.js

ready-to-use Emacs setup for JavaScript coders.

Primary LanguageEmacs Lisp

emacs.js is a ready-to-use Emacs setup for JavaScript coders.

Screencast: http://www.youtube.com/watch?v=4iSfLy8qfbM&feature=youtu.be

Installation

$ cd ~
$ git clone https://github.com/azer/emacs.js
$ cd emacs.js
$ make

Once you have emacs.js installed in your home directory, backup your existing configuration by the below command;

$ mkdir ~/emacsbak && mv ~/.emacs* ~/emacsbak/.

Now emacs.js can be your default configuration;

$ ln -s ~/emacs.js/init.el ~/.emacs

To check for updates;

$ make update

It comes with

Indention, Syntax Check and Accurate Highlighting

Snippets & Auto-completion

Refactoring:

Interpreter:

Code Navigation:

and powerline, jade-mode, zsh, smex, undo-tree, markdown-mode etc...

Keybindings

* M-n n     npm-new (Create a new NodeJS project)
* M-n d     npm-new-dependency (Installs and saves a new dependency)
* M-n i     npm-install
* M-n e     npm-nodemon-exec
* M-n p     npm-publish
* M-n t     npm-test
* M-n v     npm-version
* M-i       ido-goto-symbol
* C-c C-m   Start Refactoring. More info: https://github.com/magnars/js2-refactor.el
* m-g n     run-js
* m-g m     js-send-region
* m-s s     er/expand-region
* C-j       zencoding-expand-yas
* up        smart-up
* down      smart-down
* left      smart-backward
* right     smart-forward
* m-r       replace-regexp
* m-g g     go to line
* m-down    go to forward line
* m-up      go to previous line
* C-x \     align=
* m-c       run-last-command
* m-g c     run-new-command
* m-g s     magit-status
* m-g l     magit-log
* m-g f     magit-pull
* m-g p     magit-push
* m-z       zsh

Snippets

emacs.js comes with a wide variety of JavaScript snippets. If you're not familiar with yasnippet yet, open a JavaScript file and type "new", then hit the control and space buttons.

It'll let you initialize a new NodeJS module with require and export code, based on this template; https://github.com/azer/yasnippet/blob/master/snippets/js2-mode/mod.yasnippet

Try also rq, exp, fn, invoc, it, desc keywords. To browse/fork all the snippets, visit;

https://github.com/azer/yasnippet/blob/master/snippets/js2-mode

Troubleshooting

  • js2-mode not working? Recompile js2-mode: make install-js2mode

Notes

  • If you have magit installed on your system, enable related config from profiles/default.el
  • If you have emacs-w3m installed on your system, enable related config from profiles/default.el