VS Code (visual studio code) VSC editor (Microsoft produced, js development editor)

A. Select the appropriate editor to improve programming efficiency

代码编辑器的选择,可以说是开发者社区中一个经久不衰的话题,现今编辑器的数量数不胜数,vim,sublime Text,Emacs,Atom等等,那么对于一个开发者而言,挑选一个合适的编辑器是可以有效的提高编程效率;

When you select the editor, three factors to consider:

1. Select the text editor, the programming requirements of how high the efficiency of the code;

2. Select the editor voice support for programming how, configuration is complicated;

3. Select the editor plug-in eco-how, whether active in the community;

VSCode: is a free, open-source, high-performance, cross-platform, lightweight code editor, at the same time, in terms of performance, language support, the open source community has also done a very good!

II. Science Editor, in the end what should learn

Editor's learning just like learning a programming language similar to the beginning of time are not familiar with a programming language, may be from the official documents, from start to finish of this language learning content, learning process, but some small grammar it may affect the progress of your learning, to complete after you master the grammar, you will find that dot syntax problems encountered at the beginning of learning is not so important.

Mastering a programming language, when you want to learn another programming language, and is in accordance with the first way of learning to learn the language, so that you do not understand the language from the global, and no longer mind the establishment of a "learning framework."

In fact, a new programming language is often a short board to solve the old language, but their nature has not changed much in fact, if you can build in learning the language of the first set of their own "learning framework" and then to learn a new language when it will be more efficient.

At the same time, learning to learn the editor, and also edit the language. When using a tool, you should be most concerned about is that it used to do, to do what it is good at, and what it can not do; in other words, refers to 'limit' and 'limit' of this tool

First of all, we first find out what the editor of 'lower limit':

1. Selection shortcut:

We must first consider whether the editor and then use the shortcut key will be when the system comes with shortcut keys there is a conflict;
secondly, to refer to other development tools shortcut key combinations, to meet the user habits;
Finally, and most importantly, we have to look whether there is a shortcut key for unity;
配置的统一性:Shift键只能用于控制文本选择,Ctrl或者Cmd键只能当做辅助键,Tab用于控件之间的跳转等。

2. programming language and framework of support:

When you select an editor, we need to consider how to support its case that the programming language you have to use syntax highlighting is correct, is it possible to automatically complete your code can be debugged directly or run testing;

3. Select and support workflow(工作流:是对工作流程及其各操作步骤之间业务规则的抽象、概括描述。)

The last factor, is the editor of choice and support the work flow, such as Vim editor ( http://www.runoob.com/linux/linux-vim.html ) does not own Explorer, if you Vim wish to see the file tree and quickly switch file you need to install the appropriate plug-in; but now most of the editors are integrated directly into the Explorer, VSCode comes with version management, version management can be said that the redevelopment process an identity in an important position, but some test functions integrated development tools right into it, this demand is not so people thought that it was necessary to develop daily;

Then, we say it is the editor of the 'upper limit':

If an editor enables users to write plug-ins to customize function, then it's 'cap' on high. Tools such as Eclipse allows you to modify any function, they are the 'upper limit' theory is infinite, but the expansion of the editor of this matter, or the needs of the community and individuals, can achieve from this height is unknown.

Eclipse is one of the most popular java editor, java programming language plug-in also, so it's plug-in community is still very active, but the Eclipse plug-in to run the main program, once the plug-in performance worrying, it will affect the Eclipse own experience.

VSCode plugin development language is JavaScript, so writing extensions for many people is no threshold, as most people would write about how much js, so for VSCode plug for community activity or do not worry, mainly to consider how to avoid jumping into the Eclipse pit.

About the editor of 'upper limit' and 'limit' factor I think we can then select the editor when the need to consider the direction of learning and, of course, the most important thing is more hands-on;

III. About VSCode

VSCode(Visual Studio Code):它是一个免费的,开源的跨平台编辑器。之所以强调‘编辑器’,可能是VSCode并无意成为一个全尺寸的集成开发环境,也就是IDE。
它是由Erich Gamma把Monaco Editor移植到桌面平台上,成为了现今的VSCode。

Many people regard the editors equivalent to the IDE, it's not. IDE more emphasis on programming experience, have a good understanding of the code, while focusing on support provides a graphical interface for debugging, testing and so on. Therefore, it may appear cumbersome;

The editor is relatively lighter weight, focus on files or folders, language support, workflow more abundant and free, VSCode position is the editor, but not limited thereto.

Open source development platform:

First, VSCode source code to MIT license (Open Source China) open source, which means we can get VSCode core code free, community-based VSCode can code, develop their own products; and VSCode often from some well-known projects draw valuable experience.

Secondly, VSCode source code is hosted on GitHub, while using development plan and test GitHub, so that each user can understand development progress VSCode on GitHub, the development of a user, you can better understand the products.

Furthermore, VSCode comes with support TypeScript and Node.js, the user can immediately download VSCode get smart javascript and nodejs tips, and without any configuration debugging nodejs, however VSCode team does not proficient in all languages, so for them are not familiar with the language, VSCode how to support it? The best way is to let professional people to do, so VSCode provides a unified API for programming workers (ie Language Server Protocol and Code Debugging Protocol), so that each language can be better supported.

VSCode study guide

1.VSCode have its own keyboard shortcuts, you can understand the core editor features supported by learning shortcuts. Meanwhile, VSCode allows custom shortcut keys, allowing users to better use VSCode. VSCode mouse, cursor and more, search has comprehensive support for auto-completion, code snippets and so readily available.

2. Learn to use tables, workspaces, VSCode in addition to the editor area, there are many other features such as Explorer. Cross-document search, management, and other plug-ins, they make up a unified interface, it is the table; this table design represents VSCode choice of workflow. VSCode built-in software version management, terminal emulator, debugger, etc., can improve efficiency.

3.VSCode allows you to customize and develop plug-ins, so try their own ideas, to meet their own needs, to better enhance their understanding VSCode;

4. Watch released monthly update log, attention VSCode official blog;

Through the above steps, better use good VSCode, improve work efficiency.

Summary: Positioning VSCode is lightweight code editor, combines the advantages of a lot of good tools such as Eclipse, while also addressing their drawbacks, VSCode in performance, language support, communities are very good;

VSCode update log: https://code.visualstudio.com/updates/v1_27

VSCode official blog: https://code.visualstudio.com/blogs/2018/09/12/engineering-with-azure-pipelines

VSCode community: https://code.visualstudio.com/community

IV. Quick Start VSCode

Installation and version selection

VSCode has two distribution channels, is a common stable version, released a major version every month; the other is the insiders, Monday to Friday 6:00 am released, also VSCode version uses internal team, the purpose is to better found Bug. Microsoft inside there is a special term for this approach: eat your own dog food (to eat their own dog food).

VSCode present in the world there are about fifteen thousand users in the use of insiders version. But new to VSCode, stable version will be relatively fit. But if you already use VSCode period of time, you can try insiders. With the stable version will be released later that month because the use of this version can be used for the latest features as soon as possible, generally VSCode new features will be first in line on insiders, such as running for some time. After larger changes may run for two months will push the stable version.

Next, add a new function is often immature, insiders can use GitHub first time to view the feedback and suggestions for new features, and can even provide the code.

Download and install VSCode:

Official website: https://code.visualstudio.com

Initial use VSCode

VSCode第一次启动的时候会显示一个‘欢迎使用’页,主要是为了方便快速打开文件,文件夹以及访问历史文件,更换主题色,更换快捷键等:

 
Initial use interface

This interface has many features that might interest you:

1. Command panel:

We may or Ctrl + Shift + P (Cmd on mac + Shift + P) key to open the command panel VSCode shortcut key F1. !

 
Command Panel

VSCode can find most of the commands from the command panel, so as long as the familiar command panel, you can not have a mouse, use the keyboard to fully complete coding.

2. Interface Overview:

Placement VSCode default interface in different parts of the name and shortcut keys. VSCode stressed that no mouse, but remember the shortcut key pain points will become a lot novice, this interface just to solve this pain point.

 
Interface Overview

3. Interactive acting field:

Open this interface, we will see a lot of English tutorial that through a variety of interactive examples, demonstrates the use of some advanced editing code functions, each function will have a snippet editor and can be for our use.

 
Interactive play field

Five .VSCode shortcuts

Move the cursor

1.option + ←: move to the front word;

2.option + →: move to the end of most word;

3.option + arrow key: the mobile unit to the word;

4.cmd + ←: move to the top of the current line;

5.cmd + →: move to the very end of the current line;

6.cmd + shift + \: Jump between curly braces;

7.cmd + down key: the first document is moved to the last row;

Text selection

Based on words, lines, a document and a cursor operation shift key to move the cursor to select the text simultaneously;

Deletion

删除当前选中文本内容(Windows:home+shift;macOS:cmd+left+shift)

1.cmd + Backspace: Deletes all the characters after the current cursor line;

2.cmd + delete: delete all the characters before the cursor;

3.option + delete: the word before the current cursor character deleted;

4.option + Backspace: Delete the character after the current word under the cursor;

Custom keyboard shortcuts

Open a command panel (F1 or ctrl + shift + p) Search 'Open keyboard shortcut', you can replace or remove shortcuts;

 
Custom keyboard shortcuts

Advanced shortcuts six .VSCode

1.cmd + shfit + k: Delete the current line of code;

2.cmd + x: Cut this line of code;

3.cmd + Enter: add a new row above the current row;

4.option + 'arrow keys': the current line or a few lines of code currently selected editor then move up and down;

5.option + shift +‘上下方向键’:向上向下复制当前行;

移动代码行,代码缩进发生改变

添加注释

1.cmd + / :注释一行代码;

2.option + shift + A :注释一整段代码;

格式化代码

1.option + shift + F :格式化代码;

2.cmd + K cmd + F :格式化选中行代码;

3.cmd + shift + P :代码缩进;

七.文件、符号、代码之间的快速跳转

1.Ctrl + Tab(同时按住),继续按着Ctrl键,松开Tab键 :打开当前打开文件的列表,选择要打开文件,松开Ctrl就能打开对应文件;

2.Ctrl + P :打开最近打开文件列表,同时列表顶部出现搜索框,搜索文件名,回车(Enter),可以再当前窗口打开对应文件;使用Cmd + Enter会在新的编辑器窗口打开这个文件。

3.Ctrl + g :行跳转,输入对应数字回车,可以跳转到当前文件的当前行。

4.Ctrl + p(输入文件名 + “:” + 行数):跳转到指定文件的指定行数。

5.Cmd + shift + O :调出当前文件的符号(函数名等),使用方向键或者搜索,回车,就能跳转到你想要的符号;如果输入“:”可以对当前文件的所有符号进行分类;

6.Ctrl + T :打开多个文件,搜索多个文件中的符号;

7.F12:跳转到函数的定义处;Cmd + F12 :跳转到函数的实现位置;注:js中没有接口的概念,定义和实现是相同的,所以js中的F12和Cmd + F12效果是一样的;

8.Shift + F12 :打开函数引用的预览(把光标放在函数或者类上,按Shift+F12可以打开一个引用列表和内嵌编辑器)

八.VSCode中的鼠标操作

1.在VSCode中,单击鼠标左键:把光标移动到响应的位置;双击鼠标左键:将当前光标下的单词选中;三击鼠标左键:选中当前行代码;四次点击鼠标左键:选中整个文档。

2.鼠标左键单击行号:直接选中所在行;按住鼠标左键再行号上下移动:可以选中多行代码;

3.拖动选中的代码,按住鼠标左键,移动鼠标可以改变代码位置;如果想在拖动时复制一份代码,可以按住Ctrl键,操作结果就能从原来的“剪切+复制”变成“复制+黏贴”。

4.VSCode中,如果鼠标拥有中键,只需要按下鼠标中键,然后对着一段文档拖出一个框,再框中的代码就被选中了,而且每一行选中的代码,都有一个独立的光标。

5.悬停提示窗口:当鼠标移动到某些文件上之后,一会就会显示跟鼠标下文本相关的信息;如果鼠标放在某个函数上,按下Ctrl时,则能再悬停提示的窗口上看到该函数的实现。

6.代码的跳转和链接:如果我们把鼠标放在函数上时,函数下方会出现一个下划线,然后当我们按下鼠标左键时,就能跳转到该函数的定义处。
当我们再编写Markdown这样的非编程语言的文档时,通过Ctrl+鼠标左键能打开超级链接。

Guess you like

Origin www.cnblogs.com/best-coder/p/11550305.html
Recommended