2025-12-14 04:51:24 +11:00
|
|
|
;; -*- lexical-binding: t -*-
|
|
|
|
|
|
2025-12-15 03:20:45 +11:00
|
|
|
;; (use-package smartparens
|
|
|
|
|
;; :demand t
|
|
|
|
|
;; :hook (prog-mode text-mode markdown-mode)
|
|
|
|
|
;; :config
|
|
|
|
|
;; (require 'smartparens-config))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(add-hook 'prog-mode-hook #'electric-pair-mode)
|
|
|
|
|
(add-hook 'text-mode-hook #'electric-pair-mode)
|
2025-12-14 04:51:24 +11:00
|
|
|
|
2025-12-14 06:09:17 +11:00
|
|
|
(use-package winum
|
2025-12-15 18:20:19 +11:00
|
|
|
:hook (elpaca-after-init . winum-mode)
|
2025-12-14 06:09:17 +11:00
|
|
|
:config
|
2025-12-14 09:04:11 +11:00
|
|
|
(winum-set-keymap-prefix (kbd "C-c w")))
|
|
|
|
|
|
|
|
|
|
;; Yasnippet settings
|
|
|
|
|
(use-package yasnippet
|
|
|
|
|
:ensure t
|
2025-12-15 18:20:19 +11:00
|
|
|
:hook (elpaca-after-init . yas-global-mode)
|
2025-12-14 09:04:11 +11:00
|
|
|
:hook ((LaTeX-mode . yas-minor-mode)
|
|
|
|
|
(post-self-insert . my/yas-try-expanding-auto-snippets))
|
|
|
|
|
:config
|
|
|
|
|
(use-package warnings
|
2025-12-15 18:20:19 +11:00
|
|
|
:ensure nil
|
2025-12-14 09:04:11 +11:00
|
|
|
:config
|
|
|
|
|
(cl-pushnew '(yasnippet backquote-change)
|
|
|
|
|
warning-suppress-types
|
|
|
|
|
:test 'equal))
|
|
|
|
|
|
|
|
|
|
(setq yas-triggers-in-field t)
|
|
|
|
|
|
|
|
|
|
;; Function that tries to autoexpand YaSnippets
|
|
|
|
|
;; The double quoting is NOT a typo!
|
|
|
|
|
(defun my/yas-try-expanding-auto-snippets ()
|
|
|
|
|
(when (and (boundp 'yas-minor-mode) yas-minor-mode)
|
|
|
|
|
(let ((yas-buffer-local-condition ''(require-snippet-condition . auto)))
|
|
|
|
|
(yas-expand)))))
|
2025-12-14 06:09:17 +11:00
|
|
|
|
2025-12-16 08:23:57 +11:00
|
|
|
(setq-default abbrev-mode t)
|
|
|
|
|
(setq abbrev-file-name (expand-file-name "abbrev.el" user-emacs-directory))
|
|
|
|
|
|
2025-12-14 04:51:24 +11:00
|
|
|
|
|
|
|
|
(provide 'init-edit)
|