How to Open a Folder in VS Code, Cursor or Xcode on a Mac

You are looking at a project folder and want it in your code editor. Going through the editor's own open dialog means finding the same folder a second time, and a terminal wants a cd before anything else. Both detours have shortcuts, some with a little setup, some with none.
The short answer: drag the folder onto the editor's icon in the Dock. In a terminal that is already in the folder, code . opens it in VS Code once the code command is installed, and cursor ., zed . and xed . do the same for Cursor, Zed and Xcode. For an item of your own in the Finder's right-click menu, build a Quick Action with Automator. In Folia Files, right-click the folder, or an empty spot of the pane that shows it, and choose Open in Editor: it lists the code editors installed on your Mac, with nothing to set up.
From the Finder
Drop the folder on the editor
Drag the folder from a Finder window and drop it on VS Code's or Cursor's icon in the Dock: the editor opens the whole folder, its files listed in the sidebar. If the editor isn't kept in the Dock, open it first; its icon stays there while it runs. Nothing to install, on any Mac.
Open With, for one file
For a single file, right-click it and choose Open With, then the editor. To make that editor the default for every file of the same kind, such as every .md or .json file, select one, choose File › Get Info, pick the editor under Open with, then click Change All….
A Quick Action of your own
Automator, which comes with macOS, turns “open in my editor” into an item of the Finder's right-click menu:
- Open Automator, choose File › New, then Quick Action.
- At the top of the workflow, set what it receives to files or folders, in Finder.
- Find Open Finder Items in the list of actions, drag it into the workflow, and choose Visual Studio Code, Cursor or another editor in its Open with menu.
- Press ⌘S and give it the name the menu should show, for example “Open in VS Code”.
Now right-click a folder in the Finder: the action is under Quick Actions. It acts on the folder you select, not on the window you are in. To open the folder you are browsing, go up a level with ⌘↑ and right-click it there. To get rid of the action later, delete it from ~/Library/Services.
The Shortcuts app can build the same item: turn on Use as Quick Action in a shortcut's details and give it a Run Shell Script action with open -a "Visual Studio Code" "$@", its Pass Input set to as arguments. Shortcuts only runs scripts once Allow Running Scripts is on in its settings. This guide to automating file tasks with Shortcuts shows the other ways to run a shortcut.
From a terminal: code ., cursor ., xed .
When a shell is already in the project folder, one word opens it in the editor:
- VS Code: open the Command Palette with ⇧⌘P, type
shell commandand run the command that installscodein the PATH. In a new terminal window,code .opens the current folder andcode README.mda single file. - Cursor: its Command Palette has the same kind of command (type
install), which addscursor; thencursor .. - Zed: search its command palette for
cli: install, then typezed .. - Xcode:
xed .comes with Xcode. In a folder that holds an Xcode project or workspace, it opens it; in a Swift package's folder, it opens the package. - Any editor, nothing to install:
open -a "Visual Studio Code" .hands the current folder to the app of that name, and the same goes foropen -a Cursor .oropen -a Zed ..
That still takes a shell in the right folder: how to open Terminal in the current folder covers that half.
Open in Editor, in Folia Files
In Folia Files, right-click a folder in a pane and choose Open in Editor, then the editor. To open the folder a pane is showing, right-click an empty spot of the pane instead: no need to go up a level first.

The submenu only lists the code editors installed on your Mac, among Visual Studio Code (Insiders too), Cursor, Windsurf, Zed, VSCodium, Sublime Text, Nova, BBEdit, CotEditor, TextMate, Xcode, IntelliJ IDEA, WebStorm, PyCharm and Android Studio. With none of them installed, the item isn't in the menu at all, and an editor you install while Folia Files is open shows up within a minute. There is nothing to set up: no Finder extension, no service, no Quick Action.
It works on files too. Select a few files, or files and folders, and they open together in the editor you pick, whatever app usually opens them. For Xcode, pick what it opens: the .xcodeproj or .xcworkspace of a project, or the Package.swift of a Swift package.
Settings › Context Menu moves Open in Editor up or down, tucks it into the More submenu or hides it, in the menu on items and in the one on a folder's background alike.
A terminal under the pane, for code .
In the website edition of Folia Files (foliafiles.com), press ⌥⌘T, choose View › Terminal or click Terminal in the toolbar: a terminal opens under the active pane, in the folder it shows, or in the selected folder if you selected one. code ., cursor . and xed . work there straight away, without a cd. Tick Follow Pane in the terminal's header, and the shell follows the pane from folder to folder: code . always opens the folder in front of you.

Your own commands, with a shortcut
The website edition also runs commands of your own on the selection: you write them in Settings › Commands, and they appear in the Commands submenu of the right-click menu and in Tools › Commands. A ready-made command, Open in VS Code, runs open -a "Visual Studio Code" {files}, where {files} stands for the selected items, or the pane's folder when nothing is selected; if it isn't in your list, the + menu adds it. The first nine commands get ⌃⌥1 to ⌃⌥9, and in the list Folia Files starts with, Open in VS Code comes first: ⌃⌥1 sends the selection, or the folder, to VS Code.
For an editor the Open in Editor list doesn't know, choose + › New Command and write the same line with that editor's name, such as open -a GoLand {files}. For one that runs in a terminal, set Execution to In the Pane's Terminal and write nvim {files}. The built-in terminal page shows the rest of the terminal and the commands.
Which way to choose
- Now and then, from the Finder: drop the folder on the editor's icon in the Dock.
- Every day, from the Finder: a Quick Action per editor, one right-click away.
- From a shell that is already in the folder:
code .,cursor .,zed .orxed .. - In Folia Files: Open in Editor, on a folder, on files or on a pane's background, for every editor you have, and in the website edition a terminal that follows the pane, plus ⌃⌥1 from the keyboard.


