21 greatly improve development efficiency VS Code shortcuts

Abstract: Efficient use VS Code!

Fundebug authorized reprint, belongs to original author.

Note : try it yourself time, Mac (17, pro) with the original language of the keyboard shortcuts are not the same, mac Ctrl corresponding command to be replaced

As front-end developer, most have used a few VSCode, and many are often used. But some shortcuts may VSCode We do not know, is relatively less, after all, that's fine, so this article will list some shortcuts to facilitate learning and memory.

In this article, I will list my favorite shortcuts, these shortcuts let me write code faster, but also make coding more fun, here are 21 VSCode shortcuts, you share.

1. a search of all text files

Windows: Ctrl + Shift + F
Mac: Command + Shift + F

VSCode one of my favorite features is the ability of all files in the project directory in the search for any text matching.

To use this feature, you can press Ctrl + Shift + fto open the view, it will display the sidebar on the left side of the Editor:

Finding the input content and the transport, VS code will provide an input matching content list of results, as follows:

You can also simultaneously regulate all match the contents of each file in the search results. If you click on the little arrow on the left, it will pop up a second input box below, where you can enter text to be replaced, and click the small box appears on the right:

2. tabs to set an accent color (Material Theme) is

Are you tired of seeing the same color tabs at the bottom every day? You can use Material Theme to expand the theme VsCode so that tabs can set a different color.

red:

purple

yellow

有16种不同的颜色可供选择。

因此,如果胸有安装此扩展,打开的命令面板(Ctrl + Shift + P),选择 Material Theme: Set accent color并从列表中选择一个颜色,它将更改选项卡的下划线颜色,如下所示

3.进程资源管理器

你是否发现你的VsCode 编辑器有时有点慢?这时候你希望哪个进程在吃我们的内存?

好吧,如果你还不知道,VsCode 有一个进程资源管理器功能,如下所示:

是不是看起来很熟悉?

windows任务管理器中看到过这一点,在VsCode 中按Ctrl + Alt + Delete可以打开该任务管理器。

4.Expand Bracket Selection

打开键盘快捷键(Ctrl + Shift + P 或 command + Shift + p),搜索 Expand Bracket Selection

这是我需要花费一些时间才能发现的,因为我无法猜出该功能的名称。使用此功能可以自动选择整个块,从开始的大括号到结束。

我发现这个功能在想要找到 if/else 对应的结束块很有用。

5. 重新打开 关闭的编辑页面

Windows: Ctrl + Shift + T
Mac: command + Shift + T

当你处理一个文件很多的大型项目时,如果不小心关闭了一个页面,并且不得不在侧菜单中再次搜索它,这可能会有点令人沮丧。

现在,可以按 Ctrl + Shift + T 重新打开一个关闭的页面。

6. 通过匹配文本打开文件

Windows: Ctrl + T
Mac: command + T

说到搜索文件,你可以动态地搜索和打开文件。这是我最喜欢的特性之一,因为不需要手动单击目录来重新打开一个不再打开的文件。

7. 集成终端

Windows: Ctrl + Mac: control +

通过 Ctrl + `可以打开或关闭终端

8. 查看正在运行插件

你可以通过打开命令面板(Ctrl + Shift + P)并输入Show running extensions来查看所有你安装的正在运行的插件。

9. 重新加载

我个人认为这是 VsCode 最酷的特性之一。它允许你在重新加载编辑器时将窗口放在前面,同时具有与关闭和重新打开窗口相同的效果。

Windows: Ctrl + Alt + R
Mac: Control + Option + R

10. 将选项卡交换到不同的组

在我开发的过程中,我习惯在错误的选项卡组中使用选项卡。 我也希望避免尽可能多地使用我的鼠标来解决问题,因为这会让我把手从键盘上抬起来,我很懒,手一起想放键盘上。

幸运的是,VsCode 有一种方法可以通过按Ctrl + Alt +右箭头(Mac:Control + Option +右箭头)将标签移动到右侧的组,或者按Ctrl + Alt + 左箭头将标签转移到单独的标签组 (Mac:Control + Option +左箭头))将标签移动到左侧的组:

代码部署后可能存在的BUG没法实时知道,事后为了解决这些BUG,花了大量的时间进行log 调试,这边顺便给大家推荐一个好用的BUG监控工具 Fundebug

11.选择左侧/右侧的所有内容

有时你想要删除光标右侧或左侧的所有内容。 你可以选择光标右侧或左侧的所有内容。例如,要选择右侧或左侧的所有内容:

Windows: Ctrl + Shift + Home/End
Mac: command + Shift + Home/End

苹果笔记本没home键,可以用组合键实现

  • fn键+左方向键是HOME
  • fn键+右方向键是END
  • fn+上方向键是page up
  • fn+下方向键是page down

12.删除上一个单词

要删除前一个单词,可以按Ctrl + Backspace (Mac: option + delete)。这在你打错字的时候非常有用。

你可以在 VsCode 之外的任何地方使用它。

13. 启动性能

有时候,缺乏关于性能问题的详细信息是一件非常痛苦的事情,同时还要找出哪些有性能问题。

有时候,如果你足够幸运,你会找到一个工具,它能给你所有的答案。在VsCode 中,启动性能是很重要的。这就是为什么你能弹出一个有用的窗口,奇迹般地提供所有你需要的信息:

打开命令面板(Ctrl + Shift + P),搜索Startup Performance

14.逐个选择文本

可以通过快捷键Ctrl + Shift +右箭头(Mac: option + Shift +右箭头)和Ctrl + Shift +左箭头(Mac: option + Shift +左箭头)逐个选择文本。

15. 重复的行

一个非常强大和已知的功能是复制行。只需按 Shift + Alt + 向下箭头 (Mac: command + Shift + 向下箭头)

16.移至文件的开头/结尾

要使光标移到文件的第一行或最后一行,最快的方法是按Ctrl + Home (Mac: command + Home)键开头,然后按Ctrl + End (Mac: command + End)键结尾。

17. 批量替换当前文件中所有匹配的文本

可以选择任何一组文本,如果该选中文本出现多个,可以通过按Ctrl + F2 (Mac: command + F2)一次改所有出现的文本。

18. 向上/向下移动一行

Alt + 向上箭头(Mac: command+ 向上箭头)当前行向上移动,按Alt + 向下箭头(Mac: command+ 向下箭头))当前行向下移动。

19. 删除一行

有两种方法可以立即删除一行。

使用Ctrl + X剪切命令(Mac:command + X)来删除一行。

或者使用 Ctrl + Shift + K (Mac: command + Shift + K)命令。

20.将编辑器向左或向右移动

如果你像我一样,你可能会有一种无法控制的欲望,想要在一个组中重新排列选项卡,其中选项卡相互关联,左边的选项卡是比较重要文件,而右边的选项卡是相对不重要的文件。
通过 Ctrl+Shift+PgUp/PgDown(command + +Shift+PgUp/PgDown)向左/向右移动编辑器。

21. 复制光标向上或者向上批量添加内容

在 VsCode 中复制游标可以证明是最节省时间的特性。

Ctrl + Alt +向上箭头(Mac: Control + Option +向上箭头)将光标添加到上面,按Ctrl + Alt +向下箭头(Mac: Control + Option + 向下箭头)将光标添加到下面。

代码部署后可能存在的BUG没法实时知道,事后为了解决这些BUG,花了大量的时间进行log 调试,这边顺便给大家推荐一个好用的BUG监控工具 Fundebug

Guess you like

Origin www.cnblogs.com/fundebug/p/21-vscode-shortcut.html