mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(emacs): Snippets loading and writing setup
This commit is contained in:
parent
d0f1044013
commit
31fde92975
9 changed files with 61 additions and 12 deletions
|
|
@ -7,5 +7,26 @@
|
|||
(kbd "zL") #'texfrag-document)
|
||||
:hook (markdown-mode . texfrag-mode))
|
||||
|
||||
(use-package laas
|
||||
:hook (
|
||||
(LaTeX-mode . laas-mode)
|
||||
(org-mode . laas-mode))
|
||||
:config ; do whatever here
|
||||
(aas-set-snippets 'laas-mode
|
||||
;; set condition!
|
||||
:cond #'texmathp ; expand only while in math
|
||||
"nabl" "\\nabla"
|
||||
"ppart" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\frac{\\partial $2}{\\partial $1} $0"))
|
||||
;; bind to functions!
|
||||
"Sum" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\sum_{$1}^{$2} $0"))
|
||||
"Span" (lambda () (interactive)
|
||||
(yas-expand-snippet "\\Span($1)$0"))
|
||||
;; add accent snippets
|
||||
:cond #'laas-object-on-left-condition
|
||||
"qq" (lambda () (interactive) (laas-wrap-previous-object "sqrt")))
|
||||
)
|
||||
|
||||
(provide 'init-latex)
|
||||
;;; init-latex.el ends
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue