Remove linum-relative. We are not bothering with it no more.
This commit is contained in:
parent
fbc61eaed9
commit
7bb46b66db
@ -235,53 +235,54 @@ targets."
|
||||
:after (embark consult))
|
||||
|
||||
;; SORTA WORKING: Relative line numbers with stuff
|
||||
(use-package linum-relative
|
||||
:diminish
|
||||
:init
|
||||
(require 'cl-lib)
|
||||
(require 'linum-relative)
|
||||
(setq linum-relative-current-symbol "")
|
||||
(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)))
|
||||
(- (mitch/get-total-width) symbol-width)))
|
||||
(defun mitch/right-pad (line-number)
|
||||
"Pad the line number to the right."
|
||||
(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)
|
||||
"Pad the line number to the left."
|
||||
(let ((spacing
|
||||
(make-string (mitch/linum-get-left-pad line-number)
|
||||
(string-to-char " "))))
|
||||
(format (concat spacing "%s") line-number)))
|
||||
(defun linum-relative (line-number)
|
||||
(let* ((diff1 (abs (- line-number linum-relative-last-pos)))
|
||||
(diff (if (cl-minusp diff1)
|
||||
diff1
|
||||
(+ diff1 linum-relative-plusp-offset)))
|
||||
(current-p (= diff linum-relative-plusp-offset))
|
||||
(current-symbol (if (and linum-relative-current-symbol current-p)
|
||||
(if (string= "" linum-relative-current-symbol)
|
||||
(mitch/right-pad line-number)
|
||||
linum-relative-current-symbol)
|
||||
(mitch/left-pad diff)))
|
||||
(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 "")
|
||||
)
|
||||
; (use-package linum-relative
|
||||
; :diminish
|
||||
; :init
|
||||
; (require 'cl-lib)
|
||||
; (require 'linum-relative)
|
||||
; (setq linum-relative-current-symbol "")
|
||||
; (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)))
|
||||
; (- (mitch/get-total-width) symbol-width)))
|
||||
; (defun mitch/right-pad (line-number)
|
||||
; "Pad the line number to the right."
|
||||
; (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)
|
||||
; "Pad the line number to the left."
|
||||
; (let ((spacing
|
||||
; (make-string (mitch/linum-get-left-pad line-number)
|
||||
; (string-to-char " "))))
|
||||
; (format (concat spacing "%s") line-number)))
|
||||
; (defun linum-relative (line-number)
|
||||
; (let* ((diff1 (abs (- line-number linum-relative-last-pos)))
|
||||
; (diff (if (cl-minusp diff1)
|
||||
; diff1
|
||||
; (+ diff1 linum-relative-plusp-offset)))
|
||||
; (current-p (= diff linum-relative-plusp-offset))
|
||||
; (current-symbol (if (and linum-relative-current-symbol current-p)
|
||||
; (if (string= "" linum-relative-current-symbol)
|
||||
; (mitch/right-pad line-number)
|
||||
; linum-relative-current-symbol)
|
||||
; (mitch/left-pad diff)))
|
||||
; (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 "")
|
||||
; )
|
||||
(setq display-line-numbers-mode 'relative)
|
||||
|
||||
;; broken terminal that doesn't compile but at least it's fast when it does
|
||||
(use-package vterm
|
||||
|
Loading…
Reference in New Issue
Block a user