diff --git a/lisp/mitch-evil.el b/lisp/mitch-evil.el new file mode 100644 index 0000000..d98b630 --- /dev/null +++ b/lisp/mitch-evil.el @@ -0,0 +1,100 @@ +;;; mitch-evil.el --- personal settings for evil-mode -*- lexical-binding: t; -*- + +;; Copyright (C) 2023 mitch + +;; Author: mitch +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; put here because git branches are hard + +;;; Code: + +(use-package evil + :general + ;; Visual lines. Redefined for auto-scrolling madness. + (general-define-key + :states 'normal + "" 'evil-beginning-of-line + "j" 'evil-next-visual-line + "k" 'evil-previous-visual-line + "C-n" 'move-screen-up-line + "C-p" 'move-screen-down-line) + (general-define-key + :states 'insert + "C-w" 'evil-window-map + "C-V" (general-key-dispatch + 'evil-quoted-insert + "u" 'insert-char)) + :diminish visual-line-mode + :custom + (echo-keystrokes 0.5) + (evil-want-integration t) + (evil-want-keybinding nil) + (evil-want-C-u-scroll nil) + (evil-want-C-i-jump nil) + ;; (evil-vsplit-window-right t) + ;; (evil-split-window-below t) + (evil-undo-system + (if (>= (string-to-number emacs-version) 28) + (quote undo-redo) + (quote undo-fu))) + :init (evil-mode t) + :config (mitch/evil-config)) +(use-package evil-collection + :after evil + :diminish evil-collection-unimpaired-mode + :config (evil-collection-init)) +(use-package evil-commentary + :after evil + :diminish 'evil-commentary-mode + :config (evil-commentary-mode) + :hook (prog-mode . evil-commentary-mode)) +(use-package evil-surround + :after evil + :diminish 'global-evil-surround-mode + :hook (prog-mode . evil-surround-mode) + :config (global-evil-surround-mode 1)) +(use-package evil-matchit + :after evil + :diminish 'evil-matchit-mode + :config (global-evil-matchit-mode 1)) + +(use-package evil-terminal-cursor-changer + :after evil + :diminish + :if (not (display-graphic-p)) + :custom + (evil-motion-state-cursor 'box) ; █ + (evil-visual-state-cursor 'box) ; █ + (evil-normal-state-cursor 'box) ; █ + (evil-insert-state-cursor 'bar) ; ⎸ + (evil-emacs-state-cursor 'hbar) ; _ + :config + (evil-terminal-cursor-changer-activate) + (xterm-mouse-mode)) +(use-package evil-goggles + :diminish + :after evil + :init (evil-goggles-mode) + :custom-face + (evil-goggles-default-face + ((t (:background "#303030" :foreground "#2233aa"))))) + + +(provide 'mitch-evil) +;;; mitch-evil.el ends here diff --git a/lisp/mitch-packages.el b/lisp/mitch-packages.el index 55a59cb..138d452 100644 --- a/lisp/mitch-packages.el +++ b/lisp/mitch-packages.el @@ -106,69 +106,9 @@ ;; (use-package use-package-ensure-system-package) ;; load evil -(use-package evil - :general - ;; Visual lines. Redefined for auto-scrolling madness. - (general-define-key - :states 'normal - "" 'evil-beginning-of-line - "j" 'evil-next-visual-line - "k" 'evil-previous-visual-line - "C-n" 'move-screen-up-line - "C-p" 'move-screen-down-line) - (general-define-key - :states 'insert - "C-w" 'evil-window-map - "C-V" (general-key-dispatch - 'evil-quoted-insert - "u" 'insert-char)) - :diminish visual-line-mode - :custom - (echo-keystrokes 0.5) - (evil-want-integration t) - (evil-want-keybinding nil) - (evil-want-C-u-scroll nil) - (evil-want-C-i-jump nil) - ;; (evil-vsplit-window-right t) - ;; (evil-split-window-below t) - (evil-undo-system - (if (>= (string-to-number emacs-version) 28) - (quote undo-redo) - (quote undo-fu))) - :init (evil-mode t) - :config (mitch/evil-config)) -(use-package evil-collection - :after evil - :diminish evil-collection-unimpaired-mode - :config (evil-collection-init)) -(use-package evil-commentary - :after evil - :diminish 'evil-commentary-mode - :config (evil-commentary-mode) - :hook (prog-mode . evil-commentary-mode)) -(use-package evil-surround - :after evil - :diminish 'global-evil-surround-mode - :hook (prog-mode . evil-surround-mode) - :config (global-evil-surround-mode 1)) -(use-package evil-matchit - :after evil - :diminish 'evil-matchit-mode - :config (global-evil-matchit-mode 1)) +(require 'mitch-evil) +;; (require 'mitch-meow) -(use-package evil-terminal-cursor-changer - :after evil - :diminish - :if (not (display-graphic-p)) - :custom - (evil-motion-state-cursor 'box) ; █ - (evil-visual-state-cursor 'box) ; █ - (evil-normal-state-cursor 'box) ; █ - (evil-insert-state-cursor 'bar) ; ⎸ - (evil-emacs-state-cursor 'hbar) ; _ - :config - (evil-terminal-cursor-changer-activate) - (xterm-mouse-mode)) (use-package undo-fu :after evil :if (< (string-to-number emacs-version) 28) @@ -202,13 +142,6 @@ :keymaps 'vundo-mode-map "d" 'my/vundo-diff)) -(use-package evil-goggles - :diminish - :after evil - :init (evil-goggles-mode) - :custom-face - (evil-goggles-default-face - ((t (:background "#303030" :foreground "#2233aa"))))) (use-package altcaps :after evil :elpaca (:host github