From 7bb46b66db5909ae35d5c1e8190abe83794c176c Mon Sep 17 00:00:00 2001 From: MitchMarq42 Date: Mon, 8 Aug 2022 06:35:30 -0800 Subject: [PATCH] Remove linum-relative. We are not bothering with it no more. --- lisp/mitch-packages.el | 95 +++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/lisp/mitch-packages.el b/lisp/mitch-packages.el index 7c72444..17d6a61 100644 --- a/lisp/mitch-packages.el +++ b/lisp/mitch-packages.el @@ -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