This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/graphviz/packages.el

50 lines
1.9 KiB
EmacsLisp
Raw Normal View History

;;; packages.el --- graphviz layer packages file for Spacemacs.
;;
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
;;
;; Author: luxbock <opieppo@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defconst graphviz-packages
'((graphviz-dot-mode :location (recipe :fetcher github
:repo "luxbock/graphviz-dot-mode"))
smartparens))
(defun graphviz/init-graphviz-dot-mode ()
(use-package graphviz-dot-mode
:mode (("\\.diag\\'" . graphviz-dot-mode)
("\\.blockdiag\\'" . graphviz-dot-mode)
("\\.nwdiag\\'" . graphviz-dot-mode)
("\\.rackdiag\\'" . graphviz-dot-mode)
("\\.dot\\'" . graphviz-dot-mode)
("\\.gv\\'" . graphviz-dot-mode))
:config
(progn
(spacemacs|add-toggle graphviz-live-reload
:status graphviz-dot-auto-preview-on-save
:on (graphviz-turn-on-live-preview)
:off (graphviz-turn-off-live-preview)
:documentation "Enable Graphviz live reload.")
(spacemacs/set-leader-keys-for-major-mode 'graphviz-dot-mode
"=" 'graphviz-dot-indent-graph
"c" 'compile
"t" 'spacemacs/toggle-graphviz-live-reload)
(when dotspacemacs-major-mode-emacs-leader-key
(spacemacs/set-leader-keys-for-major-mode 'graphviz-dot-mode
dotspacemacs-major-mode-emacs-leader-key 'graphviz-dot-preview))
(when dotspacemacs-major-mode-leader-key
(spacemacs/set-leader-keys-for-major-mode 'graphviz-dot-mode
dotspacemacs-major-mode-leader-key 'graphviz-dot-preview)))))
(defun graphviz/post-init-smartparens ()
(spacemacs|use-package-add-hook graphviz-dot-mode
:post-config
(progn
;; allow smartparens to work properly
(define-key graphviz-dot-mode-map "{" nil)
(define-key graphviz-dot-mode-map "}" nil))))