help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display line number on each buffer line


From: Philip Kaludercic
Subject: Re: Display line number on each buffer line
Date: Thu, 02 Dec 2021 20:42:20 +0000

fatiparty--- via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Dec 2, 2021, 09:17 by philipk@posteo.net:
>
>> fatiparty--- via Users list for the GNU Emacs text editor
>> <help-gnu-emacs@gnu.org> writes:
>>
>>> Dec 2, 2021, 08:31 by larsi@gnus.org:
>>>
>>>> fatiparty--- via Users list for the GNU Emacs text editor
>>>> <help-gnu-emacs@gnu.org> writes:
>>>>
>>>>> Is there a way to display the line number on each buffer line?
>>>>>
>>>>
>>>> `M-x display-line-numbers-mode'
>>>>
>>> That's what I was looking for.  Is there a technique for changing the 
>>> foreground colour of the line number as well?
>>>
>>
>> You can customise the faces line-number (for all lines) and
>> line-number-current-line (for the current line).  Use `M-x
>> customize-face [face name]' to do this interactively.
>>
>
> That is good, but I want to do that from my init file if possible.  Is there 
> a way to reduce the line number size as well?

Something like this should be enough:

--8<---------------cut here---------------start------------->8---
(set-face-background 'line-number "red")
(set-face-foreground 'line-number-current-line "blue")
--8<---------------cut here---------------end--------------->8---

-- 
        Philip Kaludercic



reply via email to

[Prev in Thread] Current Thread [Next in Thread]