This gist adds a command to Sublime Merge that opens the current repository in Visual Studio Code, accessible from:
- The Command Palette
- The top menu bar (Repository menu)
- The toolbar “…” (Action) menu
Because Sublime Merge custom commands are limited to invoking git, this solution uses a Git alias that shells out to the VS Code CLI.
Adds a Git alias:
[alias]
vscode = "!code ."
This allows git vscode to open the current repository in VS Code.
Adds a Command Palette entry: Open Repository in VS Code
Adds the same action to the top menu bar (Repository menu).
Adds the action to the toolbar “…” menu.
- Ensure VS Code CLI is installed
In VS Code: Command Palette → Shell Command: Install 'code' command in PATH
- Install the Git alias
Merge the provided .gitconfig snippet into your ~/.gitconfig.
- Install Sublime Merge files
In Sublime Merge:
- Windows: Preferences → Browse Packages…
- Mac:
Sublime Mergemain menu → Settings… → Browse Packages…
Copy the .sublime-commands and .sublime-menu files into: Packages/User/
- Restart Sublime Merge