With library column-marker.el you can highlight a column (vertical line) of text. In fact, you can highlight any number of such columns – 3 such highlight column markers are provided by default, but you can easily define more.

This is especially useful for languages like COBOL or Fortran where certain columns have special meaning. It is also handy for aligning text across long vertical distances. Multi-column characters, such as ‘TAB’ are treated correctly.

Commands ‘column-marker-1’, ‘column-marker-2’, and ‘column-marker-3’ each highlight a given column (using different background colors, by default). The behavior of each command is the same, and depends on the prefix argument, as follows:

If two commands highlight the same column, the last-issued highlighting command shadows the other – only the last-issued highlighting is seen. If that “topmost” highlighting is then turned off, the other highlighting for that column will show through.


These commands use ‘font-lock-fontify-buffer’, so syntax highlighting (‘font-lock-mode’) must be turned on. There might be a performance impact during refontification.


Place column-marker.el in your load path, and put this in your init file (`.emacs’):

    (require 'column-marker)

Other init file suggestions (examples):

    (add-hook 'foo-mode-hook (lambda () (interactive) (column-marker-1 80)))
    (global-set-key [?\C-c ?m] 'column-marker-1)

Defining Additional Column Markers

This is all you need to do, to create an additional column marker:

    (column-marker-create column-marker-4 my-favorite-face)

See also


Indentation guides?

Could this be used to display indentation guides? – [[]]

Sure, why not? – DrewAdams

Off by one

It seems to be With column-marker.el and (add-hook ‘python-mode-hook (lambda () (interactive) (column-marker-1 80))) I it only highlights the 81st column. Using emacs 23.4 on debian jessie. Sorry I’m not sure where to report this bug.

CategoryEditing CategoryFilling CategoryDisplay