1. 程式人生 > 實用技巧 >滑鼠右鍵vsCode開啟

滑鼠右鍵vsCode開啟

一直苦惱vscode怎麼沒有右鍵開啟資料夾的功能,原來是因為當初安裝時沒有勾選這個配置項。
所幸可以通過手動增加註冊表來實現。

Windows Registry Editor Version 5.00 

; This will make it appear when you right click ON any file
; The "Icon" line can be removed if you don't want the icon to appear 
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code] 
@="Edit with VS Code" 
"Icon"="C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0" 

[
HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] @="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\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_ROOT\Directory\shell\vscode] @="Open with VSCode" "Icon"="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0" [HKEY_CLASSES_ROOT\Directory\shell\vscode\command] @="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\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_ROOT\Directory\Background\shell\vscode] @="Open with VSCode" "Icon"="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0" [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command] @="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\"" C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0" [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command] @="\"C:\\Users\\bobin.yang\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""