Open In Web
This extension allows you to open the default browser and go to specified URL pattern, in which will be inserted selected text.
Using
There're 3 ways to use extension:
By context menu:
- Select some text in editor.
- Right-click on selection to show context menu.
- Select
"Open In Web"
option to open Google search for selection.
By command palette:
- Select some text in editor.
- Open command palette and type
"Open In Web"
.
- Select
"Open In Web"
command for quick open default url or "Open In Web: Choose url"
command for choosing url from Web Action List
.
By keyboard shortcut:
- Define a keyboard shortcut for
openInWeb.openInWeb
command or openInWeb.openInWebActionList
command.
- Select some text in editor.
- Press shortcut combination to open wanted url with selection.
Specifying url template
You can specify web sites which can be opened by extension.
There're openInWeb.defaultAction
property for default action template and openInWeb.actionList
for Web Action List
templates.
If openInWeb.defaultAction
property is empty, Web Action List
will be opened instead of default url opening.
Url template can contain %SELECTION%
and %LANG%
keywords. %SELECTION%
will be replaced by selected text and %LANG%
will be replaced by current file language (html, javascript, xml...).
For example, default settings of extension:
{
"openInWeb.actionList": [
{
"url": "https://www.google.com/search?q=%SELECTION%",
"label": "Google Search"
},
{
"url": "https://yandex.ru/search/?text=%SELECTION%",
"label": "Yandex Search"
},
{
"url": "https://duckduckgo.com/?q=%SELECTION%",
"label": "DuckDuckGo Search"
},
{
"url": "https://www.google.com/search?q=%LANG%%20%SELECTION%",
"label": "Google Search (+language)"
},
{
"url": "https://yandex.ru/search/?text=%LANG%%20%SELECTION%",
"label": "Yandex Search (+language)"
},
{
"url": "https://duckduckgo.com/?q=%LANG%%20%SELECTION%",
"label": "DuckDuckGo Search (+language)"
},
{
"url": "https://translate.google.com/#auto/en/%SELECTION%",
"label": "Google Translator (ENG)"
},
{
"url": "https://translate.yandex.ru/?text=%SELECTION%",
"label": "Yandex Translator (AUTO)"
}
],
"openInWeb.defaultAction": "https://www.google.com/search?q=%SELECTION%",
}
Release Notes
1.0.1 (03.07.2017)
- Fixed vscode-nls dependancy.
1.0.0 (03.07.2017)
License
MIT