Open current file in web browser in Vim

前端 未结 9 608
自闭症患者
自闭症患者 2020-12-24 15:01

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:

9条回答
  •  佛祖请我去吃肉
    2020-12-24 15:37

    For Mac, you might have to type something that looks more like this:

    nnoremap f :exe ':silent !open -a /Applications/Firefox.app %'
    nnoremap c :exe ':silent !open -a /Applications/Google\ Chrome.app %'
    nnoremap g :exe ':silent !open -a /Applications/Google\ Chrome.app %'
    nnoremap s :exe ':silent !open /Applications/Safari.app %'
    

    Notce it's Safari.app on the end...it'll save you a few minutes. :)

提交回复
热议问题