


It's worth understanding some vscode cursor operations to make development as smooth as silk!
This article will take you to talk about the cursor operations in vscode. This article will only cover the cursor operations that are most closely related to us, so let’s get started!
We have only one goal, let us shout our slogan: Make development as smooth as silk! Most of the examples in the article are based on the mac version, because I am a mac, but there is no need to worry about the win version. If you want to break the formation, keep it in mind: command is the ctrl key.
vscode Tips - Cursor Operation
We use the arrow keys every day to operate the cursor. In fact, we also use many of its techniques subconsciously in muscle memory in our daily life. For example, by holding down the cmd key, you can go to the beginning and end of the line, but it is difficult to summarize, and it feels like it is blinding you. Let me give you a breakthrough point: granularity. In our daily use, the left and right arrow keys only have one character, that is, granularity is a character. If we think of the end of a word or sentence, it will be very troublesome; this sentence actually marks our focus: granularity; then, how to operate What about cursor granularity? [Recommended learning: "vscode tutorial"]
Horizontal direction
Combined with the direction keys
Granularity | mac | win |
---|---|---|
option | ctrl | |
cmd | Just use home/end | |
cmd shift \ | Ctrl shift \ |
vertical direction
mac | win | |
---|---|---|
Cmd up and down arrow keys | Ctrl Home/End key | |
Option up and down arrow keys |
Other cursor operations
mac | win | |
---|---|---|
Cmd U | Ctrl U |
Shortcut keys | Detailed explanation | |
---|---|---|
Cmd D | Select the element, then press the shortcut key, vscode will select the next one an identical element and create the cursor; press again to create, and so on. | |
Cmd Option down arrow key | Create a cursor below the current cursor. | |
Option Shift i | Select multiple lines of content, then press the shortcut key, vscode creates a Cursor |
Extensions about cursor operations
Other cursor operations
mac | win | |
---|---|---|
Cmd U | Ctrl U |
Meaning | Remarks | |
---|---|---|
Command value | ||
|
- Negate. For example, if we want to bind a shortcut key when the cursor is not in the editor, then we can use !editorFocus, use ! Negate.
-
==
is equal to. In addition to being boolean, the when condition value can also be a string. For example, - resourceExtname
corresponds to the suffix name of the opened file. If we want to bind a shortcut key to the js file, we can use
resourceExtname == .js.
&&
And operator. We can combine multiple conditional values. For example, if I want the cursor to be in the editor and the editor is editing a js file, then I can use - editorFocus && resourceExtname == .js
.
=~
Regular expression. Still using the above example, if I want to detect whether the file suffix is js, I can also write - resourceExtname =~ /js/
and judge it through regular expressions.
Summary
At this point, the sharing related to cursor operations is over. Regarding the understanding of vscode, it is not a silver bullet and can be used without it. But I always feel that programming itself is boring, but I still need this kind of joy of exploration. I am born with a cliff and there is no limit to learning. I will end this part of our sharing with the essays I wrote after learning at that time: human nature Laziness is not just about appearance, but also about thoughts. Being lazy to think is just getting used to filling pits when encountering them. Jumping into pits is almost an inevitable event. Be diligent in thinking and enjoy thinking.
Finally, let me sum it up in a jingle, I hope it will be helpful to you: Consider granularity when moving, use shortcut keys for multiple ones, self-binding is required for customization, and remember the shift key for operations. For more knowledge about VSCode, please visit:vscode Basic Tutorial
!The above is the detailed content of It's worth understanding some vscode cursor operations to make development as smooth as silk!. For more information, please follow other related articles on the PHP Chinese website!

The ways to format JSON in VS Code are: 1. Use shortcut keys (Windows/Linux: Ctrl Shift I; macOS: Cmd Shift I); 2. Go through the menu ("Edit" > "Format Document"); 3. Install JSON formatter extensions (such as Prettier); 4. Format manually (use shortcut keys to indent/extract blocks or add braces and semicolons); 5. Use external tools (such as JSONLint and JSON Formatter).

Compiling code in VSCode is divided into 5 steps: Install the C extension; create the "main.cpp" file in the project folder; configure the compiler (such as MinGW); compile the code with the shortcut key ("Ctrl Shift B") or the "Build" button; run the compiled program with the shortcut key ("F5") or the "Run" button.

To install Visual Studio Code, please follow the following steps: Visit the official website https://code.visualstudio.com/; download the installer according to the operating system; run the installer; accept the license agreement and select the installation path; VSCode will start automatically after the installation is completed.

The methods to enlarge fonts in Visual Studio Code are: open the settings panel (Ctrl, or Cmd,). Search and adjust "Font Size". Choose "Font Family" with the right size. Install or select a theme that provides the right size. Use keyboard shortcuts (Ctrl or Cmd) to enlarge the font.

How to connect to a remote server through VSCode? Install Remote - SSH Extended Configuration SSH Create a Connection in VSCode Enter connection information: Host, Username, Port, SSH Key Double-click the saved connection in Remote Explorer

Running a Vue project in VSCode requires the following steps: 1. Install the Vue CLI; 2. Create a Vue project; 3. Switch to the project directory; 4. Install project dependencies; 5. Run the development server; 6. Open the browser to visit http://localhost:8080.

How to compare files in VSCode: 1. Open two files, 2. Enable the Differences view (View menu), 3. View the Differences (Add green, delete red, modify purple), 4. Use the arrow keys to navigate, 5. Accept or reject changes. Additional features include merging changes, copying changes, viewing details, and editing differences.

How to run JS code in VSCode? Create .js files and write code; install Node.js and npm; install Debugger for Chrome; open the debug console; select Chrome; add debug configuration; set debug scripts; run code; debug code (optional).


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor