feat(emacs): add QML configuration

This commit is contained in:
2025-11-01 11:38:58 +01:00
parent 880d9a0a4a
commit 5c28ff6d39

View File

@@ -45,6 +45,7 @@ variables to install grammars for different languages.
(toml "https://github.com/tree-sitter/tree-sitter-toml") (toml "https://github.com/tree-sitter/tree-sitter-toml")
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src") (tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src") (typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
(qml "https://github.com/yuja/tree-sitter-qmljs")
(yaml "https://github.com/ikatyang/tree-sitter-yaml")))) (yaml "https://github.com/ikatyang/tree-sitter-yaml"))))
#+end_src #+end_src
@@ -720,6 +721,29 @@ or some I write myself.
org-plantuml-jar-path "~/.local/bin/plantuml.jar")) org-plantuml-jar-path "~/.local/bin/plantuml.jar"))
#+end_src #+end_src
*** QML
Im currently working on a [[https://quickshell.org/][Quickshell]] configuration to replace my
[[https://github.com/Alexays/Waybar][Waybar]] one. Quickshell is configured with [[https://doc.qt.io/qt-6/qmlapplications.html][QML]], which requires its
major mode.
#+begin_src emacs-lisp
(use-package qml-ts-mode
:after lsp-mode
:straight (qml-ts-mode :build t
:type git
:host github
:repo "xhcoding/qml-ts-mode")
:config
(add-to-list 'lsp-language-id-configuration '(qml-ts-mode . "qml-ts"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("qmlls" "-E"))
:activation-fn (lsp-activate-on "qml-ts")
:server-id 'qmlls))
(add-hook 'qml-ts-mode-hook (lambda ()
(setq-local electric-indent-chars '(?\n ?\( ?\) ?{ ?} ?\[ ?\] ?\; ?,))
(lsp-deferred))))
#+end_src
*** Ron files *** Ron files
Rusty Object Notation, or RON for short, is to Rust what Json is to Rusty Object Notation, or RON for short, is to Rust what Json is to
Javascript. Sometimes, I have to work with such files, which is why I Javascript. Sometimes, I have to work with such files, which is why I