emacs: Add QML mode and tree-sitter
Some checks failed
/ check (push) Failing after 1h10m8s

This commit is contained in:
Erwin Boskma 2024-02-15 08:36:05 +01:00
parent e82ece7cba
commit f6173d7fbd
Signed by: erwin
SSH key fingerprint: SHA256:9LmFDe1C6jSrEyqxxvX8NtJBmcbB105XoqyUZF092bg
2 changed files with 45 additions and 13 deletions

View file

@ -1286,14 +1286,14 @@ Add support for Elixir with [[https://github.com/elixir-editors/emacs-elixir][el
#+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))
: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)))
@ -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

View file

@ -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