Get the App
SLTechnology News&Howtos  ›  Servers  › 

Summary of Visual Studio Code Quick deletion of blank lines and several common shortcut keys

Shulou Source: shulou.com Published: 2022-06-03 00:44:46 09月22日 Update

When using the notepad++ tool, in many cases we will encounter the operation of replacing blank lines in batches. The previous operation method is to use the shortcut key Crtl+h to call up the window to select the replacement bar, enter\ r\ n\ r\ n in the search target bar, and replace it with\ r\ n in the column and select all to delete blank lines in batches. With the popularity of Visual Studio Code, before notepad++ a lot of content want to be implemented in vs code, of which the most commonly used removal of blank lines is also necessary to learn.

In VS Code, we can use the Ctrl+h shortcut to call up the replacement interface, enter the regular expression ^\ s * (? =\ rpm $)\ n corresponding to the blank line in the replacement lookup interface, and Alt+R select the corresponding regular expression search mode. You can complete the requirement by replacing all of them in batches, as shown below:

1. Quickly open the replacement interface and enter ^\ s * (? =\ rpm $)\ n in the Find interface.

2.Alt+R selects Use Regular _ Expression (Alt+R), which is the regular expression pattern:

3. Select Replace All (Ctrl+Alt+Enter) to replace in batch to complete the operation. The screenshot is as follows:

Commonly used keyboard shortcuts add:

Shortcut key summary: it can be opened quickly through Ctrl+K Ctrl+S or through File → Preferences → Keyboard Shortcuts:

Fast line wrapping of current line: Ctrl+Enter

Quickly delete a line: Shift+Delete or Ctrl+Shift+K

Find: Ctrl+F

Find in file: Ctrl+Shift+F

Replace: Ctrl+H

Replace in file: Ctrl+Shift+H

Add other shortcuts later.

Welcome to the official account of Wechat: Xiao Wen study Society.

Tags: Selection keyboard shortcuts blank lines interface input regular expression commonly used file pattern necessary line public content can be passed tools situations screenshots ways methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Apple MariaDB MySQL macOS