Markdown syntax highlighting in Vim and Nano in Ubuntu

This is more of a personal reference post more than sharing it for the public.

Markdown has started pervading the Internet more than anything. From Stack Exchange and GitHub to Reddit and Tumblr, big names use Markdown for marking up text online.

Now, some of us want the cool syntax highlighting in our favourite command-line text editors. At least I did and I did find an elegant solution for both Vim and Nano. Unfortunately, I almost forgot what I did when I reinstalled my system and had to pour through the Internet again to get back the system. Hence, I thought, why not document somewhere so I can just refer to it whenever I need to get back the markdown syntax highlighting?

Vim
Plastic boy has done a splendid job prepping up a syntax for Markdown. Summing up the steps in simple commands for those in a hurry:

wget http://plasticboy.com/dox/vim-markdown.zip
mkdir .vim
unzip vim-markdown.zip -d ~/.vim

That’s about all you need to do to setup syntax highlighting in Vim.

Nano
Another set of commands for setting up Markdown syntax highlighting in Nano:

wget https://raw.github.com/serialhex/nano-highlight/master/markdown.nanorc
echo "include $HOME/markdown.nanorc" >> .nanorc

You might also want to edit your markdown.nanorc file and include .mkd file extension to be recognized as markdown.

See also: Syntax highlighting in Nano.

Now that you have done setting up Vim and Nano to highlight markdown syntax, have fun writing!

About these ads

3 thoughts on “Markdown syntax highlighting in Vim and Nano in Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s