VSCode学习笔记梳理

VSCODE 基本用法梳理

一。基本操作

  1. 新建文件 (Ctrl+N)
  2. 保存文件 (Ctrl+S)
  3. 命令行快捷键 (Ctrl+Shift+P)
  4. 查看扩展插件快捷键 (Ctrl+Shift+X)
  5. 打开所有快捷键 并编辑 (Ctrl+K Ctrl+S)
  6. 主题选择 (Ctrl+K Ctrl+T)
  7. 打开设置 (Ctrl+,)
  8. 编辑器操场(帮助了解怎么交互) 帮助-编辑器操场
  9. 快捷键PDF文件展示 (Ctrl+K Ctrl+R)


二、代码编辑

  1. 文件浏览器(Ctrl+Shift+E)
  2. 打开文件夹 (Ctrl+K Ctrl+O)
  3. 创建新文件 (Ctrl+N)
  4. 格式化代码文件 (Shift+Alt+F)
  5. 自动保存代码
  6. 打开交互终端 (Ctrl+`) 两个终端区别显示 Ctrl+Shift+5 增加一个终端显示Ctrl+Shift+`
  7. 显示关闭主侧栏 (Ctrl+B)
  8. 显示关闭面板 (Ctrl+J)


三、命令行工具

  1. 快速打开最近打开的文件 Ctrl+P 上下选择
  2. 快递定位到某个文件的行 filename:line number
  3. 快速定位到某一个标记位 filename@symbol name
  4. 可以输入 ? 选择任意一个可选命令
  5. 保持下拉菜单可用的情况下,使用 右箭 可以打开选择的文件
  6. 多光标操作(同时操作多个光标)
  7. Ctrl+Alt+Up Ctrl+Alt+Down 选择上下文的
  8. Alt+Click 选择单个的
  9. Ctrl+Shift+L 选择同类型的
  10. 使用 Ctrl+Space 触发 智能标识


四、编译Debugging

文档参考

https://code.visualstudio.com/docs/editor/debugging

  1. 内置插件只支持 node.js,其他语言需要下载debug插件
  2. 进入debug模式 Ctrl+Shift+D
  3. 建立一个launch.json文件协助debug
  4. 选择Debug的语言环境 (java;C#,Chrome)
  5. 在launch.json文件中配置不同类型 request:launch / request:attach
  6. Debug快捷键:

Continue / Pause     F5
Step Over      F10
Step Into        F11
Step Out        Shift+F11
Restart        Ctrl+Shift+F5
Stop         Shift+F5

 

7.断点:

  1. breakpoints 断点
  2. Logpoints 日志点 (不停,可以记录日志到控制台)

Launch.json attributes#

There are many launch.json attributes to help support different debuggers and debugging scenarios. As mentioned above, you can use IntelliSense (Ctrl+Space) to see the list of available attributes once you have specified a value for the type attribute.

launch json suggestions

The following attributes are mandatory for every launch configuration:

  • type - the type of debugger to use for this launch configuration. Every installed debug extension introduces a type: node for the built-in Node debugger, for example, or php and go for the PHP and Go extensions.
  • request - the request type of this launch configuration. Currently, launch and attach are supported.
  • name - the reader-friendly name to appear in the Debug launch configuration dropdown.

Here are some optional attributes available to all launch configurations:

  • presentation - using the ordergroup, and hidden attributes in the presentation object, you can sort, group, and hide configurations and compounds in the Debug configuration dropdown and in the Debug quick pick.
  • preLaunchTask - to launch a task before the start of a debug session, set this attribute to the label of a task specified in tasks.json (in the workspace's .vscode folder). Or, this can be set to ${defaultBuildTask} to use your default build task.
  • postDebugTask - to launch a task at the very end of a debug session, set this attribute to the name of a task specified in tasks.json (in the workspace's .vscode folder).
  • internalConsoleOptions - this attribute controls the visibility of the Debug Console panel during a debugging session.
  • debugServer - for debug extension authors only: this attribute allows you to connect to a specified port instead of launching the debug adapter.
  • serverReadyAction - if you want to open a URL in a web browser whenever the program under debugging outputs a specific message to the debug console or integrated terminal. For details see section Automatically open a URI when debugging a server program below.

Many debuggers support some of the following attributes:

  • program - executable or file to run when launching the debugger
  • args - arguments passed to the program to debug
  • env - environment variables (the value null can be used to "undefine" a variable)
  • envFile - path to dotenv file with environment variables
  • cwd - current working directory for finding dependencies and other files
  • port - port when attaching to a running process
  • stopOnEntry - break immediately when the program launches
  • console - what kind of console to use, for example, internalConsoleintegratedTerminal, or externalTerminal

五、版本控制

Visual Studio Code 集成了源代码控制管理 (SCM) 并包括开箱即用的 Git 支持。也可以安装其他插件支持不同的源代码控制工具。

  1. 创建一个分支
  2. 更改分支
  3. 在并排和内联视图中查看两个文件之间的差异
  4. stage和clean的变化
  5. 提交到您当地的分支机构
  6. 合并本地分支

 

posted @ 2022-04-15 15:14  jajalove1234  阅读(307)  评论(0编辑  收藏  举报