Dienstag, 6. Oktober 2015

Edit Markdown with vim like a king!

When i did start writing Markdown files, it was for my projects on github. After editing on githubs webpage, i was using vim at local repositories.

After a short time, i figured out that chromium has a Markdown interpreter. It's called MarkDown Preview Plus. I installed it because of the following features:

  • It can read local files.
  • On the fly refresh - When you edit your markdown file and store it, the interpreter upgrades the view automatically. 

After i installed the file, i was wondering if i couldn't bind chromium to a vim hotkey.

So i added this line to my .vimrc:
autocmd BufEnter *.md exe 'noremap <F5> :! chromium %:p<CR>'

This line binds the key F5, on files ending with .md to chromium. So, when you press F5 chromium opens and the Markdown Preview Plus interprets the file.


Keine Kommentare:

Kommentar veröffentlichen