vscode: add support for VSCodium (#9080)

Co-authored-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
This commit is contained in:
Džiugas Eiva
2020-07-11 21:59:58 +01:00
committed by GitHub
parent 83f6194929
commit 71f0189ed5
2 changed files with 42 additions and 17 deletions

View File

@@ -1,17 +1,28 @@
# VScode zsh plugin
# VS Code (stable / insiders) / VSCodium zsh plugin
# Authors:
# https://github.com/MarsiBarsi (original author)
# https://github.com/babakks
# https://github.com/SteelShot
# 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}
# Verify if any manual user choice of VS Code exists first.
if [[ -n "$VSCODE" ]] && ! which $VSCODE &>/dev/null; then
echo "'$VSCODE' flavour of VS Code not detected."
unset VSCODE
fi
# Otherwise, try to detect a flavour of VS Code.
if [[ -z "$VSCODE" ]]; then
if which code &>/dev/null; then
VSCODE=code
elif which code-insiders &>/dev/null; then
VSCODE=code-insiders
elif which codium &>/dev/null; then
VSCODE=codium
else
return
fi
fi
# Define aliases
alias vsc="$VSCODE ."
alias vsca="$VSCODE --add"
alias vscd="$VSCODE --diff"