Screen line motion now works as originally envisioned

This commit is contained in:
MitchMarq42 2022-10-10 12:16:37 -08:00
parent 28e07fc8f8
commit c9e55e8c3b
2 changed files with 13 additions and 6 deletions

View File

@ -17,6 +17,17 @@
(defun mitch/evil-config () (defun mitch/evil-config ()
"A batch of commands to run as the :config of evil's `use-package'. "A batch of commands to run as the :config of evil's `use-package'.
Made solely to reduce lines in the init-file." Made solely to reduce lines in the init-file."
;; Visual moving
(defun move-screen-down-line ()
"Scroll down line but keep cursor in same visual position."
(interactive)
(evil-previous-line)
(scroll-down-line))
(defun move-screen-up-line ()
"Scroll up line but keep cursor in same visual position."
(interactive)
(evil-next-line)
(scroll-up-line))
;; Make evil-join combine lines. Taken from https://github.com/hlissner/doom-emacs/commit/40cf6139ed53b635fec37ce623c4b1093c78a11e ;; Make evil-join combine lines. Taken from https://github.com/hlissner/doom-emacs/commit/40cf6139ed53b635fec37ce623c4b1093c78a11e
;; (evil-define-operator +evil-join-a (beg end) ;; (evil-define-operator +evil-join-a (beg end)
;; "Join the selected lines. ;; "Join the selected lines.

View File

@ -73,12 +73,8 @@
(general-define-key (general-define-key
:states 'normal :states 'normal
"<escape>" 'evil-beginning-of-line "<escape>" 'evil-beginning-of-line
"j" (general-key-dispatch 'evil-next-visual-line "C-n" 'move-screen-up-line
:timeout 0.025 "C-p" 'move-screen-down-line)
"j" 'scroll-up-line)
"k" (general-key-dispatch 'evil-previous-visual-line
:timeout 0.025
"k" 'scroll-down-line))
(general-define-key (general-define-key
:states 'insert :states 'insert
"C-w" 'evil-window-map "C-w" 'evil-window-map