Skip to main content
All CollectionsAuthor HelpMarkdown and Markua
I am using Vim to write my Leanpub book and I'm having issues with code snippet markup. Can you help?
I am using Vim to write my Leanpub book and I'm having issues with code snippet markup. Can you help?

Keywords: Vim

Leanpub Support avatar
Written by Leanpub Support
Updated over 2 years ago

Switch to Emacs.

Just kidding!

A Leanpub author shared this:


I just want to share a little fix I made to the markdown syntax in order to make it working with the code markup that this wonderful service requires when you want to insert a snippet of code in your books.

Just create a markdown.vim file in your .vim/after/syntax dir and add the following lines:


syn match markdownLeanCode '^<<(.*)$'
hi def link markdownLeanCode markdownH1

Now your code snippets won't mess up with the official markdown syntax provided by Vim

Did this answer your question?