Last active
March 13, 2016 06:32
-
-
Save mikeonly/cf4a91a584ba21ce926f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Made a couple of changes in the fork: https://gist.github.com/al3xandru/86375ad91ec03ad40d76