sponsor Vim development Vim logo Vim Book Ad

instant-markdown.vim : Real-time Markdown previews from Vim!

 script karma  Rating 24/8, Downloaded by 519    Comments, bugs, improvements  Vim wiki

created by
Suan Yeo
 
script type
utility
 
description
Want to instantly preview finnicky markdown files, but don't want to leave your favorite editor, or have to do it in some crappy browser textarea? vim-instant-markdown is your friend! When you open a markdown file in vim, a browser window will open which shows the compiled markdown in real-time, and closes once you close the file in vim.

As a bonus, github-flavored-markdown is supported, and styles used while previewing are the same as those github uses!

Supported platforms: OSX and Unix/Linuxes

To file bugs, feature requests, send patches, or to simply follow the development of instant-markdown, visit its project page at https://github.com/suan/vim-instant-markdown
 
install details
You first need to have Ruby with RubyGems, and node.js with npm installed. (In the future there might be a version which won't require node.js at all, making installation easier). Then do the following:

[sudo] gem install pygments.rb

If you're using Ruby 1.9.2 or later, [sudo] gem install redcarpet. Otherwise, [sudo] gem install redcarpet -v 2.3.0

[sudo] npm -g install instant-markdown-d

If you're using Linux, the xdg-utils package needs to be installed.

Download the script into ~/.vim/plugin


Configuration
-------------
By default, vim-instant-markdown will update the display in realtime.  If that taxes your system too much, you can specify
    let g:instant_markdown_slow = 1
before loading the plugin (for example place that in your `~/.vimrc`). This will cause vim-instant-markdown to only refresh on the following events:
- No keys have been pressed for a while
- A while after you leave insert mode
- You save the file being edited

By default, vim-instant-markdown will automatically launch the preview window when you open a markdown file. If you want to manually control this behavior, you can specify
    let g:instant_markdown_autostart = 0
in your .vimrc. You can then manually trigger preview via the command :InstantMarkdownPreview. This command is only available inside markdown buffers and when the autostart option is turned off.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
instant-markdown.vim 0.0.7 2013-10-31 7.3 Suan Yeo ### 0.0.7 (10-31-2013)
thanks to @terryma!

- Added option to only start previewing markdown on demand
instant-markdown.vim 0.0.5 2012-12-06 7.3 Suan Yeo ### 0.0.5 (12-05-2012)
These changes are _also_ courtesy of @chreekat!

- Plugin no longer breaks vim mouse scrolling
- No longer errors upon opening an empty markdown file
- `instant_markdown_slow` option to update preview less frequently
instant-markdown.vim 0.0.4 2012-12-05 7.3 Suan Yeo ### 0.0.3 (04-26-2012)
Some changes for this release were made in the backend. Do `[sudo] npm -g update instant-markdown-d` to get them.

- Delay starting the `instant-markdown-d` server. This fixed the plugin for a few people who were getting empty browser windows.
- Display a message with configuration instructions when the preview window can't be closed due to Firefox restrictions.

### 0.0.4 (12-05-2012)
All these changes courtesy of @chreekat, THANKS!

- Is now an `after/ftplugin` plugin. Markdown filetype detection is left to Vim itself, or other plugins.
- Behavior when multiple markdown files are open has been improved
- No more weird characters taking over the status/command bar while editing
- Internals have been completely rewritten and are much more cleaner and adhere to vim script best practices
instant-markdown.vim 0.0.2 2012-03-29 7.0 Suan Yeo Initial upload
ip used for rating: 54.226.0.225

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo