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++, …}?

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 How to Set Emacs's User Interface

〔►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

Try a starter kit. I recommend spacemacs.

List of Emacs Starter Kits

Abbrev and Function Templates

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

Emacs: Abbrev Mode

Smart Completion

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

It's available on MELPA.

〔►see Emacs: How to Install Packages Using 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/


Try emacs prelude https://github.com/bbatsov/prelude

try Steve Purcell's https://github.com/purcell/emacs.d


Haskell Clojure Elm etc

try Steve Purcell's https://github.com/purcell/emacs.d


try Steve Purcell's https://github.com/purcell/emacs.d


Elpy, the Emacs Lisp Python Environment https://github.com/jorgenschaefer/elpy/wiki

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


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


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

try Emacs: Xah CSS Mode for pure css file.


emacs has a simple js mode builtin.

other js mode with more features are

js2 mode https://github.com/mooz/js2-mode

js3 mode (fork of js2) https://github.com/thomblake/js3-mode

if you prefer simple and static, try my Emacs: Xah JavaScript Mode

skewer-mode, for live web dev, connecting to browser. 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

Emacs Lisp

try my Emacs: Xah Emacs Lisp Mode

Editing Parenthesis

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

try smartparens, which is based on ParEdit https://github.com/Fuco1/smartparens

try lispy, an alternative to ParEdit or SmartParen 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 https://github.com/emacs-evil/evil

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

Liket it? Put $5 at patreon. Or Buy Xah Emacs Tutorial. Thanks.