Giter VIP home page Giter VIP logo

vmd-mode's Introduction

vmd-mode.el

Fast Github-flavored Markdown previews synchronized with changes to an emacs buffer (no need to save).

Dependencies

Clone this repo, and (require 'vmd-mode) or (use-package vmd-mode)

Why write a new Markdown preview package?

I wanted a better one for my own needs.

  • It's fast

In my experience, it's no problem to have pretty gigantic Markdown files (thousands of lines) and the thing stays responsive. vmd is using node's fsnotify to 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 :suspect: ๐Ÿ‘ โค๏ธ

so far, so good...

Video of the functionality

A brief video that shows what this minor mode does

https://www.youtube.com/watch?v=-mb9_501Ipo&feature=youtu.be

Usage

With a markdown file open in a buffer, just call (vmd-mode).

                                         ;; 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.

Completion

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)

Limitations:

  • The limitations of vmd
  • It's probably terrible elisp (please help make it better! ๐Ÿ˜„).

License: MIT

Author: Blake Miller

๐Ÿ˜„ criticism & PRs are welcome ๐Ÿ˜„

vmd-mode's People

Contributors

blak3mill3r avatar kaushalmodi avatar geo7 avatar

Stargazers

Kyle avatar

Watchers

Steve Purcell avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.