devdocs.vim icon indicating copy to clipboard operation
devdocs.vim copied to clipboard

If devdocs.io is allready open in a tab in safari, use that tab

Open svennidal opened this issue 8 years ago • 2 comments

Is there a possibility to use an allready open tab in Safari instead of opening a new one each time?

svennidal avatar Apr 19 '16 18:04 svennidal

I don't have any idea to reuse a tab already opened in a browser. If you know how to know that from shell command, please let me know.

rhysd avatar Apr 30 '16 08:04 rhysd

I finally got it working with osascript for macOS and Google Chrome. Although, Safari should be easy too. I created a npm package for that code and here is the instructions.

First install my package.

npm install --global reopen-cli

Create a vim command for that.

command! -nargs=* Docs call system(printf('reopen "https://devdocs.io/?q=%s"', <q-args>))

And set keywordprg to that command.

set keywordprg=:Docs

Now, pressing K under any keyword (or e.g. :Docs child_process) will bring DevDocs docs and repeating that would replace current open tab.

kutsan avatar Mar 12 '18 11:03 kutsan