mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-24 12:00:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
18
.emacs.d/modules/emacs/electric/config.el
Normal file
18
.emacs.d/modules/emacs/electric/config.el
Normal file
@@ -0,0 +1,18 @@
|
||||
;;; emacs/electric/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Smarter, keyword-based electric-indent
|
||||
|
||||
(defvar-local +electric-indent-words '()
|
||||
"The list of electric words. Typing these will trigger reindentation of the
|
||||
current line.")
|
||||
|
||||
;;
|
||||
(after! electric
|
||||
(setq-default electric-indent-chars '(?\n ?\^?))
|
||||
|
||||
(add-hook! 'electric-indent-functions
|
||||
(defun +electric-indent-char-fn (_c)
|
||||
(when (and (eolp) +electric-indent-words)
|
||||
(save-excursion
|
||||
(backward-word)
|
||||
(looking-at-p (concat "\\<" (regexp-opt +electric-indent-words))))))))
|
||||
Reference in New Issue
Block a user