Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spacemacs hybrid line numbers

How do I get hybrid line numbering (relative line numbers, but the current line shows the absolute line number instead of 0) in spacemacs for all files?

I tried setting relative line numbers in user-config but that doesn't seem to be working, and can't figure out how to replace the 0 in relative mode either:

(global-linum-mode)
(setq-default dotspacemacs-line-numbers 'relative)
like image 264
Simon Avatar asked Jan 18 '16 17:01

Simon


1 Answers

The dotspacemacs-line-numbers variable already exists in your .spacemacs, in the dotspacemacs/init function. If it is not the case you can update your .spacemacs to the last template with the help of SPC f e D.

Change its value to 'relative, as in:

;; If non nil line numbers are turned on in all `prog-mode' and `text-mode'
;; derivatives. If set to `relative', also turns on relative line numbers.
;; (default nil)
dotspacemacs-line-numbers 'relative

Then remove the two lines you added in your dotspacemacs/user-config. All you need is to change the variable as explained above, it will take care of applying the changes for you :-)

like image 83
StreakyCobra Avatar answered Nov 09 '22 03:11

StreakyCobra