Skip to content

Instantly share code, notes, and snippets.

@jackhickey
Last active August 7, 2023 16:45
Show Gist options
  • Save jackhickey/aea3faac46089073f3278efede0ea775 to your computer and use it in GitHub Desktop.
Save jackhickey/aea3faac46089073f3278efede0ea775 to your computer and use it in GitHub Desktop.
Enabled vscode as your git editor on mac
# Inside of vscode open the command pallete and run '>shell command install code in path' or something along those lines...
git config --global core.editor "code --wait"
git config --global -e
(add the lines below inside in the git config...)
[diff]
tool = default-difftool
[difftool "default-difftool"]
cmd = code --wait --diff $LOCAL $REMOTE
@Munchery-FilipeAbreu
Copy link

Just saw this but

git config --global core.editor "code --wait"

git config --global -e

@jackhickey
Copy link
Author

You are correct, thanks for spotting it

@OoDeLally
Copy link

Any way to give back the focus to the terminal after the buffer is closed?

@mwittmann
Copy link

In VSCode, to make VSCode available from the Mac command line, press Cmd+Shift+P to open the command palette, and type the following:
Shell Command: Install 'Code' command in PATH"
You should get a confirmation message that the command succeeded. Thereafter, from a terminal prompt, which code should return /usr/local/bin/code.

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