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