Fast Github-flavored Markdown previews synchronized with changes to an emacs buffer (no need to save).
Clone this repo, and
(require 'vmd-mode) or
Why write a new Markdown preview package?
I wanted a better one for my own needs.
In my experience, it's no problem to have pretty gigantic Markdown files (thousands of lines) and the thing stays responsive.
vmdis using node's
fsnotifyto watch that temp file, and emacs is writing that temp file in the buffer's
after-change-functions. This is always going to be faster than any websocket-based implementation, and I find this makes editing documentation more fun, which increases the likelyhood that I will document things, and generally leads to Good Times.
and mimics Github's markdown rendering
so far, so good...
Video of the functionality
A brief video that shows what this minor mode does
With a markdown file open in a buffer, just call
;; You could also (global-set-key (kbd "M-m p") 'vmd-mode) ;; make a global binding for that, (add-hook 'markdown-mode-hook 'vmd-mode) ;; or add a hook...
Multiple Markdown buffers can be previewed simultaneously; each will have its own preview window.
If you use
company-mode completion, you can configure it to complete Github's emoji mnemonics like this:
(require 'cl-lib) (require 'company) (defun vmd-company-backend (command &optional arg &rest ignored) (interactive (list 'interactive)) (cl-case command (interactive (company-begin-backend 'company-sample-backend)) (prefix (and (eq major-mode 'fundamental-mode) (company-grab-symbol))) (candidates (cl-remove-if-not (lambda (c) (string-prefix-p arg c)) vmd-mode/github-emojis-list)))) (add-to-list 'company-backends 'vmd-company-backend)
- The limitations of
- It's probably terrible elisp (please help make it better!