译文 你不知道的VS Code冷门快捷技巧( 二 )


So withwefor aandtothe.
因此,使用命令调板,我们只需搜索命令并选择即可执行相关操作 。
To open the, use this:
要打开 “命令调板”,请使用以下快捷键:
/Linux: Ctrl + Shift + P
Mac: Shift + + P
As you, thoseto the right are away to run thewith the .
正如你所猜测的那样,右侧的键盘快捷键是使用键盘运行命令的更快方法 。
The keyof theoveris when there’s aa , or you’refor ayou’re not sure .
与快捷键相比,命令调板的主要优势在于当某个命令没有快捷键,或者你正在寻找一个你不确定是否存在的命令时 。
4. Go to file4. 快速进入文件
The mouse is too slow.
鼠标太慢了 。
Yes, you can click on the file in thepane, but for a muchuse Ctrl + P tofor and open afile in your .
是的,你可以点击资源管理器窗格中的文件,但要想更快,可使用 Ctrl + P 搜索并打开项目中的特定文件 。
Hold Ctrl and press Tab to cyclethe list of filesopen in an.
按住 Ctrl 键并按 Tab 键,可循环查看编辑器实例中当前打开的文件列表 。

译文  你不知道的VS Code冷门快捷技巧

文章插图
You can even use Alt + Left and Alt + Right tothese open files.
你甚至可以使用 Alt + Left 和 Alt + Right 在这些打开的文件之间快速导航 。
All these are muchways to get to a file than using the .
所有这些方法都比使用光标更快地找到文件 。
5. Go to line5. 快速跳转指定行
Jump, don’t .
跳转,不要滚动 。
to a line iswhen you need toatline . Byto those lines, you canthe code in that,, andthe issue.
在调试过程中,当你需要在特定行号处遇到错误时,快速导航到某一行是非常有价值的 。通过跳转到这些行,你可以在特定上下文中检查代码、评估变量并排除故障 。
Use the Ctrl + Gfor this.
为此,请使用 Ctrl + G 快捷键 。
6.line6. 快速删除行
You’ve got to the line now, what if you want toit?
你现在已经到了这一行,如果要删除它怎么办?
Will you drag and drag toand then press ? Will youpressuntil everyis gone?
你会拖啊拖突出显示然后按键吗?你会不知疲倦地按直到删除所有字符吗?
Or, will you use the Ctrl + Shift + Ktothat andmore lines in aof ?
或者,你会使用 Ctrl + Shift + K 快捷键,在几秒钟内快速删除这一行和其他几十行吗?
7. Enjoywith7. 使用流畅的光标享受打字乐趣
VS Code has thisthattheas it moves, like in MS Word. This makesfeel more fluid and , as well asus aand morefeel as wethe lines of code and place theat.
VS Code 具有平滑光标功能,可以像 MS Word 一样在光标移动时显示动画 。这让输入感觉更流畅、更精练,也让我们在浏览代码行并将光标置于不同点时感觉更流畅、更自然 。
To turn it on, openUI in theandfor “smoot caret”.
要打开它,请打开 "命令面板 "中的 “设置 UI”,然后搜索 “smoot caret” 。
We arefor the :Caret, which has 3:
我们要找的是编辑器: 光标平滑焦距动画设置,该设置有 3 个选项:
1、off: No
1、关闭: 无平滑光标动画
2、: Onlythewhen weplace itin the code.
2、(明确 只有当我们在代码中明确放置光标时,光标才会产生动画 。
3、on:is-when .
3、on: 始终启用平滑光标动画 - 包括键入时 。
Set it to on to get the full.
将其设置为开启,即可获得完整的视觉体验 。
8.code8. 快速格式化代码
is all aboutcodebyit in aand.
格式化就是以结构化和一致的方式组织代码,从而提高代码的可读性 。
And if you’ve been doing this , you need to know that there’s away.