JamshedVesuna / vim-markdown-preview

A light Vim plugin for previewing markdown files in a browser - without leaving Vim.
580 stars 91 forks source link

Support for Brave Browser #104

Open mrolli opened 3 years ago

mrolli commented 3 years ago

I am on vmp_osname == 'mac' and switched from "Google Chrome" to "Brave Browser", which is technically the same.

While it works be taking the open -a branch in the plugin code, I face the fact that on every preview a new tab is opened. I was used to have it resued. So I started fiddling...

Change made:

   if g:vmp_osname == 'mac'
-    if g:vim_markdown_preview_browser == "Google Chrome"
+    if g:vim_markdown_preview_browser == "Google Chrome" || g:vim_markdown_preview_browser == "Brave Browser"
       let b:vmp_preview_in_browser = system('osascript "' . g:vmp_search_script . '"')

On next invocation of the preview function I was faced with the app chooser window of macOS (Can't find Google-Chrome, point me to the app, ...). I selected "Brave Browser.app" and since then I'm good to go and it works as expected. The question now is, how could we achieve an out-of-the-box-all-ok experience for Brave users?

I'd like to hear in what direction you'd like to go and I would be happy to prepare a PR thereafter.

PezCoder commented 2 years ago

I was looking for a similar requirement, where I want to rather open these previews specifically in the brave browser, even though I also have chrome installed.

Dave-Lindberg commented 2 years ago

An out-of-the-box-all-ok experience for Brave users would be awesome.

mrolli commented 2 years ago

Sorry, guys, but the owner of this project never replied nor merged my other PR. Its safe to say that development here is stalled.

Meanwhile I switched from Vim to Neovim. In terms of previewing markdown, I switched over to iamcco/markdown-preview.nvim. The latter works with Vim or Neovim and works out of the box with many more features. Best part: the scroll position and the changes you make in markdown are instantly reflected in the preview! Give it a chance.