The vsCode code block cannot be folded and collapsed & the code block folds/expands the shortcut key

1. The code block cannot be folded and folded

When using vsCode, I found that I couldn't fold a whole code block object like before, which seriously affected the speed of reading code. Solution:
1. Open the settings panel
insert image description here
2. Search for Folding, place the mouse on editor.foldingStrategy, a small edit icon will appear on the left, click the edit small icon to select indentattion, and the code will be automatically generated on the right to change the folding range of the code block ;
insert image description here
3. Now vsCode can realize the code block folding function (maybe some need to restart vsCode)
insert image description here

2. Shortcut keys for code block folding/expanding

To operate all code blocks in the file where the cursor is located:
Collapse all Ctrl+K+0
Expand all Ctrl+K+J
Operate only the code within the code block where the cursor is located:
Collapse Ctrl+Shift+[
Expand Ctrl+Shift+]

Guess you like

Origin blog.csdn.net/Maybe_ss/article/details/122577167