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?
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.
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!