This plugin makes interaction between the command line and the code editor easier.
This plugin makes interaction between the command line and the VS Code editor easier.
To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`:
...
...
@@ -8,9 +8,20 @@ To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`
plugins=(... vscode)
```
If you are using [Visual Studio Code Insiders](https://code.visualstudio.com/insiders/),
add the following line in the oh-my-zsh settings section (between the `ZSH_THEME` and
the `plugins=()` line). This will make the plugin use the Insiders version instead.
## Requirements
To use VS Code in the terminal **in macOS**, first you need to install the `code` command in the PATH,
otherwise you might receive this message: `zsh: command not found: code`.
[As the docs say](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open
the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command:
> Install 'code' command in PATH
## VS Code Insiders
🍏 **If you are only using [VS Code Insiders](https://code.visualstudio.com/insiders/), the plugin will automatically bind to your Insiders installation.**
But, if you have both Stable and Insiders versions and want to configure the plugin to just use the Insiders version, add the following line in the oh-my-zsh settings section (between the `ZSH_THEME` and the `plugins=()` line). This will make the plugin use the Insiders version instead.
`wd` comes bundled with [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)!
`wd` comes bundled with [oh-my-zshell](https://github.com/ohmyzsh/ohmyzsh)!
Just add the plugin in your `~/.zshrc` file:
...
...
@@ -53,7 +53,7 @@ Run either in terminal:
#### Completion
If you're NOT using [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) and you want to utilize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`:
If you're NOT using [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) and you want to utilize the zsh-completion feature, you will also need to add the path to your `wd` installation (`~/bin/wd` if you used the automatic installer) to your `fpath`. E.g. in your `~/.zshrc`:
fpath=(~/path/to/wd $fpath)
...
...
@@ -85,7 +85,7 @@ Also, you may have to force a rebuild of `zcompdump` by running:
$ wd ...
This is a wrapper for the zsh `dirs` function.
(You might need `setopt AUTO_PUSHD` in your `.zshrc` if you hare not using [oh-my-zshell](https://github.com/robbyrussell/oh-my-zsh)).
(You might need `setopt AUTO_PUSHD` in your `.zshrc` if you hare not using [oh-my-zshell](https://github.com/ohmyzsh/ohmyzsh)).
scripts=($(yarn run --json 2>/dev/null | sed-E'/Commands available|possibleCommands/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g' | tr , '\n' | sed-e's/:/\\:/g'))
_describe 'script' scripts
local-a commands binaries scripts
local-a scriptNames scriptCommands
local i runJSON
runJSON=$(yarn run --json 2>/dev/null)
# Some sed utilities (e.g. Mac OS / BSD) don't interpret `\n` in a replacement
# pattern as a newline. See https://superuser.com/q/307165
binaries=($(sed-E'/Commands available/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\'$'\n/g'<<<"$runJSON"))