From 7b13a08a096fa3b84015de6d90362ad69d6d003e Mon Sep 17 00:00:00 2001 From: Willem van den Ende Date: Fri, 1 Mar 2024 22:51:12 +0000 Subject: [PATCH] eglot back to mostly working no flymake errors though. --- config.el | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/config.el b/config.el index 977cdd1..aee9d75 100644 --- a/config.el +++ b/config.el @@ -45,9 +45,44 @@ (require 'org-roam) ;; elixir - (with-eval-after-load 'eglot +;; inspiration https://medium.com/@victor.nascimento/elixir-emacs-development-2023-edition-1a6ccc40629 +(use-package + emacs + :ensure nil + :custom + + ;; Should use: + ;; (mapc #'treesit-install-language-grammar (mapcar #'car treesit-language-source-alist)) + ;; at least once per installation or while changing this list + (treesit-language-source-alist + '((heex "https://github.com/phoenixframework/tree-sitter-heex") + (elixir "https://github.com/elixir-lang/tree-sitter-elixir"))) + + (major-mode-remap-alist + '((elixir-mode . elixir-ts-mode))) +) + +(with-eval-after-load 'eglot (add-to-list 'eglot-server-programs '(elixir-ts-mode . ("sh" "/Users/willem/.elixir-ls/release/language_server.sh" )))) +(use-package + elixir-ts-mode + :hook (elixir-ts-mode . eglot-ensure) + (elixir-ts-mode + . + (lambda () + (push '(">=" . ?\u2265) prettify-symbols-alist) + (push '("<=" . ?\u2264) prettify-symbols-alist) + (push '("!=" . ?\u2260) prettify-symbols-alist) + (push '("==" . ?\u2A75) prettify-symbols-alist) + (push '("=~" . ?\u2245) prettify-symbols-alist) + (push '("<-" . ?\u2190) prettify-symbols-alist) + (push '("->" . ?\u2192) prettify-symbols-alist) + (push '("<-" . ?\u2190) prettify-symbols-alist) + (push '("|>" . ?\u25B7) prettify-symbols-alist))) + (before-save . eglot-format)) + + ;; fix pdflatex for pdf export (setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin")) ;; html export configuration, assuming use in a CMS or static site gerator that