From f45e7a1412177d5f24d23c68b9ff881a9ab70858 Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Tue, 18 Feb 2025 19:38:17 +0000 Subject: Add support for evil-mode --- substrate.el | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/substrate.el b/substrate.el index f0c916d..aa02727 100644 --- a/substrate.el +++ b/substrate.el @@ -37,6 +37,9 @@ (defcustom substrate-configure-theme t "Configure the default theme (evangelion) as part of the substrate init" :type 'boolean :group 'substrate) +(defcustom substrate-enable-evil nil + "Enable evil-mode and the Vi-like keyboard mapping" + :type 'boolean :group 'substrate) (defun substrate-set-theme (theme) @@ -139,6 +142,25 @@ If the new path's directories does not exist, create them." :config (which-key-mode)) + (use-package evil + :ensure t + :if substrate-enable-evil + + :init + (setq evil-respect-visual-line-mode t) + (setq evil-undo-system 'undo-redo) + + :config + (evil-mode) + + ;; If you use Magit, start editing in insert state + (add-hook 'git-commit-setup-hook 'evil-insert-state) + + ;; Configuring initial major mode for some modes + (evil-set-initial-state 'eat-mode 'emacs) + (evil-set-initial-state 'vterm-mode 'emacs)) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Minibuffer/completion settings -- cgit v1.2.3