my xfce4 dotfiles
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.

78 lines
4.9 KiB

3 years ago
  1. # VS Code
  2. This plugin provides useful aliases to simplify the interaction between the command line and VS Code or VSCodium editor.
  3. To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`:
  4. ```zsh
  5. plugins=(... vscode)
  6. ```
  7. ## Requirements
  8. This plugin requires to have a flavour of VS Code installed and it's executable available in PATH.
  9. You can install either:
  10. * VS Code (code)
  11. * VS Code Insiders (code-insiders)
  12. * VSCodium (codium)
  13. ### MacOS
  14. While Linux installations will add the executable to PATH, MacOS users might still have to do this manually:
  15. [For VS Code and VS Code Insiders](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open
  16. the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command:
  17. > Shell Command: Install 'code' command in PATH
  18. [For VSCodium](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#how-do-i-open-vscodium-from-the-terminal), open
  19. the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command:
  20. > Shell Command: Install 'codium' command in PATH
  21. ## Using multiple flavours
  22. If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code Insiders, you can
  23. manually specify the flavour's executable. Add the following line to the .zshrc file (between the `ZSH_THEME` and the `plugins=()` lines).
  24. This will make the plugin use your manually defined executable.
  25. ```zsh
  26. ZSH_THEME=...
  27. # Choose between one [code, code-insiders or codium]
  28. # The following line will make the plugin to open VS Code Insiders
  29. # Invalid entries will be ignored, no aliases will be added
  30. VSCODE=code-insiders
  31. plugins=(... vscode)
  32. source $ZSH/oh-my-zsh.sh
  33. ```
  34. ## Common aliases
  35. | Alias | Command | Description |
  36. | ----------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------- |
  37. | vsc | code . | Open the current folder in VS code |
  38. | vsca `dir` | code --add `dir` | Add folder(s) to the last active window |
  39. | vscd `file` `file` | code --diff `file` `file` | Compare two files with each other. |
  40. | vscg `file:line[:char]` | code --goto `file:line[:char]` | Open a file at the path on the specified line and character position. |
  41. | vscn | code --new-window | Force to open a new window. |
  42. | vscr | code --reuse-window | Force to open a file or folder in the last active window. |
  43. | vscw | code --wait | Wait for the files to be closed before returning. |
  44. | vscu `dir` | code --user-data-dir `dir` | Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code. |
  45. ## Extensions aliases
  46. | Alias | Command | Description |
  47. | ----------------------- | ---------------------------------------------------------------- | --------------------------------- |
  48. | vsced `dir` | code --extensions-dir `dir` | Set the root path for extensions. |
  49. | vscie `id or vsix-path` | code --install-extension `extension-id> or <extension-vsix-path` | Installs an extension. |
  50. | vscue `id or vsix-path` | code --uninstall-extension `id or vsix-path` | Uninstalls an extension. |
  51. ## Other options:
  52. | Alias | Command | Description |
  53. | ------------ | ------------------------- | --------------------------------------------------------------------------------------------------------------------- |
  54. | vscv | code --verbose | Print verbose output (implies --wait). |
  55. | vscl `level` | code --log `level` | Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'. |
  56. | vscde | code --disable-extensions | Disable all installed extensions. |