yii.
← Writing
開發筆記 · · 4 min read · 閱讀中文版

23 Powerful VS Code Shortcuts with Best Performace On Mac

For Flutter developer|Efficient shortcut keys

Photo by Joshua Reddekopp on Unsplash

這篇寫於 2022 年。工具和 API 變化很快,部分步驟可能已經不適用。

This article explains a lot of powerful and easy-to-use shortcut keys. While developing with VS Code, it saves time and improves work efficiency the most, making you like to use VS Code to complete applications. This article belongs to Mac users.

(Content includes custom shortcut settings)

Search file#

Quickly search files within a project.

Command + P

Search the entire project#

Search items by keyword and show what’s included.

Shift + Command + F

Command window#

Use VS Code commands to easily trigger some functions to help development.

Shift + Command + P

Switch sidebar#

Sometimes you need to make the screen have more space to present the code, it is more comfortable to develop, you can quickly close the sidebar.

Command + B

Open/Toggle windows#

When multiple places in the project need to be viewed and compared, it is suitable to open a new window.

Command + 1234

Select text#

Quickly select the string at the cursor position and make adjustments.

Command + D

Toggle pagination#

When you don’t have a mouse or don’t want to use it, the shortcut keys are a good helper to easily switch between pages.

Control + 1234

Select pagination#

When there is multiple pagination interference, opening a specific page is the best way.

Control + Tab

Copy the current page#

Command + \

Close all pagination#

A very commonly used set of shortcut keys, I like to clear all the pages after a period of time, otherwise too much is too messy.

Option + W

Indent#

It is convenient for us to typesetting, and the entire line can be adjusted regardless of whether the mouse is at the front or not.

Control + [
Control + ]

Collapse and expand blocks#

When there are many codes and methods, put away the currently useless blocks to make the development vision better.

Option + Command + [
Option + Command + ]

Move the number of lines where the cursor is located up and down#

When the code writes a wrong line or needs to adjust the position, you can quickly move through the keyboard.

Option + ↑
Option + ↓

Copy the line number where the cursor is located#

When there is repetitive content that needs to be used, you only need to fine-tune some places. This set of shortcut keys can make it easy for you to operate.

Shift + Option + ↑
Shift + Option + ↓

Select the current position to the beginning and end of the string#

Select before and after content to view, modify, copy.

Shift + Option + ←
Shift + Option + →

Select the line number where the cursor is located#

Command + L

Delete the line number where the cursor is located#

Quickly delete the number of lines, no matter where the cursor is, you can delete the entire line, sometimes it is easier to use than Command + BackSpace.

Command + K

Same mouse position on multiple lines#

Quickly make changes in the same location.

Option + Command + ↑
Option + Command + ↓

Specify multiple mouse positions#

Modify multiple locations at the same time, add some content or delete it, this is a fast way.

Option + Click

Execute, debug (Debug)#

Fn + F5

to

Control + R

Restart#

Command + R

Hor reload#

Option + R

Rename (class, variable, method…)#

A very convenient set of shortcut keys to quickly change the name.

Fn + F6

Skip to errors or warnings#

There is no need to look for files or code marked in red, just jump to it quickly

Fn + F8

About Me#

Final#

I hope it helps you, and welcome to follow me to browse the latest articles!

本文原刊登於 Medium。