From 7ff77120c17b83ca1c5d4939d21c1a84a4b2ffbb Mon Sep 17 00:00:00 2001
From: "Babak K. Shandiz" <babak.k.shandiz@gmail.com>
Date: Wed, 29 Jan 2020 16:21:40 +0330
Subject: vscode: use insiders build if stable not found (#8568)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* ๐Ÿ”จ Add calling VS Code Insiders

* โœ๏ธ Update README.md
---
 plugins/vscode/README.md         | 12 +++++++-----
 plugins/vscode/vscode.plugin.zsh | 14 +++++++++++---
 2 files changed, 18 insertions(+), 8 deletions(-)

(limited to 'plugins/vscode')

diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md
index 74b5a45aa..2c6530650 100644
--- a/plugins/vscode/README.md
+++ b/plugins/vscode/README.md
@@ -1,6 +1,6 @@
-# VS code
+# VS Code
 
-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,11 @@ 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.
+## 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.
 
 ```zsh
 ZSH_THEME=...
diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh
index 4c15df2b0..0144e0baa 100644
--- a/plugins/vscode/vscode.plugin.zsh
+++ b/plugins/vscode/vscode.plugin.zsh
@@ -1,9 +1,17 @@
 # VScode zsh plugin
-# author: https://github.com/MarsiBarsi
+# Authors:
+#   https://github.com/MarsiBarsi (original author)
+#   https://github.com/babakks
 
-# Use main Visual Studio Code version by default
-: ${VSCODE:=code}
+# Use the stable VS Code release, unless the Insiders version is the only
+# available installation
+if ! which code > /dev/null && which code-insiders > /dev/null; then
+  : ${VSCODE:=code-insiders}
+else
+  : ${VSCODE:=code}
+fi
 
+# Define aliases
 alias vsc="$VSCODE ."
 alias vsca="$VSCODE --add"
 alias vscd="$VSCODE --diff"
-- 
cgit v1.2.3-70-g09d2


From f9a2d8cae39a0fb42e22aa17222c7da7b44b7ede Mon Sep 17 00:00:00 2001
From: Andy Pickle <39109475+pickleat@users.noreply.github.com>
Date: Mon, 24 Feb 2020 13:13:16 -0600
Subject: vscode: add documentation for running in macOS (#8674)

---
 plugins/vscode/README.md | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'plugins/vscode')

diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md
index 2c6530650..469c57ea8 100644
--- a/plugins/vscode/README.md
+++ b/plugins/vscode/README.md
@@ -8,6 +8,15 @@ To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`
 plugins=(... vscode)
 ```
 
+## 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.**
-- 
cgit v1.2.3-70-g09d2