Emacs: What's the Best Setup for Python, Ruby, Java, JavaScript, etc?

By Xah Lee. Date: . Last updated: .

One of the common question i get is:

what's the best emacs setup for {Python, Ruby, PHP, JavaScript, Java, C++, etc}?

Vanilla Emacs works fine. You just need to master it.

I recommend mastering plain emacs first. Most people asking such questions have no idea about emacs basics.

[see Emacs: Init File Tutorial]

[see Tips on Long Term Emacs Productivity]

There are, however, many useful and quality emacs enhancements. Here's a guide.

List of Emacs Starter Kits, year 2013

Try a starter kit. I recommend spacemacs.

List of Emacs Starter Kits, year 2013

Abbrev and Function Templates

abbrev saves lots of typing! Setup your own collection of abbrevs of any lang.

Emacs: Abbrev Mode by Lisp Code

Smart Completion

Try company-mode at http://company-mode.github.io/

It's available on MELPA.

[see Emacs: Install Package with ELPA/MELPA]

Note: if you are {C, C++, Java} programer working on large code base, emacs's completion will never be as good as those in Microsoft Visual Studio or IntelliJ (or the lesser Eclispe, NetBeans). (only very few may disagree. That usually means you have to be expert of emacs and elisp.)

Syntax Checking

try flycheck at http://www.flycheck.org/en/latest/

Ruby

Try emacs prelude [2017-05-31 https://github.com/bbatsov/prelude ]

try Steve Purcell's [2017-05-31 https://github.com/purcell/emacs.d ]

also

Haskell Clojure Elm etc

try Steve Purcell's [2017-05-31 https://github.com/purcell/emacs.d ]

Python

try Steve Purcell's [2017-05-31 https://github.com/purcell/emacs.d ]

try

Elpy, the Emacs Lisp Python Environment [2013-10-30 https://github.com/jorgenschaefer/elpy/wiki ]

Jedi.el — Python auto-completion for Emacs http://tkf.github.io/emacs-jedi/

[2017-05-31 https://github.com/python-rope/ropemacs ]

Ropemacs is a plugin for performing python refactorings in emacs. It uses rope library and pymacs. [2017-05-31 https://github.com/python-rope/ropemacs ]

HTML CSS

try web-mode http://web-mode.org/

try Emacs: Xah CSS Mode for pure css file.

JavaScript

emacs has a simple js mode builtin.

other js mode with more features are

js2 mode [2017-05-31 https://github.com/mooz/js2-mode ]

js3 mode (fork of js2) [2017-05-31 https://github.com/thomblake/js3-mode ]

if you prefer simple and static, try my Emacs: Xah JavaScript Mode, xah-js-mode.el

skewer-mode, for live web dev, connecting to browser. [2017-05-31 https://github.com/skeeto/skewer-mode ]

C, C++

[Emacs for C++ developers By Bin Chen (陈斌). At [ https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/emacs_cpp_developer_guide-en.org ] , accessed on 2013-07-07 ]

Emacs Lisp

try my Emacs: Xah Elisp Mode

Editing Parenthesis

lisp hackers like ParEdit http://www.emacswiki.org/emacs/ParEdit. I don't like.

try smartparens, which is based on ParEdit [2017-05-31 https://github.com/Fuco1/smartparens ]

try lispy, an alternative to ParEdit or SmartParen [2017-05-31 https://github.com/abo-abo/lispy ]

or, try Xah's way. That is, Emacs: Xah Fly Keys. It deals with parenthesis/brackets too.

Emacs Key System

emacs keybinding system is the MOST important element for improving efficiency, for working with any programing language. Because, it is the keys you use to do anything in emacs.

using a efficient emacs keybinding system will beat efficiency than any emacs enhancement.

i recommend one of the following

try Emacs: Xah Fly Keys

try ergoemacs-mode http://ergoemacs.github.io/

try [2017-05-31 https://github.com/emacs-evil/evil ]

You need few weeks to be proficient with any of them.