How to permanently open the Visual Studio Code with code . command in terminal
1 min readSep 26, 2020
- At first, open your terminal and go to your root user directory. Something like /Users/krishnabagale
- Type
open -t .bash_profile
- Then add the following path to .bash_profile
code () { VSCODE_CWD=”$PWD” open -n -b “com.microsoft.VSCode” — args $*
- Save the bash profile and quit the terminal. Now you can open any file/folder to VsCode with code .