Add following line in your .zshrc file and save.
editfile() {
sudo code $1 --user-data-dir
}
And try this command on zsh bash.
editfile /etc/hosts
This command must open hosts file with vscode.
You can edit the "editfile" statement according to your own.
Thanks for reading.
Top comments (0)