vscode.plugin.zsh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. # https://github.com/AliSajid
  7. # Verify if any manual user choice of VS Code exists first.
  8. if [[ -n "$VSCODE" ]] && ! which $VSCODE &>/dev/null; then
  9. echo "'$VSCODE' flavour of VS Code not detected."
  10. unset VSCODE
  11. fi
  12. # Otherwise, try to detect a flavour of VS Code.
  13. if [[ -z "$VSCODE" ]]; then
  14. if which code &>/dev/null; then
  15. VSCODE=code
  16. elif which code-insiders &>/dev/null; then
  17. VSCODE=code-insiders
  18. elif which codium &>/dev/null; then
  19. VSCODE=codium
  20. else
  21. return
  22. fi
  23. fi
  24. function vsc {
  25. if (( $# )); then
  26. $VSCODE $@
  27. else
  28. $VSCODE .
  29. fi
  30. }
  31. alias vsca="$VSCODE --add"
  32. alias vscd="$VSCODE --diff"
  33. alias vscg="$VSCODE --goto"
  34. alias vscn="$VSCODE --new-window"
  35. alias vscr="$VSCODE --reuse-window"
  36. alias vscw="$VSCODE --wait"
  37. alias vscu="$VSCODE --user-data-dir"
  38. alias vscp="$VSCODE --profile"
  39. alias vsced="$VSCODE --extensions-dir"
  40. alias vscie="$VSCODE --install-extension"
  41. alias vscue="$VSCODE --uninstall-extension"
  42. alias vscv="$VSCODE --verbose"
  43. alias vscl="$VSCODE --log"
  44. alias vscde="$VSCODE --disable-extensions"