![]() ![]() ![]() ![]() For example, if the largest visible line number is 50, it only uses two characters for the numbers (plus one for the space), even if there are 1000 lines in the file. I like how “%d “ uses only as much space as is needed for what is shown in the buffer. Linum.el is distributed with Emacs in versions after 22 (currently only CVS Emacs) Library linum.el works incrementally and can number large files very quickly. (nlinum-mode -1) ad-do-it (nlinum-mode 1))) ( defadvice make-frame (around toggle-nlinum-mode compile activate) (add-hook 'window-setup-hook 'initialize-nlinum) ( defun initialize-nlinum ( &optional frame) The lastest Nlinum-mode git version(1.6) not worked with emacs deamon mode, use emacsclient to open a file, will result a “ ERROR: Invalid face: linum” error, following hack worked for me on emacs-version 24.5.1. Note: a previous version set nlinum-width and then called nlinum-flush, but that can cause problems in nlinum’s timers, see. (add-hook 'nlinum-mode-hook #'my-nlinum-mode-hook) To precalculate the line number width to avoid horizontal jumps on scrolling: Preset ` nlinum-format' for minimum width. It should usually be about as fast or faster than linum.el. ![]() The nlinum.el library, available from GNU ELPA ( ) is meant as a replacement for linum.el, using the jit-lock infrastructure to fix various corner case bugs in linum.el. Jerr圜hen had a line-numbers-mode on Geocities. Or use count-lines-page ( C-x l) that reports the total number of lines as well as the numbers of lines before and after the current one. If you just want to know the current line number that the TextCursor is on, you can use the M-x what-line command (which is usually not on a key). If you just want the current line number in your modeline (and it isn’t there already), use LineNumberMode by running the M-x line-number-mode command. (member major-mode display-line-numbers-exempt-modes)) "Turn on line numbers except for certain major modes.Įxempt major modes are defined in ` display-line-numbers-exempt-modes'." "Major modes on which to disable line numbers." :group 'display-line-numbers '(vterm-mode eshell-mode shell-mode term-mode ansi-term-mode) ( defcustom display-line-numbers-exempt-modes To disable this in certain major modes you can redefine display-line-numbers-turn-on: ( require ' display-line-numbers) emacs file: ( when (version<= "26.0.50" emacs-version ) You can enable it globally by appending this to your. The solution is simple: disable `linum-mode` or any linum-mode alternative when file is too big. It could slow down emacs when viewing file with more than tens of thousands of lines. The Easy Wayĭisplay-line-numbers-mode is available since Emacs 26.įor older Emacs, use M-x linum-mode. NumberLines will add the line numbers to the buffer content. See Also: The code on this page just displays line numbers without actually changing the buffer content. If you just want to work on a specific part of the file and you are accustomed to doing that by showing line numbers in the margin, try BasicNarrowing instead. This page is about displaying line numbers in a buffer, or otherwise indicating line numbers, without actually changing the buffer content. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |