Add arduino stuff
This commit is contained in:
19
init.el
19
init.el
@ -1480,7 +1480,11 @@ With PROJECT, give diagnostics for all buffers in the current project."
|
|||||||
"--clang-tidy" "--completion-style=detailed"
|
"--clang-tidy" "--completion-style=detailed"
|
||||||
"--header-insertion=never" "--pch-storage=memory"
|
"--header-insertion=never" "--pch-storage=memory"
|
||||||
"--function-arg-placeholders"
|
"--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
|
(use-package eglot-inactive-regions
|
||||||
:custom
|
:custom
|
||||||
(eglot-inactive-regions-style 'darken-foreground)
|
(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)
|
"gO" #'my/find-other-file-other-window)
|
||||||
(evil-define-key 'normal 'objc-mode-map
|
(evil-define-key 'normal 'objc-mode-map
|
||||||
"go" #'my/find-other-file
|
"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
|
;; GLSL
|
||||||
(use-package glsl-mode)
|
(use-package glsl-mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user