I use Emacs in console. The
linum-mode displays the line numbers just well. However, in the console, there is no space between the line numbers and the text content, which makes it a little messy some times. How to add a space between the line numbers and text content in Emacs?
If you are using the
linum-mode for displaying the line numbers, you can define your own
linum-format to specify the format by adding the space in your
(require 'linum) (global-linum-mode t) ;; use customized linum-format: add a addition space after the line number (setq linum-format (lambda (line) (propertize (format (let ((w (length (number-to-string (count-lines (point-min) (point-max)))))) (concat "%" (number-to-string w) "d ")) line) 'face 'linum)))