Skip to content

Instantly share code, notes, and snippets.

@anandbibek
Forked from idleberg/vscode-macos-context-menu.md
Last active October 21, 2023 08:16
Show Gist options
  • Save anandbibek/8acdbd2919b6182372c5e68a546955fc to your computer and use it in GitHub Desktop.
Save anandbibek/8acdbd2919b6182372c5e68a546955fc to your computer and use it in GitHub Desktop.
“Open in Visual Studio Code” in macOS context-menu via "Shortcuts" app

Open in Visual Studio Code via "Shortcuts" app

  • Make sure code executable is added to path. If not cmd+shift+p in code and run install 'CODE' command in PATH

  • Open Shortcuts

  • Create a new Quick Action

  • Set “Receive” to files or folders

  • Add a Run Shell Script action

    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
    • if you're using something else, you probably know what to do 😉
  • Set the script action to the following

    code "$@"
    
  • Set “Pass input” to as arguments

  • Save by closing the window

@anandbibek
Copy link
Author

Screenshot 2023-10-21 at 1 27 48 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment