emacs 行号
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?
我在控制台中使用Emacs 。 linum-mode
可以很好地显示行号。 但是,在控制台中,行号和文本内容之间没有空格 ,这有时会有些混乱。 如何在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 ~/.emacs
:
如果您使用linum-mode
显示行号,则可以定义自己的linum-format
来指定格式,方法是在~/.emacs
添加空格:
(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)))
翻译自: https://www.systutorials.com/how-to-add-a-space-between-the-line-numbers-and-text-content-in-emacs/
emacs 行号