zsh-vscode is a plugin for Oh My Zsh that enhances the integration between Zsh and Visual Studio Code. It allows you to interact with Visual Studio Code directly from the command line, providing convenient shortcuts and autocompletion.
Our plugin leverages the powerful autocompletion capabilities of Zsh. When using the code command, you can enjoy autocompletion for file paths, directories, and available Visual Studio Code commands.
zsh-vscode includes support for Windows Subsystem for Linux (WSL). You can seamlessly use the code command within WSL, and Visual Studio Code located on your Windows system will be launched correctly.
-
If
code
command is called without an argument, launch Visual Studio Code. -
If
code
is passed a directory,cd
to it and open it in Visual Studio Code. -
If
code
is passed a file, open it in Visual Studio Code. -
If type in
code -
and press tab key, autocomplete and show help of vscode. -
If
sudo code
command is called, via root to open the file or folder in the last active Visual Studio Code window. Useful for editing system protected files.
- Clone this repository somewhere on your machine, such as
~/.zsh/vscode
.
git clone https://github.com/PoonKinWang/zsh-vscode.git ~/.zsh/zsh-vscode
- Add the following to your
.zshrc
:
source ~/.zsh/zsh-vscode/zsh-vscode.plugin.zsh
- Start a new terminal session for the changes to take effect.
- Clone this repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
)
git clone https://github.com/PoonKinWang/zsh-vscode.git $ZSH_CUSTOM/plugins/zsh-vscode
- Add
zsh-vscode
to the list of plugins in your .zshrc file:
plugins=(zsh-vscode)
- Start a new terminal session for the changes to take effect.
Feel free to reach out if you have any further questions or need additional assistance.