Using vscode as editor in zsh terminal

meltay

Meltay Berk Işıltı

Posted on January 17, 2021

Using vscode as editor in zsh terminal

Add following line in your .zshrc file and save.

editfile() {
    sudo code $1 --user-data-dir
}
Enter fullscreen mode Exit fullscreen mode

And try this command on zsh bash.

editfile /etc/hosts
Enter fullscreen mode Exit fullscreen mode

This command must open hosts file with vscode.

You can edit the "editfile" statement according to your own.

Thanks for reading.

💖 💪 🙅 🚩
meltay
Meltay Berk Işıltı

Posted on January 17, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related