An Oh My Zsh plugin to open files in Visual Studio Code.
- Clone this repository somewhere on your machine. This guide will assume
~/.zsh/vscode
.
git clone https://github.com/valentinocossar/vscode.git ~/.zsh/vscode
- Add the following to your
.zshrc
:
source ~/.zsh/vscode/vscode.plugin.zsh
- Start a new terminal session.
- Clone this repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
)
git clone https://github.com/valentinocossar/vscode.git $ZSH_CUSTOM/plugins/vscode
- Add the plugin to the list of plugins for Oh My Zsh to load:
plugins=(vscode)
- Start a new terminal session.
-
If
vs
command is called without an argument, launch Visual Studio Code. -
If
vs
is passed a directory,cd
to it and open it in Visual Studio Code. -
If
vsa
is passed a directory,cd
to it and open it in the last active Visual Studio Code window. -
If
vs
is passed a file, open it in Visual Studio Code. -
If
vsa
is passed a file, open it in the last active Visual Studio Code window. -
If
vst
command is called, it is equivalent tovs .
, opening the current folder in Visual Studio Code. -
If
vsta
command is called, it is equivalent tovs -a .
, opening the current folder in the last active Visual Studio Code window. -
If
svs
command is called, it is likesudo vs
, opening the file or folder in Visual Studio Code. Useful for editing system protected files. -
If
svsa
command is called, it is likesudo vs -a
, opening the file or folder in the last active Visual Studio Code window. Useful for editing system protected files.