maybe fix linum-relative?
This commit is contained in:
parent
758506cdbc
commit
30b71fe441
@ -233,27 +233,27 @@ targets."
|
||||
(use-package embark-consult
|
||||
:after (embark consult))
|
||||
|
||||
;; WORKING: Relative line numbers with stuff
|
||||
;; SORTA WORKING: Relative line numbers with stuff
|
||||
(use-package linum-relative
|
||||
:diminish
|
||||
:init
|
||||
(require 'cl-lib)
|
||||
(require 'linum-relative)
|
||||
(setq linum-relative-current-symbol "")
|
||||
(defvar total-lines (count-lines (point-min) (point-max)))
|
||||
(defvar total-width 4)
|
||||
;; (defun mitch/get-total-width ()
|
||||
;; (+ 2 (round (log total-lines 10))))
|
||||
(defun mitch/get-total-width ()
|
||||
"set up linum relative variables per buffer."
|
||||
(let ((total-lines (count-lines (point-min) (point-max))))
|
||||
(setq-local total-width (ceiling (log total-lines 10)))))
|
||||
;; (defvar total-width 4)
|
||||
(defun mitch/symbol-width (symbol)
|
||||
(+ 1 (floor (log symbol 10))))
|
||||
(defun mitch/linum-get-left-pad (symbol)
|
||||
"Get the number of spaces to add before the current relative line number."
|
||||
(let* ((symbol-width (mitch/symbol-width line-number)))
|
||||
(- total-width symbol-width)))
|
||||
(- (mitch/get-total-width) symbol-width)))
|
||||
(defun mitch/right-pad (line-number)
|
||||
"Pad the line number to the right."
|
||||
(let* (
|
||||
(spacing (- total-width (mitch/symbol-width line-number)))
|
||||
(let* ((spacing (- (mitch/get-total-width) (mitch/symbol-width line-number)))
|
||||
(spacer (make-string spacing (string-to-char " "))))
|
||||
(format (concat "%s" spacer) line-number)))
|
||||
(defun mitch/left-pad (line-number)
|
||||
@ -276,6 +276,8 @@ targets."
|
||||
(face (if current-p 'linum-relative-current-face 'linum)))
|
||||
(propertize (format linum-relative-format current-symbol) 'face face)))
|
||||
(linum-relative-global-mode 1)
|
||||
;; (mitch/linum-rel-setup)
|
||||
; (linum-relative 282)
|
||||
:custom
|
||||
(linum-relative-current-symbol "")
|
||||
)
|
||||
@ -732,7 +734,8 @@ targets."
|
||||
)))
|
||||
|
||||
(use-package magit
|
||||
:commands magit)
|
||||
:commands magit
|
||||
:hook (magit-mode . turn-off-line-numbers))
|
||||
|
||||
(use-package hyperbole
|
||||
:diminish
|
||||
@ -754,7 +757,6 @@ targets."
|
||||
:config
|
||||
(add-hook 'Info-mode-hook #'info-variable-pitch-mode))
|
||||
|
||||
|
||||
;; (use-package empv
|
||||
;; :straight
|
||||
;; (:type git :host github
|
||||
|
Loading…
Reference in New Issue
Block a user