右键菜单添加“VScode”方法
最近,重新装了webstorm,发现在文件上鼠标右键上多了个“Open Folder as WebStorm Project”的选项,感觉挺方便的,发现我经常用的VScod选项竟然没有在右键中找到,估计是安装的时候,太年轻了,没有注意勾选添加到鼠标右键的对应选项,为了方便,我还是决定把Vscod也添加一下,网上查了下,资料,发现方法不少,有重装的,有修改注册文件的等等,最后发现下面这个方法是比较快捷的,分享给需要的小伙伴们!!
步骤如下:
1.首先建立个名为“vsCodeOpenFolder”的txt文件:
ps建议用VScod建立或者打开txt文件,方便下一步用里面的(crl+f)替换功能哦!当然你喜欢记事本打开,一个 个替换也是可以的哦!
2.将以下代码复制到你建的txt文件内:(代码中; 是注释)
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT*shellOpen with VS Code]
@="Edit with VS Code"
"Icon"="D:\Microsoft VS Code\Code.exe,0"
[HKEY_CLASSES_ROOT*shellOpen with VS Codecommand]
@=""D:\Microsoft VS Code\Code.exe" "%1""
; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOTDirectoryshellvscode]
@="Open Folder as VS Code Project"
"Icon"=""D:\Microsoft VS Code\Code.exe",0"
[HKEY_CLASSES_ROOTDirectoryshellvscodecommand]
@=""D:\Microsoft VS Code\Code.exe" "%1""
; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear
[HKEY_CLASSES_ROOTDirectoryBackgroundshellvscode]
@="Open Folder as VS Code Project"
"Icon"=""D:\Microsoft VS Code\Code.exe",0"
[HKEY_CLASSES_ROOTDirectoryBackgroundshellvscodecommand]
@=""D:\Microsoft VS Code\Code.exe" "%V""
注意:将代码中红色部分(我Vscod的安装路径)改成你的安装路径,可以用vscod里的(crl+f)替换功能,比较快捷,改好保存的时候记得把后缀名改成.reg,此时文件名变为:vsCodeOpenFolder.reg:
3.点击运行文件,过程会弹出提示框,直接确定就好!
如果添加成功,在桌面上右键鼠标会显示如图:
右键出现上图“Open Folder as VS Cod Project”你就成功了!!!!