Search Anywhere Plugin


An Updated version is now available at Sublime Plugins – Search Anywhere

This plugin is an improvement over Sublime Text 2 Search Stack Overflow where the user can now choose which search engine to use by default and per file type. This means that you could have all your .js files search on Stack Overflow, while all your .php files search on and any other search on Google, for example.

All the commands are available through a simple set of menus in the Tools section or with the right click of the mouse. They are also all listed under Search Anywhere in the command palette.

For now, the supported search engines are Google, Stack Overflow,, Bing and Yahoo. In the next version I will add a command to “suggest” a new search engine to be added.

Please do not hesitate to contact me with any question or feedback!

9 thoughts on “Search Anywhere Plugin

  1. Knud Potente says:

    Thank you for such a fantastic plug-in!

    Suggestion for search engines to be added in a future version:

    1) SitePoint:
    Publishes some of the best free, online – and searchable – generic reference guides for HTML, CSS and Javascript. It is possible to access the reference for a certain language construct (tag/function/etc.) using URLs such as:

    2) When Can I Use…?
    A thorough and constantly updated – and searchable – table of all HTML5 and CSS3 language extensions and additions, with a comprehensive description of the past, present and future state of support of each feature in each browser version. Searches can be made directly by using the following URL:
    * (i.e.,

    Once again, many thanks for such a great extension to Sublime Text!

  2. Eric says:

    Just added both, thanks for the suggestion, I didn’t know about these sites!

  3. Knud Potente says:

    Wow, you are so quick!

    Already upgraded my Search Anywhere plug-in! Thank you!!! 🙂

    One more suggestion:

    Has fantastic, up-to-date and thorough (community-driven) documentation for HTML, CSS and Javascript. Searches can be done via the URL, using the following syntax:

    For instance: (article element in HTML5) (nth-child CSS3 pseudo-class) (js global function)

    Once again, many thanks – and keep up the good work!

  4. Sheldon says:

    I’ve been using your plugin recently and I’m enjoying it! I have a few questions and suggestions…

    Is it possible to assign hotkeys to the various search commands? If so could you add instructions in the readme?

    The command “Search Anywhere: from Input (ask Search Engine)” doesn’t work for me, it first asks me the search engine and then gives the error:
    Traceback (most recent call last):
    File “./”, line 84, in on_select_done
    TypeError: GetSearchEngineEntry() takes exactly 1 argument (0 given)

    I’m using Ubuntu and ST2 build 2183.

    Suggestion: add Ruby and Ruby on Rails support
    Ruby: (not sure how to format the search term)

    Suggestion: when there’s no selection and search by selection is chosen search the word that the cursor is currently on
    Suggestion: hide/remove/add search engines manually
    Suggestion: when searching from input provide search suggestions, e.g. for google use (I’m not sure if this is possible with non-google engines but this would be a sweet feature!)


  5. Eric says:

    Thanks for the feedback Sheldon!

    I fixed the Search from Input, I’m about to submit it on github. I also added the 2 search engines you suggested and your first suggestion. The management of the list of search engines will come at a later date.

    With the current API I have, it would be pretty hard to do something like search suggestions but as Jon keeps updating Sublime Text 2, I’ll keep an eye out for changes that might allow me to do it!

    As for keyboard shortcuts use Preferences -> Key Bindings (Default) as an example to add new entries in Preferences -> Key Bindings (User), and the available commands so far for the plugin are: search_anywhere_from_selection, search_anywhere_from_input, search_anywhere_select_default_search_engine, search_anywhere_select_search_engine_for_type, search_anywhere_from_selection_ask and search_anywhere_from_input_ask. I’m working on a site for the plugins where there will be detailed information for stuff like that.


  6. Sheldon says:

    Thanks Eric, it’s working great!

    One more suggestion: after invoking one of the commands that requires input, user should be able to press esc to cancel.

  7. Eric says:

    The “Esc” behavior is already working like that, at least on my version. What happens for you when you press Esc? Can you tell me your OS and Sublime Text version? It could help pin pointing the issue.


  8. Paul says:

    One more search engine I’d suggest for inclusion:
    When searching with duckduckgo, you can include keywords like !github or !w3schools and it will redirect the search to that site, which would make choosing a search engine on the fly painless.

  9. Branton says:

    Thanks so much for handy plugin!

    Here are the shortcuts I set up, in case anyone wants a starter:

    /** Search Anywhere shortcuts **/
    { “keys”: [“alt+s”], “command”: “search_anywhere_from_selection”},
    { “keys”: [“alt+shift+s”], “command”: “search_anywhere_from_selection_ask”},
    { “keys”: [“alt+i”], “command”: “search_anywhere_from_input”},
    { “keys”: [“alt+shift+i”], “command”: “search_anywhere_from_input_ask”},
    { “keys”: [“ctrl+alt+s”], “command”: “search_anywhere_select_default_search_engine”},
    { “keys”: [“ctrl+shift+s”], “command”: “search_anywhere_select_search_engine_for_type”}

Leave a Reply

Your email address will not be published. Required fields are marked *