wiki:Emacs

Version 2 (modified by jstolarek, 7 months ago) (diff)

--

Emacs tips and tricks

Most of us use Emacs for GHC development. This page lists various Emacs configuration tips and tricks used by GHC developers in hope that they will be useful to others. Each entry includes a short description and instruction how to enable given setting (if it contains only a block of lisp code it means you need to add it to your .emacs configuration file). All configuration is given for Emacs 24, unless otherwise noted.

General

Highlight text beyond 80th column

Description: If you have a tendency to write too long lines of code this will help you by highlighting text beyond 80th column.

How to enable:

(require 'whitespace)
(setq whitespace-style '(face lines-tail))
(setq whitespace-line-column 80)
(global-whitespace-mode t)

Automatically removes trailing whitespaces when file is saved

Description: Currently source code of GHC contains lots of trailing whitespaces, which means that this setting is dangerous. It will remove ALL trailing whitespaces in every file that you edit, which means you might have one or two lines changed by you and a hundred lines automatically changed by removing trailing whitespaces. This will require you to separate whitespaces into a separate commit by using git add -i. This is tedious, so be warned.

How to enable:

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Haskell-specific

GHC-specific

Description:

How to enable: