Created
July 20, 2022 03:52
-
-
Save andiogenes/a7c23a6b09782049d1afac11ca391172 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Relative line numbers | |
(setq display-line-numbers-type 'relative) | |
(global-display-line-numbers-mode) | |
;; Move toward logical lines when prefix arg (numeric, negative) is presented | |
(defun next-logical-line-if-prefix (&optional arg try-vscroll) | |
(interactive "^p\np") | |
(let ((line-move-visual (if current-prefix-arg nil line-move-visual))) | |
(with-no-warnings | |
(next-line arg try-vscroll)))) | |
(defun previous-logical-line-if-prefix (&optional arg try-vscroll) | |
(interactive "^p\np") | |
(let ((line-move-visual (if current-prefix-arg nil line-move-visual))) | |
(with-no-warnings | |
(previous-line arg try-vscroll)))) | |
(global-set-key (kbd "C-n") 'next-logical-line-if-prefix) | |
(global-set-key (kbd "C-p") 'previous-logical-line-if-prefix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment