preface

I started as a Java programmer, and my oldest friend is Intelli IDEA editor, a heavyweight product of Jetbrains family, which is well known in the Java world. However, IDEA is mainly used for code writing, text editing and configuration editing. I use Vim. Sublime Text 3, but as I learned more and more programming languages such as Ruby, Go, JavaScript, I started installing a lot of editors on my computer, as follows:

  • Intelli IDEA: Used to edit Java programs
  • RubyMind: For editing Ruby programs
  • GoLand: Used to edit the Go program
  • WebStram: Edit JavaScript programs
  • Sublime Text: Text, Text, JSON, XML and other editing tasks
  • Vim: System, configuration files, small code changes and other editing tasks
  • Typora: Markdown editor
  • And so on…

Not to mention the bewildering number of editors, the space taken up at every turn of GB also strained the disk of my low-profile Macbook, and the shortcut keys and interface layout between different software also caused a great mental burden to learn.

Finally, there is a reason is poor, so much software, to buy legal is not a small cost, I have not tuhao to that point.

In addition, you ask me why I don’t use pirated software, if we programmers still use pirated software, then isn’t it their own job?

I started thinking: Is there an editor that can handle all my editing tasks?

So I began to count my needs for editing and sorted them out as follows:

  • Open source free (hundreds of dollars of Licence every year to buy delicious incense?
  • Lightweight, doesn’t take up much space (Mac disks cost a penny)
  • High performance, after all, I usually have a lot of large file editing work
  • Extensible: When I switch to another programming language, I don’t need to switch tools
  • Can solve all my editing needs, such as programming languages: Java, Ruby, Golang, text editing, Markdown, XML, JSON, etc

I began to imagine that if I found such an editor, I could devote most of my energy to learning it and then delving into it and mastering it.

So that I can do all my editing work with it, so that all editing efficiency can be increased, and therefore overall productivity can be increased.

Not to mention reducing the disk footprint, it can at least reduce the cost and mental burden of learning between different editors.

Then I found it, and today I’m going to share my experience with the protagonist: VSCode

Introduction to VSCode

VSCode is not strictly similar to Jetbrains, it is a plain Text editor similar to TextPad you use on Windows, TextEdit or Sublime Text on Mac, So VSCode is essentially text editing.

Because VSCode is developed based on the Electron framework, it provides excellent support for HTML, CSS, and JavaScript without any security plug-ins, which is why many front-end programmers have always preferred VSCode

In its native form, its core function is editing, but VSCode provides the following built-in features that make it a better editor for programmers than traditional editors:

  • IntelliSense: Machine learning to analyze your past input to provide code completion and functional hints (unlike IDE completion)
  • Built-in Git support: I won’t cover it here, but programmers probably know Git.
  • Built-in Terminal: Sublime Text requires a plugin to integrate terminals, which VSCode delivers right out of the box. Very convenient
  • Plugin market: make your VSCode extension possible (this is the killer feature of VSCode)

Finally, because it’s a cross-platform editor, you don’t have to worry about whether you’re using Windows or Mac

Portable VSCode

The VSCode native package is only 100 MB in size, and can replace Sublime Text, Vim, and Vim for my usual editing without the need for an extension package installation. With a simple PATH configuration, it can replace the Vim command:

Original Vim editor:

vim fileName
Copy the code

Edit with code

Code fileName // Edit the specified file using VScodeCopy the code

Another technique I use more often is to quickly open the edit directory with code

CD /target/dir/ code. // Edit the current directory using VScodeCopy the code

In addition, VSCode has a smoother start curve than Vim, which makes it easier for beginners to gain a sense of accomplishment and stick to it.

performance

In addition to its small space, the editing performance of VSCode is also worth making a difference. At least, I have not encountered a situation in which VSCode can not be opened in nearly half a year’s editing work. The overall performance optimization is much better than that of Atom, and I have never dropped the chain in loading and editing large files. It also has a very low memory footprint, which is much lighter than Jetbrains’ 3-4g models, and you can do lightweight programming with the 8GB Macbook without any problems

Plug-in extension

Extension is the signature ability of VSCode, let’s see how it can be extended by the ability, VSCode extension can be solved by the following two ideas:

  1. Extension Pack: Popular Extension Pack, usually find the language of the Extension Pack to install one click
  2. Plug-ins: Such as Markdown, Vim can install plug-ins directly

Here are a few VSCode extensions to replace Jetbrains:

  • Intelli IDEA: use VSCode + Extension Pack: Java Extension Pack
  • RubyMind: use VSCode + Extension Pack: Ruby Extension Pack
  • GoLand: use VSCode + Extension Pack: Go Extension Pack
  • WebStorm: VSCode native support
  • TypTypora: VSCode + plugin Markdown All in One solution
  • Flow chart: Recommended plugin: PlantUML (now I use it for all system architecture and design class diagrams)

With the plugins mentioned above, VSCode is not powerful enough in many other languages, but 80% of the functionality is enough. The most important thing is that it is convenient, lightweight, and far easier to use than those heavyweight features

VSCode plug-in:

Easy to use plug-ins can make VSCode twice the result with half the effort, recommend several I use and feel easy to use VSCode plug-ins to everyone:

  1. Code Runner: a one-click executable that runs 32 programming languages
  2. Atom One Dark Theme: Atom-based one-dark Theme. One of the market’s most acclaimed dark themes
  3. Git Graph: Git Graph repository, Git repository submission history is very clear
  4. GitLens: without further details, VSCode must install Git plug-ins
  5. LeetCode: if you usually brush questions, you must install it. The integration is very high. Wall cracks are recommended
  6. Markwodn Preview Github Styling: This Is a Github Styling Markdown parser
  7. Peacock: Multi-workspace marker, for students who have multiple workspaces open at the same time, you can use color markers to quickly find the target
  8. VScode- ICONS: A landscaped LIBRARY of VScode ICONS that enhance the aesthetics of many default ICONS
  9. And so on… I hope you find out for yourself
VSCode shortcut keys:

The secret to using a tool effectively is to master its shortcuts,

So here are some commonly used VSCode shortcuts to help you improve your efficiency:

  1. ⌘ + to open user Settings quickly.
  2. ⌘ + ⇪ + P quickly open command panel
  3. ⌘ + ⇪ + O
  4. Quick file lookup: ⌘ + P
  5. Jump to the specified line: ⌃ + G
  6. File search: ⌃ + F
  7. Cross-file search: ⌃ + ⇪ + F
  8. Open terminal: ⌃ + ‘
  9. Create a terminal: ⌃ + ⇪ + ‘
  10. Code formatting: ⌥ + ⇪ + F

These are the most common shortcuts for daily editing

For more details, see the VSCode keyboard mapping table (File -> Preferences -> Keymap Extensions).

VSCode tips:

Share some unknown, efficient and practical VSCode practical experience and tips as follows:

  1. User Settings are divided into User Settings and Workspace Settings. The Settings page is the same. The difference is global and the Workspace takes effect in different scopes
  2. Most of the shortcuts can be done via commands to the control panel (⌘ + ⇪ + P)
  3. Editor. tabSize: 4 Allows you to set the number of Spaces in a TAB
  4. Exclude code and files you don’t want to see in VSCode by setting “files.exclude”: {}
  5. Enter a file name in the resource management window to search for files
  6. Go to Zen Mode with View -> Apperance -> Zen Mode to focus on writing code
  7. Multiple cursor: Hold down Alt + left key to edit multiple text at the same time
  8. File -> Auto Save can be automatically saved directly, or more personalized Settings can be made via settings.json

Here is my experience of using VSCode in recent months. In the future, VSCode will still be my main editor, doing all the writing/text/programming work, after all, it has done a great job in these months. I’m sure VSCode will get more powerful in future releases, and the plugins will get better and richer, so investing your time in VSCode should pay off