G
G
Grigory Vasilkov2017-02-02 11:39:50
Sublime Text
Grigory Vasilkov, 2017-02-02 11:39:50

Sublime Text - How to write a "hotkey" to search for selected text in php.net?

How to open browser from sublime with "search in php.net" option and passing request?
I have a list of chrome launch keys, but I won’t lie in all English and the size in 40 sheets, can anyone do it for themselves?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Vasilkov, 2017-02-02
@gzhegow

For Windows. Any linuksoid will make for himself, if he wants.

import os, sublime, sublime_plugin

class ChromeSearchPhpnetCommand(sublime_plugin.WindowCommand):
  def run(self):
    view = self.window.active_view()
    text = view.substr((view.sel())[0])
    text = "http://php.net/manual-lookup.php?pattern=" + text + "&lang=ru&src=%7Breferrer:source?%7D"
    os.system("start /b /d \"C:\\Program Files (x86)\\Google\\Chrome\\Application\" chrome.exe " + text + " -incognito -start-maximized")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question