Files
.emacs.d/modules/languages/siren-dart.el
Jim Myhrberg 7c253d986c feat(editor): improve code folding with origami
Add and configure origami, and enable it for majro modes where it seems
to do a good job, and keep using hideshow for other major modes.
2022-07-20 22:02:12 +01:00

46 lines
1.0 KiB
EmacsLisp

;;; siren-dart.el --- jimeh's Emacs Siren: dart-mode configuration.
;;; Commentary:
;; Basic configuration for dart-mode.
;;; Code:
(require 'siren-lsp)
(require 'siren-origami)
(require 'siren-projectile)
(use-package dart-mode
:mode "\\.dart\\'"
:interpreter "dart"
:hook
(dart-mode . siren-dart-mode-setup)
:custom
(dart-format-on-save t)
(dart-enable-analysis-server t)
:preface
(defun siren-dart-mode-setup ()
(when (fboundp 'highlight-symbol-mode)
(highlight-symbol-mode -1))
(when (fboundp 'auto-highlight-symbol-mode)
(auto-highlight-symbol-mode -1))
(lsp-deferred)
(origami-mode t)
(subword-mode y))
:init
(with-eval-after-load 'origami
(add-to-list 'origami-parser-alist
'(dart-mode . origami-c-style-parser)))
(with-eval-after-load 'projectile
(add-to-list 'projectile-project-root-files-bottom-up "pubspec.yaml")
(add-to-list 'projectile-project-root-files-bottom-up "BUILD")))
(provide 'siren-dart)
;;; siren-dart.el ends here