I\'d like to be able to send the HTML file I\'m currently editing in vim
to my web browser, Chrome. I\'m running Linux.
This gets me very close:
Here are various tips on previewing files in your browser from Linux, Windows, and Mac OS X. Preview current HTML file
This mapping allows you to use a browser to preview the HTML file currently being edited.
nnoremap
:silent update silent !firefox %:p & If necessary, the current file is saved, then Firefox is used to open the file. Replace "firefox" with the name of another browser if wanted, such as "chromium-browser".
So as the question states that Chrome is the desired browser, then add this to your vimrc:
nnoremap :silent updatesilent !google-chrome %:p &
As well as answer the OP, I wanted to share this link for those that reached this question in search of Windows and Mac OS X support.