c6ce22f1d221ea99e0d63edb445038a747c78884

Author
Ali Sajid Imami <395482+AliSajid@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(vscode): add `vscp` alias (#12092)

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>

Diff

 1diff --git a/plugins/vscode/README.md b/plugins/vscode/README.md
 2index 726b23d359f77230352e42416550267384a21e69..f91b533c99c5c8244733b536df79c864b1fa9c6d 100644
 3--- a/plugins/vscode/README.md
 4+++ b/plugins/vscode/README.md
 5@@ -1,6 +1,7 @@
 6 # VS Code
 7 
 8-This plugin provides useful aliases to simplify the interaction between the command line and VS Code or VSCodium editor.
 9+This plugin provides useful aliases to simplify the interaction between the command line and VS Code or
10+VSCodium editor.
11 
12 To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`:
13 
14@@ -14,26 +15,30 @@ This plugin requires to have a flavour of VS Code installed and it's executable
15 
16 You can install either:
17 
18-* VS Code (code)
19-* VS Code Insiders (code-insiders)
20-* VSCodium (codium)
21+- VS Code (code)
22+- VS Code Insiders (code-insiders)
23+- VSCodium (codium)
24 
25 ### MacOS
26+
27 While Linux installations will add the executable to PATH, MacOS users might still have to do this manually:
28 
29-[For VS Code and VS Code Insiders](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line), open
30-the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command:
31+[For VS Code and VS Code Insiders](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line),
32+open the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command:
33+
34 > Shell Command: Install 'code' command in PATH
35 
36-[For VSCodium](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#how-do-i-open-vscodium-from-the-terminal), open
37-the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command:
38+[For VSCodium](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#how-do-i-open-vscodium-from-the-terminal),
39+open the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell Command:
40+
41 > Shell Command: Install 'codium' command in PATH
42 
43 ## Using multiple flavours
44 
45-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
46-manually specify the flavour's executable. Add the following line to the .zshrc file (between the `ZSH_THEME` and the `plugins=()` lines).
47-This will make the plugin use your manually defined executable.
48+If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code
49+Insiders, you can manually specify the flavour's executable. Add the following line to the .zshrc file
50+(between the `ZSH_THEME` and the `plugins=()` lines). This will make the plugin use your manually defined
51+executable.
52 
53 ```zsh
54 ZSH_THEME=...
55@@ -61,6 +66,7 @@ source $ZSH/oh-my-zsh.sh
56 | vscr                    | code --reuse-window            | Force to open a file or folder in the last active window.                                                   |
57 | vscw                    | code --wait                    | Wait for the files to be closed before returning.                                                           |
58 | 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. |
59+| vscp `profile`          | code --profile `profile`       | Specifies the profile to open Code with.                                                                    |
60 
61 ## Extensions aliases
62 
63diff --git a/plugins/vscode/vscode.plugin.zsh b/plugins/vscode/vscode.plugin.zsh
64index 356c6236088dabfa407bf6542739962ad17f4361..77367bcac0df8919c64144e7b076b526a98af627 100644
65--- a/plugins/vscode/vscode.plugin.zsh
66+++ b/plugins/vscode/vscode.plugin.zsh
67@@ -3,6 +3,7 @@
68 #   https://github.com/MarsiBarsi (original author)
69 #   https://github.com/babakks
70 #   https://github.com/SteelShot
71+#   https://github.com/AliSajid
72 
73 # Verify if any manual user choice of VS Code exists first.
74 if [[ -n "$VSCODE" ]] && ! which $VSCODE &>/dev/null; then
75@@ -38,6 +39,7 @@ alias vscn="$VSCODE --new-window"
76 alias vscr="$VSCODE --reuse-window"
77 alias vscw="$VSCODE --wait"
78 alias vscu="$VSCODE --user-data-dir"
79+alias vscp="$VSCODE --profile"
80 
81 alias vsced="$VSCODE --extensions-dir"
82 alias vscie="$VSCODE --install-extension"