Files
.emacs.d/lisp/init-edit.el

38 lines
932 B
EmacsLisp
Raw Normal View History

2025-12-14 04:51:24 +11:00
;; -*- lexical-binding: t -*-
(use-package smartparens
2025-12-14 11:01:33 +11:00
:demand t
:hook (prog-mode text-mode markdown-mode)
2025-12-14 04:51:24 +11:00
:config
2025-12-14 11:01:33 +11:00
(require 'smartparens-config))
2025-12-14 04:51:24 +11:00
(use-package winum
:init
(winum-mode)
:config
2025-12-14 09:04:11 +11:00
(winum-set-keymap-prefix (kbd "C-c w")))
;; Yasnippet settings
(use-package yasnippet
:ensure t
:hook ((LaTeX-mode . yas-minor-mode)
(post-self-insert . my/yas-try-expanding-auto-snippets))
:config
(use-package warnings
: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 04:51:24 +11:00
(provide 'init-edit)