Skip to content

Instantly share code, notes, and snippets.

@mikeonly
Last active March 13, 2016 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikeonly/cf4a91a584ba21ce926f to your computer and use it in GitHub Desktop.
Save mikeonly/cf4a91a584ba21ce926f to your computer and use it in GitHub Desktop.
;;; markdown-edit-mode.el --- provide markdown-editing environment
(make-local-variable
(defvar markdown-prev-theme spacemacs--cur-theme))
(defcustom markdown-edit-mode-hook nil
"The hook to run when markdown-edit-mode is toggled."
:type 'hook)
(defcustom markdown-edit-theme 'leuven
"Theme to load for markdown environment.")
;;;###autoload
(define-minor-mode markdown-edit-mode
"Toggle markdown-edit-mode.
With ARG, turn markdown-edit-mode on if ARG is positive."
:global nil
:lighter " me"
(if markdown-edit-mode
(progn
(switch-to-buffer-other-frame (current-buffer))
(load-theme markdown-edit-theme t)
(spacemacs/toggle-line-numbers-off)
(spacemacs/disable-hl-line-mode)
(set-window-margins (selected-window) 20 20)
(set-face-attribute 'default (selected-frame) :height 140)
(set-frame-size (selected-frame) 125 65))
(progn
(set-window-margins (selected-window) 0 0)
(spacemacs/toggle-line-numbers-on)
(delete-frame)
(helm-themes--load-theme (symbol-name markdown-prev-theme)))))
(provide 'markdown-edit-mode)
@al3xandru
Copy link

Made a couple of changes in the fork: https://gist.github.com/al3xandru/86375ad91ec03ad40d76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment