Add arduino stuff

This commit is contained in:
2025-10-22 01:39:43 -07:00
parent 12d8cc0e3e
commit a310e12771

19
init.el
View File

@ -1480,7 +1480,11 @@ With PROJECT, give diagnostics for all buffers in the current project."
"--clang-tidy" "--completion-style=detailed"
"--header-insertion=never" "--pch-storage=memory"
"--function-arg-placeholders"
"--compile-commands-dir=build"))))
"--compile-commands-dir=build")))
;; this should come after the above
(add-to-list 'eglot-server-programs
(cons '(arduino-ts-mode)
'("arduino-language-server"))))
(use-package eglot-inactive-regions
:custom
(eglot-inactive-regions-style 'darken-foreground)
@ -1951,7 +1955,18 @@ If inside a comment and in multi-line comment mode, act as
"gO" #'my/find-other-file-other-window)
(evil-define-key 'normal 'objc-mode-map
"go" #'my/find-other-file
"gO" #'my/find-other-file-other-window))
"gO" #'my/find-other-file-other-window)
(defun -arduino-ts-mode-set-modeline (oldfun)
"Override the modeline set by c++-ts-mode.
This is :around advice, so OLDFUN is the real function
`c-ts-mode-set-modeline'."
(if (not (eq major-mode 'arduino-ts-mode))
(funcall oldfun)
(setq mode-name (concat "Arduino C++" (string-trim-right comment-start)))
(force-mode-line-update)))
(advice-add 'c-ts-mode-set-modeline :around #'-arduino-ts-mode-set-modeline))
(define-derived-mode arduino-ts-mode c++-ts-mode "Arduino C")
(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-ts-mode))
;; GLSL
(use-package glsl-mode)