From bb59d3f80828f286e87a318f69823bbb514877f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Diedrich?= Date: Fri, 8 Mar 2024 15:16:29 +0100 Subject: [PATCH] emacs 29 config use-package, treesitter, elixir-ts, eglot --- .emacs | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 .emacs diff --git a/.emacs b/.emacs new file mode 100644 index 0000000..329df82 --- /dev/null +++ b/.emacs @@ -0,0 +1,100 @@ +(use-package emacs + :ensure nil + :custom + (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)))) + +(use-package eglot + :ensure nil + :config + (add-to-list 'eglot-server-programs + `((elixir-ts-mode heex-ts-mode) . + ,(if (and (fboundp 'w32-shell-dos-semantics) + (w32-shell-dos-semantics)) + '("language_server.bat") + (eglot-alternatives + '("language_server.sh" + "/home/marmalade/dev/stuff/3rdparty/lexical/_build/dev/package/lexical/bin/start_lexical.sh")))))) + +(use-package elixir-ts-mode + :ensure t + :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)) + +(use-package exec-path-from-shell + :if (memq window-system '(mac ns x)) + :ensure t + :init + (setq exec-path-from-shell-variables '("PATH" "MANPATH")) + :config + (exec-path-from-shell-initialize)) + +(use-package rainbow-delimiters + :ensure t) + +(use-package prog-mode + :ensure nil + :hook ((prog-mode . rainbow-delimiters-mode))) + +(use-package projectile + :ensure t + :bind-keymap ("s-p" . projectile-command-map) + :init + (setq projectile-mode-line-function '(lambda () (format " [%s]" (projectile-project-name)))) + :config + (projectile-mode +1)) + +(use-package company + :ensure t + :delight company-mode + :demand t + :init + (setq company-idle-delay 0.1 + company-minimum-prefix-length 1) + :bind (:map company-active-map + ("C-n" . company-select-next) + ("C-p". company-select-previous)) + :config + (global-company-mode)) + +(use-package paredit + :ensure t) + +(add-to-list 'package-archives + '("melpa" . "https://melpa.org/packages/") t) + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(custom-enabled-themes '(leuven)) + '(inhibit-startup-screen t) + '(initial-scratch-message nil) + '(package-selected-packages + '(company projectile rainbow-delimiters exec-path-from-shell elixir-mode elixir-ts-mode paredit par-edit use-package org)) + '(scroll-bar-mode nil) + '(tool-bar-mode nil)) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(default ((t (:family "Inconsolata" :foundry "PfEd" :slant normal :weight medium :height 158 :width normal)))))