Setting Visual Studio Code as default text editor on macOS

Mar 23, 2021

Visual Studio Code is quite capable has become my editor of choice on macOS. Here is how to set it as the default text editor instead of Text Edit.

Install duti.

brew install duti

Set Visual Studio Code as the default editor for all text files and public files by running the below commands using duti.

# Mark vscode as default editor for all text files
duti -s public.plain-text all

# Some files without extensions are considered and not public.text. Set those to open in vscode as well
duti -s all

The changes should take effect right away and no reboot or relaunch of Finder should be needed.

How TosmacOSVisual Studio Codevscode

Setting up Keras Tensorflow2 on M1 Mac

macOS and Active Directory Passwords