keith / investigate.vim

A Vim plugin for looking up documentation
http://keith.github.io/investigate.vim/
MIT License
297 stars 20 forks source link

Add support for single lookup URL (like devdocs.io) #14

Closed yacoob closed 9 years ago

yacoob commented 9 years ago

It'd be nice to add a way for configuring a single lookup URL for all filetypes, without having to define a ton of investigate_url_for_foo variables. I usually use devdocs.io, which is able to search through multiple docsets and very convenient as it also works offline. It's a bit like Dash, but doesn't require a separate app :)

keith commented 9 years ago

This looks like a great resource! Can you isolate a URL for the query? So that I could do something like http://devdocs.io/?q=foo to search for foo.

keith commented 9 years ago

Nevermind! this happens to be devdocs.io/#q=foo (from http://devdocs.io/help)

keith commented 9 years ago

Please test the branch in https://github.com/Keithbsmiley/investigate.vim/pull/15 with the commented URL string.

yacoob commented 9 years ago

The problem is, the query should ideally contain the name of the doctest to search through, to narrow down the list of results (eg. "js date" from devdocs help page). We can use the ftype for this, but I'm betting there are discrepancies between vim's ftype string and devdocs' docset name :(

keith commented 9 years ago

Hmm, yea. At that point this is getting too custom and even though they'd have the same base URL you'd need to specify them. If the filetypes were the same I could add an identifier for that in the substitute command, but that wouldn't solve the problem it sounds like.

keith commented 9 years ago

Closing this since having to change any part of the string for different languages means you should probably just use the language specific URLs. If you wanted to you write your own function that converts between the different filename identifiers for vim vs the site.