diff --git a/home-manager/modules/emacs/config.org b/home-manager/modules/emacs/config.org index 130b5ff..b778b89 100644 --- a/home-manager/modules/emacs/config.org +++ b/home-manager/modules/emacs/config.org @@ -1284,19 +1284,19 @@ Prefer local packages from =node_modules= to global ones Add support for Elixir with [[https://github.com/elixir-editors/emacs-elixir][elixir-mode]]. The =elixir-format= hook sets up the correct formatter configuration when in a =projectile= project. #+begin_src emacs-lisp - (use-package elixir-mode - :after eglot - :hook ((elixir-format . (lambda () - (if (projectile-project-p) - (setq elixir-format-arguments - (list "--dot-formatter" - (concat (locate-dominating-file buffer-file-name ".formatter.exs") ".formatter.exs"))) - (setq elixir-format-arguments nil)))) - (elixir-mode . (lambda () (add-hook 'before-save-hook 'elixir-format nil t))) - (elixir-mode . eglot-ensure)) - :config - ;; (setq lsp-elixir-server-command '("elixir-ls")) - (add-to-list 'auto-mode-alist '("\\.[hl]eex\\'" . elixir-mode))) + (use-package elixir-mode + :after eglot + :hook ((elixir-mode . eglot-ensure)) + ;; ((elixir-format . (lambda () + ;; (if (projectile-project-p) + ;; (setq elixir-format-arguments + ;; (list "--dot-formatter" + ;; (concat (locate-dominating-file buffer-file-name ".formatter.exs") ".formatter.exs"))) + ;; (setq elixir-format-arguments nil)))) + ;; (elixir-mode . (lambda () (add-hook 'before-save-hook 'elixir-format nil t))) + :config + ;; (setq lsp-elixir-server-command '("elixir-ls")) + (add-to-list 'auto-mode-alist '("\\.[hl]eex\\'" . elixir-mode))) #+end_src Add a [[https://github.com/ayrat555/mix.el][mix]] minor mode to call =mix= tasks from emacs. @@ -1460,6 +1460,26 @@ Enable clangd LSP for C and C++ ((c++-mode c++-ts-mode) . eglot-ensure)) #+end_src +Add some flags to clangd + +#+begin_src emacs-lisp + (with-eval-after-load 'eglot + (add-to-list 'eglot-server-programs + '((c-mode c-ts-mode c++-mode c++-ts-mode) + . ("clangd" + "--malloc-trim" + "--log=error" + "--clang-tidy" + "--completion-style=detailed")))) +#+end_src + +Add QML mode + +#+begin_src emacs-lisp + (use-package qml-mode + :mode "\\.qml\\'") +#+end_src + Enable and configure =auto-insert-mode= for Horus projects #+begin_src emacs-lisp diff --git a/home-manager/modules/emacs/default.nix b/home-manager/modules/emacs/default.nix index 14c04e7..f2f3743 100644 --- a/home-manager/modules/emacs/default.nix +++ b/home-manager/modules/emacs/default.nix @@ -38,6 +38,17 @@ let }; }; + tree-sitter-qml = pkgs.tree-sitter.buildGrammar { + language = "tree-sitter-qmljs"; + version = "unstable-2024-02-02"; + src = pkgs.fetchFromGitHub { + owner = "yuja"; + repo = "tree-sitter-qmljs"; + rev = "9fa49ff3315987f715ce5666ff979a7742fa8a98"; + sha256 = "q20gLVLs0LpqRpgo/qNRDfExbWXhICWZjM1ux4+AT6M="; + }; + }; + emacsWithPackages = pkgs.emacsWithPackagesFromUsePackage { config = let @@ -98,6 +109,7 @@ let tree-sitter-nu tree-sitter-pioasm tree-sitter-python + tree-sitter-qml tree-sitter-query tree-sitter-regex tree-sitter-rst