当前位置:网站首页>设置单击右键可以选择用VS Code打开文件
设置单击右键可以选择用VS Code打开文件
2022-07-02 22:09:00 【竹石七】
一、前言
在新电脑安装VS Code之后,发现对一个文件(夹)单击鼠标右键的菜单栏中,没有用VS Code打开的快捷方式。每次都要用拖拽文件(夹),或者用VS Code界面的菜单栏选择打开文件(夹),这样很麻烦。那么,现在和我一起,以一种十分简单的方式解决这个问题吧。
二、问题分析和解决
2.1、问题分析
产生这个问题的原因,其实就是你没有勾选安装后单击右键用VS Code打开的配置项。
再来一张图,让你更直观的看到为什么会产生这个问题:
这是VS Code安装时的一些安装选项,大家可以看到图中用红框圈出来的部分:
EN: Add “Open with Code” action to Windows Explorer file context menu
中文: 在Windows资源管理器文件上下文菜单中添加“用代码打开”操作
EN: Add “Open with Code” action to Windows Explorer directory context menu
中文: 在Windows资源管理器目录上下文菜单中添加“用代码打开”操作
看到我提出来的这两行配置选项,聪明的你应该明白了,为什么自己单击右键,没有用VS Code打开的菜单选项。
2.2、问题解决(请忽略我的英文版本的系统)
2.2.1、方法一(推荐,亲测可行)
1、查看VS Code在你电脑的具体路径
因为我的VS Code在桌面有快捷方式,所以我直接选中此快捷方式单击右键后选择“属性”
2、复制安装路径
3、在桌面新建一个文本文档(名字随便起)
4、复制下述代码到这个文档中
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\VSCode]
@="Open with Code"
"Icon"="E:\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\*\shell\VSCode\command]
@="\"E:\\Microsoft VS Code\\Code.exe\" \"%1\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\VSCode]
@="Open with Code"
"Icon"="E:\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
@="\"E:\\Microsoft VS Code\\Code.exe\" \"%V\""
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode]
@="Open with Code"
"Icon"="E:\\Microsoft VS Code\\Code.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\VSCode\command]
@="\"E:\\Microsoft VS Code\\Code.exe\" \"%V\""
5、将“2、复制安装路径”中的路径替换上述代码中遮个地方
请注意我红框全出的范围,不要多修改我没圈到的地方,注意将你复制的路径中的“ \ ”改成“ \ ”
6、将.后面的“txt”文件扩展名改成“reg”
选择弹出的提示框中的“是”
7、双击修改扩展名后的文件,将其运行
运行后一直点弹出框的“确定(是或者Yes)”按钮
8、设置成功!效果图展示
如果正常的化,上述7步执行完后,到这里已经设置成功了,看下现在对一个文件(夹)单击右键后的效果:
2.2.2、方法二
修改注册表,这个方法对于想通过其他软件进行打开也是适用,适用性更广,这里我就不细述了,附上一个博客的参考链接:windows文件夹右击打开方式添加VS Code(其他软件同理)
三、说明
参考链接:
超简单设置右键 VS Code 打开文件
windows文件夹右击打开方式添加VS Code(其他软件同理)
欢迎大家一起讨论、学习
边栏推荐
- 悬镜安全在RSAC2022上斩获Global InfoSec Awards四项大奖
- QT qsplitter splitter
- 杰理之样机无触摸,拆机之后重新安装变正常【篇】
- P1007 single log bridge
- 【喜欢的诗词】好了歌
- [LeetCode] 数组中的第K个最大元素【215】
- Xiaopeng P7 had an accident and the airbag did not pop up. Is this normal?
- 成功改变splunk 默认URL root path
- World Environment Day | Chow Tai Fook serves wholeheartedly to promote carbon reduction and environmental protection
- 情感对话识别与生成简述
猜你喜欢
从2022年Q1财报看携程的韧性和远景
LeetCode 968. Monitor binary tree
Dahua cloud native load balancing article - the passenger flow of small restaurants has increased
Learning records of data analysis (II) -- simple use of response surface method and design expert
WebRTC音视频采集和播放示例及MediaStream媒体流解析
Splunk audit 的设定
Xiaopeng P7 had an accident and the airbag did not pop up. Is this normal?
Mask R-CNN
小鹏P7出事故,安全气囊未弹出,这正常吗?
Performance optimization - rigorous mode
随机推荐
Jerry's prototype has no touch, and the reinstallation becomes normal after dismantling [chapter]
Hanging mirror security won four global infosec awards on rsac2022
Golang面试整理 三 简历如何书写
分布式监控系统zabbix
Chow-Liu Tree
Go condition variable
go 4种单例模式
[NPUCTF2020]ezlogin xPATH注入
Share 10 JS closure interview questions (diagrams), come in and see how many you can answer correctly
[LeetCode] 多数元素【169】
Gas station [problem analysis - > problem conversion - > greed]
Rails 3 activerecord: sort by association count - rails 3 activerecord: order by count on Association
Niuke: Dragon and dungeon games
[LeetCode] 反转字符串【344】
Wait to solve the zombie process
首批 | 腾讯云完成国内首个云原生安全成熟度评估
boot actuator - prometheus使用
Performance optimization - rigorous mode
Jerry's built-in short press and long press, no matter how long it is, it is a short press [chapter]
Boot actuator - Prometheus use