Vim Markdown



Vim markdown

  1. Vim Markdown Viewer
  2. Github Vim Markdown
  3. Vim Markdown Editor

This is a new version and distribution of the Markdown syntax highlight. Visit for more information about this plugin/syntax. How I Take Notes With Vim, Markdown, and Pandoc May 15, 2018 I’ve gone through quite a few revisions of my note-taking process and now that I’m in my final year of school, I think I’ve finally found a system that I’m going to stick with.

02 Jan 2016

While writing a post yesterday I noticed there were some gaps in my vim setup for when I'mauthoring a markdown file so here are a few tips for polishing up your markdown experience in vim,specifically for jekyll blogs.

Front Matter

Starting at the top, literally, with the front matter. It was looking a bit weird out of the box:

It's rather inconsequential data compared to the meat of the document, the actual content. I found ahelpful blog post with some details that worked for me. The heart of which is to parse between the---s and consider this content a comment.

Vim Markdown Viewer

After, it looks a little less odd.

Textwidth

I prefer a little more space when I'm writing so I change the width before text wraps to somethingslightly more than my default 80 character width - like 100 characters. In my autocommand group Iplace something like:

Fenced-in Languages

If you have many, or maybe super-specific, languages and syntaxes you commonly use in your markdownyou can specify them in your vimrc to be interpreted as such.

Snippets

I use snipmate but I guess the same can be applied with something like UltiSnips? Probably. In anycase, snippets are a lifesaver for the occasional piece of code or markup you can either neverremember the exact syntax for, or are slightly awkward to type. For me it's more often the former.

~/.vim/snippets/markdown.snippets

The first two are for links and image tags, respectively. I consistently confuse the two so whyleave it to guessing? The front snippet is handy in that date for the permalink is automaticallypopulated when the snippet is expanded.

Preview Your Markdown

A tweet from Ches asking about previewing documents piqued my curiosity so I decided to look into ita little further. His suggestion to try the QuickLook plugin was met with failure, as he mentioned,as there's some weirdness when you try to launch from terminal. From finder it seems to work justfine but that defeats the purpose of being vim-driven, right? The next best thing would be toleverage a native mac app to get a look at what our rendered markdown files look like. The app Iprefer is called MacDown and has plenty of good features if you ever feel like dropping into a guiapp instead of vim.

MacDown comes with a cli command you can use to open documents from the terminal but I've found thatit doesn't retain your preferences and switches to the defaults once you use it. Using OS X's opencommand, however, does retain your preferences. So, about getting vim to play nice with this? Not sohard:

So <leader>pre will now open up MacDown with the current document so I can get a good look. Notbad!

Github Vim Markdown

The changes to MacDown's preferences I've found useful:

  • General > Put editor on the right. I don't care much about the editor, so it gets shoved right.
  • Rendering > Detect Jekyll front-matter. For those of us jekyll users.

Helpful Plugins

Vim Markdown Editor

  • goyo.vim plugin. A really nice distraction free writing plugin suggested by Thomas.
  • tpope's markdown plugin. Arguably unecessary but provides some fenced codeblock extras.
  • Chris Toomey's titlecase plugin. Teach Vim about titlecase, with support for motions and text objects
  • Chris Toomey's quicklink plugin. This is nothing short of beautiful. A Vim plugin for quicklylooking up a topic in google and inserting the relevant link. Bonus video with some insight on thesetwo plugins from Chris.