diff options
author | Gene Pasquet <dev@etenil.net> | 2025-02-18 19:38:17 +0000 |
---|---|---|
committer | Gene Pasquet <dev@etenil.net> | 2025-02-18 19:38:17 +0000 |
commit | f45e7a1412177d5f24d23c68b9ff881a9ab70858 (patch) | |
tree | 52da9f4762c335608f050c47cdc2a9bf37b4fd87 | |
parent | e3652cee39a387a3d6d774033a7d6246b5d7da82 (diff) |
Add support for evil-mode
-rw-r--r-- | substrate.el | 22 |
1 files changed, 22 insertions, 0 deletions
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 |