Open Selection In
A VS Code extension that allows you to open selected text in configured websites via right-click menu.
Features
- Quick Access: Select any text in the editor, right-click to open in your configured websites
- Customizable: Add, remove, or edit menu items via the configuration UI
- Multiple Sites: Configure multiple search sites (npm, GitHub, Stack Overflow, etc.)
- Bilingual: Supports English and Chinese (Simplified)
- Flexible Variables: Use
${encoded} for URL-encoded text or ${selectedText} for raw text
Usage
- Select any text in your code editor
- Right-click and choose "Open Selection In..." (or "在...中打开" in Chinese)
- Select a website from the quick pick menu
- The selected text will be searched on the chosen website
Keyboard Shortcut
Ctrl+Shift+O (Windows/Linux)
Cmd+Shift+O (macOS)
Configuration
Via Settings UI
- Press
Ctrl+Shift+P (or Cmd+Shift+P on macOS)
- Type "Configure Menu Items" and press Enter
- Add, edit, or delete menu items
- Click Save to apply
Via settings.json
{
"openSelectionIn.menuItems": [
{ "label": "npmjs", "url": "https://www.npmjs.com/search?q=${encoded}" },
{ "label": "GitHub", "url": "https://github.com/search?q=${encoded}" },
{ "label": "Stack Overflow", "url": "https://stackoverflow.com/search?q=${encoded}" }
],
"openSelectionIn.language": "en"
}
Available Variables
${encoded} - URL-encoded selected text
${selectedText} - Raw selected text
Language Settings
Set openSelectionIn.language to:
en - English
zh-cn - Chinese (Simplified)
License
MIT
| |