On MacOS, a long standing wish from many developers has been to open a folder with Visual Studio Code: [WayBack] Mac OS X :: “Open Folder With” VS Code · Issue #1223 · Microsoft/vscode · GitHub.
There are many reasons for wanting this, and other tools can do this too (like Terminal, TextWrangler, Source Tree, Beyond Compare), so I was a bit surprised Visual Studio Code does not have it by default.
After initially being closed, the issue has been open for a while, so I started digging a bit for solutions that are easy to configure or install.
- Based on Automator:
- [WayBack] Add a command to Finder services in Mac OSX to open a folder in VS Code · GitHub
- [WayBack] Create Customize Shortcut in Mac’s Right Click Menu [Guide] – Hongkiat
- [WayBack] Open folder in Visual Studio Code from the Finder
- [WayBack] macos – OSX: how to add a right click option in folder to open the folder with an application like VS Code? – Ask Different
- Based on AppleScript: [WayBack] GitHub – hamxiaoz/open-folder-with-vs-code: A Finder toolbar icon to open current selected file/folder with Visual Studio Code
- Objective C (based on the .m file extension) [WayBack] GitHub – sozercan/OpenInCode: macOS Finder toolbar app to open current folder in Visual Studio Code
The last one is currently on the top of my list, so I copied and installation instructions, and added a few screenshots to explain the already included video below.
- Download app or using
brew cask install open-in-code
(if using VS Code Insiders, download this instead)- Move
Open in Code.app
to/Applications
(brew already has done that)- Go to
/Applications
- Right-click
Open in Code.app
and clickOpen
. When the security dialog prompt appears, clickOpen
.
![]()
- While holding
Command
key, dragOpen in Code.app
toFinder
toolbar
- Once Visual Studio Code new window is opened, close it.
Each time you want to open a folder in Visual Studio:
- Navigate to a folder you want to open with Visual Studio Code
- Click on the toolbar icon
- Folder will open with Visual Studio Code
–jeroen