简体   繁体   中英

Showing line numbers in dired file browser in Emacs

I am unable to show line numbers in Emacs when browsing files using Dired.

   Dotspacemacs-line-numbers '(:relative nil
     :visual t
     :disabled-for-modes ;; dired-mode
                         doc-view-mode
                         markdown-mode
                         ;; org-mode
                         pdf-view-mode
                         ;; text-mode
     :size-limit-kb 1000)

but line numbers are not showing.

any idea how to enable line numbers in Dired?

Turn on minor mode display-line-numbers-mode : Mx display-line-numbers-mode . Ch f tells you:

display-line-numbers-mode is an autoloaded interactive compiled Lisp function in display-line-numbers.el .

(display-line-numbers-mode &optional ARG)

Toggle display of line numbers in the buffer.

This uses display-line-numbers internally.

This is a minor mode. If called interactively, toggle the Display-Line-Numbers mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle . Enable the mode if ARG is nil , omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate display-line-numbers-mode .

The mode's hook is called both when the mode is enabled and when it is disabled.

To change the type of line numbers displayed by default, customize display-line-numbers-type . To change the type while the mode is on, set display-line-numbers directly.

Probably introduced at or before Emacs version 26.1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM