u/OutOfCharm

▲ 2 r/emacs

TIL: setting line number type to "visual" fixes relative jumping on wrapped lines

Relative line numbers can be handy when you want to quickly jump to a line relative to the current one. However, when you set the line number type to relative, it may underestimate the actual screen rows when lines are wrapped, leading to misaligned movement. I later learned that this can be readily solved by switching to visual, which respects the actual rows.

(setq display-line-numbers-type 'visual)
(add-hook 'prog-mode-hook 'display-line-numbers-mode)
reddit.com
u/OutOfCharm — 1 hour ago