diff --git a/docs/modules.org b/docs/modules.org index d9e0271b3..cedcf262a 100644 --- a/docs/modules.org +++ b/docs/modules.org @@ -116,6 +116,7 @@ Modules that bring support for a language or group of languages to Emacs. + [[file:../modules/lang/javascript/README.org][javascript]] =+lsp= - JavaScript, TypeScript, and CoffeeScript support + julia =+lsp= - TODO + kotlin =+lsp+= - TODO ++ [[file:../modules/lang/latex/README.org][latex]] =+latexmk +cdlatex +lsp= - TODO + [[file:../modules/lang/latex/README.org][latex]] =+latexmk +cdlatex +fold= - TODO + lean - TODO + [[file:../modules/lang/ledger/README.org][ledger]] - TODO diff --git a/modules/lang/latex/README.org b/modules/lang/latex/README.org index a70d76989..1baa4a33c 100644 --- a/modules/lang/latex/README.org +++ b/modules/lang/latex/README.org @@ -33,6 +33,8 @@ Provide a helping hand when working with LaTeX documents. ** Module Flags + =+latexmk= Use LatexMk instead of LaTeX to compile documents. + =+cdlatex= Enable [[https://github.com/cdominik/cdlatex][cdlatex]] for fast math insertion. ++ =+lsp= Start LSP automatically in `tex-mode-hook`. This requires the =:tools + lsp= module. Supported servers are `digestif` and `TexLab`. + =+fold= Use TeX-fold (from auctex) to fold LaTeX macros to unicode, and make folding hook-based and less manual. diff --git a/modules/lang/latex/config.el b/modules/lang/latex/config.el index 8d8f4e16b..680778f4d 100644 --- a/modules/lang/latex/config.el +++ b/modules/lang/latex/config.el @@ -70,7 +70,12 @@ If no viewers are found, `latex-preview-pane' is used.") (sp-local-pair modes open nil :actions :rem)) ;; And tweak these so that users can decide whether they want use latex ;; quotes or not, via `+latex-enable-plain-double-quotes' - (sp-local-pair modes "``" nil :unless '(:add sp-in-math-p))))) + (sp-local-pair modes "``" nil :unless '(:add sp-in-math-p)))) + ;; Hook lsp if enabled + (when (featurep! +lsp) + (add-hook! '(tex-mode-local-vars-hook + latex-mode-local-vars-hook) + #'lsp!))) (use-package! tex-fold @@ -209,12 +214,12 @@ is mostly for \\section etc." (add-to-list '+latex--company-backends #'company-auctex-environments nil #'eq) (add-to-list '+latex--company-backends #'company-auctex-macros nil #'eq)) + (use-package! company-math :when (featurep! :completion company) :defer t :init (add-to-list '+latex--company-backends #'+latex-symbols-company-backend nil #'eq)) - ;; bibtex + reftex (load! "+ref")