diff --git a/home-config/dotfiles/emacs.d/config/programming-languages.el b/home-config/dotfiles/emacs.d/config/programming-languages.el index 6b328f17..739feda1 100644 --- a/home-config/dotfiles/emacs.d/config/programming-languages.el +++ b/home-config/dotfiles/emacs.d/config/programming-languages.el @@ -245,6 +245,14 @@ string-end) . systemd-mode)) +;; ---------------------------------------------------------------------------------- +;;; Dart +;; ---------------------------------------------------------------------------------- + +(leaf dart-mode + :mode `(,(rx ".dart" string-end)) + :hook (dart-mode-hook . (lambda () (set (make-local-variable 'eglot-x-client-commands) '())))) + ;; ---------------------------------------------------------------------------------- ;;; TypeScript (and other web-related DSLs) ;; ---------------------------------------------------------------------------------- @@ -307,7 +315,8 @@ (leaf eglot :commands (eglot eglot-format eglot-managed-p) :hook (((kotlin-mode-hook web-mode-hook rust-mode-hook python-mode-hook - sh-mode-hook bash-ts-mode-hook c-mode-hook c++-mode-hook nix-mode-hook json-mode-hook) . + sh-mode-hook bash-ts-mode-hook c-mode-hook c++-mode-hook nix-mode-hook json-mode-hook + dart-mode-hook) . eglot-ensure) (eglot-managed-mode-hook . set-eldoc-compose)) :bind (:eglot-mode-map @@ -400,7 +409,10 @@ (reformatter-define latexindent :program "latexindent" :group 'latex-mode - :lighter " LF"))) + :lighter " LF") + (reformatter-define dart-format + :program "dart" + :args '("format")))) (defun autoformat () "Autoformat the current buffer." @@ -410,6 +422,8 @@ (clang-format-buffer)) ('latex-mode (latexindent-buffer)) + ('dart-mode + (dart-format-buffer)) ((or 'mhtml-mode 'web-mode 'scss-mode 'json-mode) (biome-format-buffer)) ('haskell-mode (haskell-mode-stylish-buffer))