打开document this的快捷键 | ctrl+alt+D(按两次) |
打开koroFileHeader的快捷键: | 方法头的注释: Window:ctrl+alt+I mac:ctrl+cmd+I 方法体内的注释: Window:ctrl+alt+T mac:ctrl+cmd+T |
快速定位到某一行 | ctrl+G |
快速打开最近打开的文件 | ctrl+P |
修改当前语言环境 | F1,输入configure Display Language |
删除一整行 | ctrl+shift+K |
格式化文件 | shift+Alt+F |
同一变量统一rename | F2 |
在当前行插入新的一行 | ctrl+Enter |
在当前行上面插入新的一行 | ctrl+shift+Enter |
光标调到行头 | Home |
光标调到行头 | End |
光标调到页头 | ctrl+Home |
光标调到页尾 | ctrl+End |
快速替换 | ALT+shift |
调出用于执行命令的输入框 | ctrl+shift+p |
VSCode配置React代码片段
(1)文件->首选项->配置代码片段->搜索tsx
(2)
{
// Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"rc": {
"prefix": "rc", // 快捷键
"body": [
"import type { FC } from 'react';",
"import React from 'react';",
"",
"export type Props = {};",
"",
"const $1: FC<Props> = ({}) => {",
"\treturn <></>;",
"};",
"",
"export default $1;",
],
"description": "Log output to console"
}
}
(3)配置完后,创建空的.tsx文件,输入rc(配置文件里写的啥就是啥)+Tab