Comments (7)
I don't know if Firefox used to not share a window name, but now it appears to:
$ firefox --version
Mozilla Firefox 62.0.3
$ xprop | grep 'WM_NAME(STRING)'
{Click on Firefox}
WM_NAME(STRING) = "vim-markdown-preview.html - Mozilla Firefox"
$ xdotool search --name 'vim-markdown-preview.html'
56623121
Changing the browser name option to Mozilla Firefox
should make it work :)
let vim_markdown_preview_browser='Mozilla Firefox'
The name is important, as the plugin script searches for the full name of the browser in the window. If it was set to something like 'Firefox' then I don't think it would work.
The relevant plugin code is:
if g:vmp_osname == 'unix'
let chrome_wid = system("xdotool search --name vim-markdown-preview.html - " . g:vim_markdown_preview_browser . "'")
if !chrome_wid
if g:vim_markdown_preview_use_xdg_open == 1
call system('xdg-open vim-markdown-preview.html 1>/dev/null 2>/dev/null &')
else
call system('see vim-markdown-preview.html 1>/dev/null 2>/dev/null &')
endif
else
let curr_wid = system('xdotool getwindowfocus')
call system('xdotool windowmap ' . chrome_wid)
call system('xdotool windowactivate ' . chrome_wid)
call system("xdotool key 'ctrl+r'")
call system('xdotool windowactivate ' . curr_wid)
endif
endif
This makes it always open a new window if it can't find the window using xdotools search
.
With the right value of name it will also swap the focus back to vim which is very nice.
from vim-markdown-preview.
Facing this as well.
from vim-markdown-preview.
I also have this bug.
from vim-markdown-preview.
That is because firefox does not report the filename in its window name, so xdotool
can't search for it. For now, only chromium-browser
and the like do report the filename. So you either change your xdg-open
(if you use that setting), or the see
browser. Or just be like me, fork and replace see
with chromium-browser
😏
from vim-markdown-preview.
thanks @drmason13 ^^ It worked for me
from vim-markdown-preview.
Same here, using qutebrowser, opened with xdg-open
.
My settings:
let vim_markdown_preview_use_xdg_open=1
let vim_markdown_preview_hotkey='<C-m>'
let vim_markdown_preview_toggle=2 " display on buffer write
from vim-markdown-preview.
I had the same issue as OP, and changing the browser name to 'Mozilla Firefox'
made it so that the tab doesn't even open at all. I'm on MacOS 10.15.4
, Grip 4.5.2
.
from vim-markdown-preview.
Related Issues (20)
- This plugin doesn't support arch HOT 2
- How do I set url?
- Support for Brave Browser HOT 3
- Doesn't work with remote files HOT 2
- Suggestion - Better syntax highlighting in ```code``` ```enhancement```
- executing job failed: Bad CPU type in executable - Mac M1
- html file created
- I get "Internal Server Error" when call Vim_Markdown_Preview() HOT 1
- Allow preview to be displayed in kiosk mode? HOT 2
- 'call Vim_Markdown_Preview()' can't open the chrome automatically HOT 5
- adding syntax highlightening?
- Markdown not matching with Github HOT 1
- Change the top title
- CSS 404 not found HOT 1
- Vim_Markdown_Preview_Local error HOT 1
- "Please install the necessary requirements: https://github.com/JamshedVesuna/vim-markdown-preview#requirements" HOT 1
- wrong error if attempting preview if the file is not saved
- How to Install Daring Fireball's Markdown.pl? HOT 2
- Can you make it more clear which `grip` you are referring to in the README
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-markdown-preview.