Home

Awesome

Markdown for Vim

A complete environment to create Markdown files with a syntax highlight that doesn't suck!

Features

Why?

I wanted strong support for the Markdown flavor implemented by GitHub. I wanted syntax highlighting that would mirror the result I would find later on GitHub. I wanted syntax highlighting that would not break easily. I wanted syntax highlighting that I could rely on (aka rapid feedback). I wanted something more than mere syntax highlighting. The Markdown Syntax, unfortunately, is so loosely defined that there are flavors of Markdown that are subtly incompatible with each other. The Markdown supported by GitHub is one of them.

Installation

If you use Vundle, add the following line to your ~/.vimrc:

Bundle 'gabrielelana/vim-markdown'

OR

Plugin 'gabrielelana/vim-markdown'

And then execute the following command in your shell:

$ vim +'PluginInstall! vim-markdown' +qall

You can update to the latest version with the following command in your shell:

$ vim +PluginUpdate

If you use vim-plug, add the following to your plugin section:

Plug 'gabrielelana/vim-markdown'

And then execute the following command in your shell:

$ vim +PlugInstall

If you use NeoBundle, add the following line to your ~/.vimrc:

NeoBundle 'gabrielelana/vim-markdown'

And then execute the following command in your shell:

$ vim +NeoBundleInstall +qall

You can update to the latest version with the following command in your shell:

$ vim +NeoBundleInstall! +qall

If you use Pathogen, execute the following in your shell:

$ cd ~/.vim/bundle
$ git clone https://github.com/gabrielelana/vim-markdown.git

If you are not using a package manager, download the tarball and do this:

$ cp vim-markdown-master.tar.gz ~/.vim
$ cd ~/.vim
$ tar --strip-components=1 --overwrite -zxf vim-markdown-master.tar.gz
$ rm vim-markdown-master.tar.gz

Self-Promotion

If you like this plugin, you are welcome to:

Documentation

This section will contain preliminary documentation until full documentation is written.

Configuration

Default Mappings (normal and visual mode)

mappings are local to markdown buffers

Optional Mappings (insert mode)

mappings are local to markdown buffers

Motions

While Editing in Insert Mode

Development

Resources

Syntax Specs

Testing syntax highlighting can be tricky. Here I use the golden master pattern to at least avoid regressions. This is how it works: in ./rspec/features you will find a bunch of *.md files, one for each syntactic element supported. For each of those files there's an HTML file. This file is created with the :TOhtml command and it's the reference (aka golden master) of the syntax highlight of the original file. Running rspec compares the current syntax highlighting of all the feature's files with the reference syntax highlighting. If you see something wrong when looking at some of the feature's files, you can fix it and then regenerate the golden master files with GENERATE_GOLDEN_MASTER=1 rspec

Known Bugs

TODO