72 lines
1.9 KiB
EmacsLisp
72 lines
1.9 KiB
EmacsLisp
;;; packages.el --- dart layer packages file for Spacemacs.
|
|
;;
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
|
;;
|
|
;; Author: Bruno Tavares <connect+spacemacs@bltavares.com>
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
;;
|
|
;; This file is not part of GNU Emacs.
|
|
;;
|
|
;;; License: GPLv3
|
|
|
|
;;; Code:
|
|
|
|
(defconst dart-packages
|
|
'(dart-mode
|
|
flutter
|
|
company
|
|
flycheck))
|
|
|
|
(defun dart/show-buffer ()
|
|
"Shows information at point on a new buffer"
|
|
(interactive)
|
|
(dart-show-hover 't))
|
|
|
|
(defun dart/init-dart-mode ()
|
|
(use-package dart-mode
|
|
:defer t
|
|
:mode "\\.dart\\'"
|
|
:init
|
|
(progn
|
|
(add-hook 'dart-mode-local-vars-hook
|
|
#'spacemacs//dart-setup-backend-lsp)
|
|
(spacemacs/declare-prefix-for-mode 'dart-mode "mf" "find")
|
|
(spacemacs/declare-prefix-for-mode 'dart-mode "mh" "help")
|
|
(spacemacs/set-leader-keys-for-major-mode 'dart-mode
|
|
"=" 'dart-format
|
|
"?" 'dart-show-hover
|
|
"g" 'dart-goto
|
|
"hh" 'dart-show-hover
|
|
"hb" 'dart/show-buffer
|
|
"ff" 'dart-find-refs
|
|
"fe" 'dart-find-member-decls
|
|
"fr" 'dart-find-member-refs
|
|
"fd" 'dart-find-top-level-decls)
|
|
|
|
(add-to-list 'spacemacs-jump-handlers-dart-mode '(dart-goto :async t))
|
|
|
|
(evil-define-key 'insert dart-mode-map
|
|
(kbd "<tab>") 'dart-expand
|
|
(kbd "C-<tab>") 'dart-expand-parameters)
|
|
|
|
(evil-set-initial-state 'dart-popup-mode 'motion)
|
|
(evil-define-key 'motion dart-popup-mode-map
|
|
(kbd "gr") 'dart-do-it-again))))
|
|
|
|
(defun dart/init-flutter ()
|
|
(use-package flutter
|
|
:defer t
|
|
:after dart-mode
|
|
:init
|
|
(progn
|
|
(spacemacs/set-leader-keys-for-major-mode 'dart-mode
|
|
"xx" 'flutter-run-or-hot-reload)))
|
|
)
|
|
|
|
(defun dart/post-init-company ()
|
|
(add-hook 'dart-mode-local-vars-hook #'spacemacs//dart-setup-company-lsp))
|
|
|
|
(defun dart/post-init-flycheck ()
|
|
(spacemacs/enable-flycheck 'dart-mode))
|
|
|
|
;;; packages.el ends here
|