Setting Visual Studio Code as my Mac’s default editor (including editing Git commits)

Add export EDITOR="code -w" to your shell’s profile or rc file

(For example, your bash profile is accessible via open ~/.bash_profile)

This requires you to have the code binary already in your path.

If you don’t have that, or don’t know if you do, simply go into vscode, enter CMD + SHIFT + P, type code and click Shell Command: Install ‘code’ command in PATH.

Also, very helpful comment by pompalini below,

remember to “refresh” terminal by closing and opening it again or resourcing your bash profile by running source ~/.bash_profile. Only then will the new changes in .bash_profile apply to your terminal.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)