mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add cdlatex support in latex: +cdlatex
cdlatex has 4 main functionalities: + Math and environments snippets: I've disabled these in favor of yasnippet when using :editor snippets by just unbinding the TAB in cdlatex's keymap + Auto insertion of closing delimiters: disabled in favor of smartparens + Fast insertion for some macros: `a becomes \alpha. Kept as-is + Fast accent insertion: a'~ becomes \tilde{a}. Kept as-is I also updated the docs, and added a section explaining how to re-enable cdlatex's snippets despite having yasnippet.
This commit is contained in:
@ -119,6 +119,30 @@ If no viewers are found, `latex-preview-pane' is used.")
|
||||
(lambda () (* (/ 10.0 (preview-document-pt)) preview-scale))))
|
||||
|
||||
|
||||
(use-package! cdlatex
|
||||
:defer t
|
||||
:when (featurep! +cdlatex)
|
||||
:hook (LaTeX-mode . cdlatex-mode)
|
||||
:config
|
||||
;; Disabling keys that have overlapping functionality with other parts of Doom
|
||||
;; smartparens takes care of inserting closing delimiters
|
||||
(define-key cdlatex-mode-map "$" nil)
|
||||
(define-key cdlatex-mode-map "(" nil)
|
||||
(define-key cdlatex-mode-map "{" nil)
|
||||
(define-key cdlatex-mode-map "[" nil)
|
||||
(define-key cdlatex-mode-map "|" nil)
|
||||
(define-key cdlatex-mode-map "<" nil)
|
||||
;; TAB is used for cdlatex's snippets and navigation. But have yasnippet for that.
|
||||
(when (featurep! :editor snippets)
|
||||
(define-key cdlatex-mode-map "\t" nil))
|
||||
|
||||
;; AUCTeX takes care of auto-inserting {} on _^ if you want, with `TeX-electric-sub-and-superscript'
|
||||
(define-key cdlatex-mode-map "^" nil)
|
||||
(define-key cdlatex-mode-map "_" nil)
|
||||
;; AUCTeX already provides this with `LaTeX-insert-item'
|
||||
(define-key cdlatex-mode-map [(control return)] nil))
|
||||
|
||||
|
||||
;; Nicely indent lines that have wrapped when visual line mode is activated
|
||||
(use-package! adaptive-wrap
|
||||
:hook (LaTeX-mode . adaptive-wrap-prefix-mode)
|
||||
|
Reference in New Issue
Block a user