spacemacs/layers/+lang/html/funcs.el
baxx df896e4ee5 Added impatient-mode and updated HTML readme
impatient-mode enables one to view HTML document changes live
via a local server, link to package here:

https://github.com/skeeto/impatient-mode/blob/master/README.md

Seemed as though HTML layer was an appropriate place for this.
2017-06-18 14:33:15 +02:00

27 lines
745 B
EmacsLisp

;;; funcs.el --- HTML Layer functions File for Spacemacs
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun spacemacs/emmet-expand ()
(interactive)
(if (bound-and-true-p yas-minor-mode)
(call-interactively 'emmet-expand-yas)
(call-interactively 'emmet-expand-line)))
(defun spacemacs/impatient-mode ()
(interactive)
(if (bound-and-true-p impatient-mode)
(impatient-mode -1)
(unless (process-status "httpd")
(httpd-start))
(impatient-mode)
(when (string-match-p "\\.html\\'" (buffer-name))
(imp-visit-buffer))))