vscode.plugin.zsh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # VS Code (stable / insiders) / VSCodium zsh plugin
  2. # Authors:
  3. # https://github.com/MarsiBarsi (original author)
  4. # https://github.com/babakks
  5. # https://github.com/SteelShot
  6. # Verify if any manual user choice of VS Code exists first.
  7. if [[ -n "$VSCODE" ]] && ! which $VSCODE &>/dev/null; then
  8. echo "'$VSCODE' flavour of VS Code not detected."
  9. unset VSCODE
  10. fi
  11. # Otherwise, try to detect a flavour of VS Code.
  12. if [[ -z "$VSCODE" ]]; then
  13. if which code &>/dev/null; then
  14. VSCODE=code
  15. elif which code-insiders &>/dev/null; then
  16. VSCODE=code-insiders
  17. elif which codium &>/dev/null; then
  18. VSCODE=codium
  19. else
  20. return
  21. fi
  22. fi
  23. alias vsc="$VSCODE ."
  24. alias vsca="$VSCODE --add"
  25. alias vscd="$VSCODE --diff"
  26. alias vscg="$VSCODE --goto"
  27. alias vscn="$VSCODE --new-window"
  28. alias vscr="$VSCODE --reuse-window"
  29. alias vscw="$VSCODE --wait"
  30. alias vscu="$VSCODE --user-data-dir"
  31. alias vsced="$VSCODE --extensions-dir"
  32. alias vscie="$VSCODE --install-extension"
  33. alias vscue="$VSCODE --uninstall-extension"
  34. alias vscv="$VSCODE --verbose"
  35. alias vscl="$VSCODE --log"
  36. alias vscde="$VSCODE --disable-extensions"