Skip to content

Instantly share code, notes, and snippets.

@Rapptz
Created April 10, 2014 01:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rapptz/10335601 to your computer and use it in GitHub Desktop.
Save Rapptz/10335601 to your computer and use it in GitHub Desktop.
import sublime, sublime_plugin
def open_url(url):
sublime.active_window().run_command("open_url", { "url": url })
class PromptQuickDocCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.show_input_panel("Documentation Search:", "", self.on_done, None, None)
pass
def on_done(self, text):
try:
if self.window.active_view():
self.window.active_view().run_command("quick_doc", {"text": text} )
except ValueError:
pass
class QuickDocCommand(sublime_plugin.TextCommand):
def run(self, edit, text):
open_url("http://en.cppreference.com/mwiki/index.php?title=Special:Search&search=%s" % text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment