DEV Community

Meltay Berk Işıltı
Meltay Berk Işıltı

Posted on • Edited on

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.

Top comments (0)