You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
52 lines
1.3 KiB
# VS Code (stable / insiders) / VSCodium / Cursor zsh plugin |
|
# Authors: |
|
# https://github.com/MarsiBarsi (original author) |
|
# https://github.com/babakks |
|
# https://github.com/SteelShot |
|
# https://github.com/AliSajid |
|
|
|
# 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 |
|
elif which cursor &>/dev/null; then |
|
VSCODE=cursor |
|
else |
|
return |
|
fi |
|
fi |
|
|
|
function vsc { |
|
if (( $# )); then |
|
$VSCODE $@ |
|
else |
|
$VSCODE . |
|
fi |
|
} |
|
|
|
alias vsca="$VSCODE --add" |
|
alias vscd="$VSCODE --diff" |
|
alias vscg="$VSCODE --goto" |
|
alias vscn="$VSCODE --new-window" |
|
alias vscr="$VSCODE --reuse-window" |
|
alias vscw="$VSCODE --wait" |
|
alias vscu="$VSCODE --user-data-dir" |
|
alias vscp="$VSCODE --profile" |
|
|
|
alias vsced="$VSCODE --extensions-dir" |
|
alias vscie="$VSCODE --install-extension" |
|
alias vscue="$VSCODE --uninstall-extension" |
|
|
|
alias vscv="$VSCODE --verbose" |
|
alias vscl="$VSCODE --log" |
|
alias vscde="$VSCODE --disable-extensions"
|
|
|