:date: 2014-02-20 12:09 .. index:: tech, vim, markdown VIM and markdown ================ .. image:: /_images/images/gallery/2014/2014-placeholder/logo-markdown.png :scale: 50 :alt: Markdown logoƄ :align: right `Markdown `_ (still) is my way to write down these blogg entries. While I usually use `Eclipse `_ to edit the files (simply because the editor is open all the time) I recently started appreciating the Syntax highlighting in `VIM `_. First with Puppet code (that was really(!) nice), then with Markdown... The installation is quite simple. There are at least three different ways of doing it, depending on what you prefer. Since I'm not so fancy about additional tools and shit, I went for the for the plain installation directly from the tar-ball. That one was easier than expected. Though there are different implementations for it as well, I went for `Plasticboy's `_ module. As it's stated in the Readme of the `repositiory `_ you #. Download `the tar-ball `_ #. Decompress it into your vim profile folder .. code:: $ cd ~/.vim $ wget https://github.com/plasticboy/vim-markdown/archive/master.tar.gz $ tar --strip=1 -zxf vim-markdown-master.tar.gz Alternatively we can just get the latest version from the GIT repository: .. code:: $ git clone https://github.com/plasticboy/vim-markdown.git $ cd vim-markdown $ sudo make install $ vim-addon-manager install mkd ------ This markdown support has one negative side: double spaces trailing a line will be displayed in bright yellow. This should work to disable the end-of-line space highlighting when using the plasticboy mkd plugin: .. code:: :syn clear mkdLineBreak This could be dropped into autocmd to avoid doing it manually every time again you load a markdown file. To just turn down the yellow-volume into something softer, we can change the highlighting rule: .. code:: :hi link mkdLineBreak Underlined Also showing them slightly darker or lighter is an option worth to consider, using custom ctermfg, ctermbg, guifg, guibg settings. More information about link highlight groups, enter `:help highlight` or `:help group-name`. That will give you a list of groups that can be linked. ------ For setting the syntax anyway when the file is not recognized automatically: .. code:: :set syntax=markdown Include this into `~/.vimrc` to apply it automatically to md-files: .. code:: au BufRead,BufNewFile *.md set filetype=markdown