Believe that many students English is not good in playing Code, often don’t understand the words, also believe that a lot of time students forget the interface framework, when writing a project need to read online documentation, online to ask for help and reference for other project example, so if you have encountered this kind of problem, so believe this VS Code plug-in can greatly help to you, It allows you to search online/offline in code, or translate.
use
For a simple tutorial, you can Search Search/Translate Hero in VS Code and click Install. You can also download it here:
- Marketplace.visualstudio.com/items?itemN…
If you are using a domestic Hbuider editor, you can download it here:
- Ext.dcloud.net.cn/plugin?id=3…
search
First of all, the first and most important feature is search. As developers, we need search every day when we write code. When you encounter a library that you don’t understand in the process of writing code, for example: Require (‘ React ‘), you can select the keyword in the code in the editor, right click the mouse, and select Search Online from the menu panel. The plugin will automatically open the default browser for you, Search for the keyword and display the Search results.
Of course, you can also select the corresponding keyword, use the shortcut CMD + Enter (MAC)/CTRL + Enter (win) to open the browser to search, this will be more efficient, no need to switch to the browser each time, type in the search url, type in the keyword and search.
translation
Good news for students who are not good at English. When you encounter a word you don’t understand in the code, you can select the corresponding keyword in the code in the editor, then click the right mouse button, and choose the Traslate Online menu item in the menu panel that appears. The plug-in will automatically open the default browser for you and enter The Google Translate search. Search the translation results of corresponding keywords.
You can also select the corresponding keyword and use the shortcut keys CMD + Shift + Enter (MAC)/CTRL + Shift + Enter (Win) to open the browser for translation.
Here also used offline english-chinese dictionary offline dictionary library plug-in, so support offline dictionary search, is as the same as the above operation, the selected key words in the code, the translation results will appear in the bar at the bottom of the lower right corner, simple translation without frequently consult with baidu and Google translation at the bottom of the display as a result, convenient and clear, If you want to see more detailed translation results, you can click on the Chinese translation results in the lower right corner of the bottom bar, which will open your default browser for online translation.
Switching search engines
If you have other special needs, you can switch between different Search engines by clicking Search Engine on the right side of the bottom bar of the editor, and then selecting the Search Engine you want in the popup option.
You can also right-click on the menu bar and choose Search Online By Switch Engine to directly Switch to the corresponding Search Engine.
If the preset search engine address is not suitable for your use, you can manually update the search engine address by going to the plugin’s Extesion Settings.
The default search engine address format is as follows:
Note: Use %SELECTION% to replace search engine selected keywords
Engine | Url |
---|---|
www.google.com/search?q=%S… | |
Bing | www.bing.com/search?q=%S… |
Github | www.github.com/search?q=%S… |
Baidu | www.baidu.com/search?q=%S… |
Npm | www.npmjs.com/search?q=%S… |
Yahoo | Search.yahoo.com/search?p=%S… |
Wiki | Wikipedia.org/wiki/%SELEC… |
Duck | Duckduckgo.com/?q=%SELECTI… |
Code Pen | Codepen. IO/search/pens… |
Code Sandbox | codesandbox.io/search? Quer… |
For example, you can type in a search engine for a color site and then code it into a wave of Sage mode at any time (manual funny).
You can also set the default search engine by modifying the.vscode/setting.json file. For example, you can change the parameter of search-online.search-engine to Bing.
{
"search-online.search-engine": "Bing"
}
Copy the code
You can add additional search engines by changing the configuration parameters of search-online.add-search-engine in the.vscode/setting.json file.
{
"search-online.add-search-engine": [{"name": "Visual Studio Marketplace"."url": "https://marketplace.visualstudio.com/search?term=%SELECTION%&target=VSCode"
},
{
"name": "Pypi"."url": "https://pypi.org/search/?q=%SELECTION%"}}]Copy the code
If you think the above operation is very troublesome, then you can also increase the Search Engine through the visual interface, at the bottom of the switch Engine panel click ➕ Add Search Engine, and then there will be two input boxes, respectively fill in the following content, you can increase the Search Engine ↓
name: Visual Studio Marketplace
Url: marketplace.visualstudio.com/search?term…
With this, you can search Github for relevant Code with one click, search Npm for relevant library, search Wiki for professional terms, leave your dirty little secrets in Duck Duck Go, paste a few snippets of Code back in Code Pen, and it’s just plain stupid.
Switching translation engine
In general, you can change the language you want to translate in the Settings panel. The default setting is English to Chinese.
But if there are any two situation, such as in writing code and comments, the Russian you want to translate them, then you can put the translation engine switch to the Russian translation Settings, here online translation support for most of the languages of the world, Google translation is a good thing, the subsequent will increase the support of baidu translation engine, please everybody many porcelain ~
Thank you
Finally, if the plug-in is helpful to you, please give us a five-star praise in the plug-in mall, your encouragement is the biggest power for me to move forward!
If you have any questions or suggestions, please go to the feedback link and leave a message. I will get back to you as soon as possible.