diff --git a/elisp/firejail-mode.el b/elisp/firejail-mode.el index 3c875bf..e16be3c 100644 --- a/elisp/firejail-mode.el +++ b/elisp/firejail-mode.el @@ -122,12 +122,12 @@ dbus-\\(system\\|user\\) +\\(none\\|filter\\)?\\)" . 2)) (define-derived-mode firejail-profile-mode prog-mode "Firejail-Profile" "Major mode for editing firejail profiles." + :syntax-table firejail-profile-syntax-table (add-to-list (make-local-variable 'completion-at-point-functions) #'firejail-profile-capf) (setq-local font-lock-defaults '(firejail-profile-font-lock-keywords) comment-start "#" - comment-end "") - (set-syntax-table firejail-profile-syntax-table)) + comment-end "")) (add-to-list 'auto-mode-alist '("\\.\\(firejail\\|profile\\|local\\)$" . firejail-profile-mode)) diff --git a/elisp/kdl-ts-mode.el b/elisp/kdl-ts-mode.el index 7fe8f7d..4a92a24 100644 --- a/elisp/kdl-ts-mode.el +++ b/elisp/kdl-ts-mode.el @@ -29,10 +29,10 @@ (defvar kdl-ts-mode--syntax-table (let ((table (make-syntax-table))) - (modify-syntax-entry ?= ".") - (modify-syntax-entry ?/ ". 124") - (modify-syntax-entry ?* ". 23b") - (modify-syntax-entry ?\n ">") + (modify-syntax-entry ?= "." table) + (modify-syntax-entry ?/ ". 124" table) + (modify-syntax-entry ?* ". 23b" table) + (modify-syntax-entry ?\n ">" table) table) "Syntax table for `kdl-ts-mode'.") diff --git a/init.el b/init.el index d567253..3e647b1 100644 --- a/init.el +++ b/init.el @@ -1169,14 +1169,16 @@ With PROJECT, give diagnostics for all buffers in the current project." "gA" #'eglot-code-actions "gs" #'consult-eglot-symbols) (eglot-inlay-hints-mode -1)) - (setq eglot-autoshutdown t) + (setq eglot-autoshutdown t + eglot-ignored-server-capabilities '(:documentOnTypeFormattingProvider)) :config (add-to-list 'eglot-server-programs (cons '(c-mode c-ts-mode c++-mode c++-ts-mode objc-mode) '("clangd" "--all-scopes-completion" "--background-index" "--clang-tidy" "--completion-style=detailed" "--header-insertion=never" "--pch-storage=memory" - "--function-arg-placeholders")))) + "--function-arg-placeholders" + "--compile-commands-dir=build")))) ;; LTeX (languagetool) (require 'ltex-eglot) @@ -1522,7 +1524,16 @@ otherwise, call `bibtex-find-text'." ;; java-ts-mode (use-package java-ts-mode - :hook (java-ts-mode . eglot-ensure)) + :hook ((java-ts-mode . eglot-ensure) + (java-ts-mode . my/-setup-java-ts-mode)) + :config + (defun my/-setup-java-ts-mode () + (let ((rules (car treesit-simple-indent-rules))) + (setcdr rules + (cons '((and (parent-is "array_initializer") + (node-is "array_initializer")) + parent-bol java-ts-mode-indent-offset) + (nthcdr 1 rules)))))) ;; c-ts-mode (use-package c-ts-mode @@ -1607,11 +1618,9 @@ otherwise, call `bibtex-find-text'." ;; cmake (require 'cmake-mode) +(require 'cmake-ts-mode) (with-eval-after-load 'cmake-mode - (defun my/setup-cmake-ts-mode () - "Setup `cmake-ts-mode' buffers." - (setq-local indent-line-function #'cmake-indent)) - (add-hook 'cmake-ts-mode-hook #'my/setup-cmake-ts-mode)) + (setq cmake-ts-mode-indent-offset tab-width)) ;; kdl (require 'kdl-ts-mode) @@ -2416,8 +2425,7 @@ one of the normal rainbow-delimiters-depth-N-face faces." ;; Highlight todos (use-package hl-todo - :config - (global-hl-todo-mode 1)) + :hook (prog-mode . hl-todo-mode)) (use-package magit-todos :after (hl-todo magit) :config