VSCode常用的快捷键

本文详细列举了多种编程软件中的快捷键和操作,包括快速打开文档、注释、定位行、打开最近文件、更改语言环境、删除行、格式化代码、变量重命名、插入行、移动光标以及快速替换等实用功能,旨在提升程序员的编码效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

打开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
同一变量统一renameF2
在当前行插入新的一行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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值