WebSearch

Web Search 🔎

This extension allows you to search the web in your favorite search engines / websites (editable in extension settings), getting input either from selected text or direct entry in the extension’s search bar.

Animation demonstrating the extension's autocomplete search bar, showing suggestions as a search query is typed, "typescript en" completes to "typescript enum to array" and opens it on Stack Overflow

Features ✨

How To Use 👇

This extension comes packaged with a walkthrough. Use it to learn how to use the extension. (run Get Started: Open Walkthrough from the Command Palette)

You can utilize the extension in many different ways:

Via Context Menu 🖱️

  1. Select the text in your code to search for
  2. Right click and select “Web Search selected text” from dropdown menu
  3. Select the search engine you want to use (add more in the extension settings)

Via Search Bar 🔎︎

  1. Use the keyboard shortcut Alt+` or Command Palette entry of Web Search
  2. Type in the search term you want to search for into the search bar
  3. Select the search engine you want to use (add more in the extension settings)

Via Keyboard Shortcut ⌨️

  1. Select the text in your code to search for
  2. Use the keyboard shortcut Alt+\` (Alt+s on Linux)
  3. Select the search engine you want to use (add more in the extension settings)

Via Command Palette ☰

  1. Select the text in your code to search for
  2. Open the Command Palette and select the “Web Search” item from the dropdown menu
  3. Select the search engine you want to use (add more in the extension settings)

A screenshot of the web Search submenu, displaying the various options to search selected text - all of which can be edited or add your own

Extension Settings ⚙️

webSearch.searchEngines

Search engines to use for the Web Search extension. Replace the query with %s, e.g. https://www.google.com/search?q=%s, the same way as you would when adding additional search engines to Chrome’s settings.

Use the extension settings to manage the search engines easily by pressing the Add Item button (shown below).

A screenshot of the extension's custom search engine settings, modeled after Google Chrome's search engine settings, allowing you to customize your own experience by adding/removing/editing entries. The screenshot displays many search engines entered into the list and also features a large blue button at the bottom labelled 'Add Item'

How to get Your Own Search Engine URLs:

  1. Visit the site you wish to use and locate the site’s search bar
  2. Search for something unique like potato so you can get the URL later. Press Enter
  3. Go into the address bar and replace the word potato with %s, then copy the full URL and paste it into the setting Value field

Search Engine Examples

Want to search for the selected code on Claude (Anthropic)?

Want to search for the selected code on GitHub?

Want to search for the selected code definition on Microsoft Docs?

Want to run the selected URL on Google’s PageSpeed Insights for search engine optimization testing?

webSearch.enableContextMenu

Allows the user to enable or disable the right click context menu. Set to true to enable, false to disable.

A screenshot showing a bunch of code in the text editor of VS Code with the text 'node' selected and a context menu beside it with the text 'web search selected text' highlighted

webSearch.allowManualSearch

Enable the extension to run when no text is selected, asking the user to enter a search query manually. Set to true to enable, false to disable.

webSearch.defaultSearchEngines

Default search engines to use for the Web Search extension - essentially Demo Mode (the extension’s walkthrough will help you through this). If you want to use your own, disable the new checkbox webSearch.useDefaultSearchEnginesList

webSearch.useDefaultSearchEnginesList

Enable the Web Search extension to use default values. Disabling this will favor your own custom search engines list entered in webSearch.searchEngines.

webSearch.messageLevels

Allows the user to control the levels of message output from the extension.

webSearch.allowSuggestions

Adds support for Google suggestions / autocomplete for the extension. Start typing your search query and it will suggest queries.

webSearch.addToSelectedText

When using the extension with selected text, this setting will allow you to elaborate on the selected text before performing the search. If this setting is enabled, the search bar will prompt for additional content to append to the end of the query.

webSearch.keepSearchBarOpen

When using the extension, this setting will keep the extension active (persistent), even if focus is lost from the search bar or search engine selection dropdown. This can be useful if you wish to copy multiple parts of code to perform a search, or are referencing different sections. Set to true to enable.

webSearch.openInIntegratedBrowser

This setting will allow you to open search results in the integrated browser instead of the default system browser. This can be useful for users who prefer to keep their browsing within VS Code or want a more seamless experience. If you wish to open search results in your default system browser, simply set webSearch.openInIntegratedBrowser to false (true by default).

Future Development Ideas and To-dos 📝

➕ Have a feature you’d like me to implement? Submit a feature request on the Repo’s Issues page!

Completed To-dos ✔️

Screenshot example of Web Search being used on a code snippet for the selected text of 'axios', also displaying the search results page of running the extension from Google

Waiting on API Updates ⌛

Requirements 📦

Known Issues 🐛

I spend a lot of time improving and maintaining this extension. If you’d like to sponsor this project, please visit my GitHub Sponsor page to learn more.

One of the perks of being a sponsor is that you will even show up on this very README page!

Release Notes 🆕

See CHANGELOG file.

Software Details 💿