Skip to content
tom tan edited this page Jul 8, 2013 · 10 revisions

Install DMD

DMD is a reference implementation of D compiler. You can get it from dlang.org.

(Optional) Setup exec-path for Emacs

If you do not install DMD in PATH, add the following line to your .emacs (please modify "/path/to/dmd" to fit your environment).

(add-to-list 'exec-path (expand-file-name "/path/to/dmd"))

Add MELPA repository for package.el

Add the following lines to your .emacs.

(require 'package)
(add-to-list 'package-archives
 '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)

Install d-mode.el

You can install it by using M-x package-install d-mode.

Install flycheck.el

flycheck-d depends on flycheck.el. You can install it by using M-x package-install flycheck.

Install flycheck-d.el

You can install it by using M-x package-install flycheck-d and add the following line to your .emacs.

(require 'flycheck-d)

Small setup for flycheck.

For your convenience, add the following lines to your .emacs.

(add-hook 'd-mode-hook
          (lambda ()
            (local-set-key  (kbd "C-c C-p") 'flycheck-previous-error)
            (local-set-key  (kbd "C-c C-n") 'flycheck-next-error))

Finish!

Have fun!

You can see the error lines highlighted in D source code. You can use C-c C-p and C-c C-n to go to previous and next errors, respectively.

Clone this wiki locally