Skip to content

Instantly share code, notes, and snippets.

@phoe
Last active August 6, 2017 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phoe/a3cfd569f74e6f1b87dfc512a397ec37 to your computer and use it in GitHub Desktop.
Save phoe/a3cfd569f74e6f1b87dfc512a397ec37 to your computer and use it in GitHub Desktop.
Emacs Lisp: linum displays only the space and last three chars of line number
(defun trim-number-to-string (n)
(let* ((string (format "%3d" n))
(length (length string))
(substring (substring string (- length 3) length)))
(format " %s" (propertize substring 'face 'linum))))
(setf linum-format 'trim-number-to-string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment