| 
									
										
										
										
											2020-07-11 21:59:58 +01:00
										 |  |  | # VS Code (stable / insiders) / VSCodium zsh plugin | 
					
						
							| 
									
										
										
										
											2020-01-29 16:21:40 +03:30
										 |  |  | # Authors: | 
					
						
							|  |  |  | #   https://github.com/MarsiBarsi (original author) | 
					
						
							|  |  |  | #   https://github.com/babakks | 
					
						
							| 
									
										
										
										
											2020-07-11 21:59:58 +01:00
										 |  |  | #   https://github.com/SteelShot | 
					
						
							| 
									
										
										
										
											2018-07-03 18:45:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-11 21:59:58 +01:00
										 |  |  | # Verify if any manual user choice of VS Code exists first. | 
					
						
							|  |  |  | if [[ -n "$VSCODE" ]] && ! which $VSCODE &>/dev/null; then | 
					
						
							|  |  |  |   echo "'$VSCODE' flavour of VS Code not detected." | 
					
						
							|  |  |  |   unset VSCODE | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Otherwise, try to detect a flavour of VS Code. | 
					
						
							|  |  |  | if [[ -z "$VSCODE" ]]; then | 
					
						
							|  |  |  |   if which code &>/dev/null; then | 
					
						
							|  |  |  |     VSCODE=code | 
					
						
							|  |  |  |   elif which code-insiders &>/dev/null; then | 
					
						
							|  |  |  |     VSCODE=code-insiders | 
					
						
							|  |  |  |   elif which codium &>/dev/null; then | 
					
						
							|  |  |  |     VSCODE=codium | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   fi | 
					
						
							| 
									
										
										
										
											2020-01-29 16:21:40 +03:30
										 |  |  | fi | 
					
						
							| 
									
										
										
										
											2018-07-03 18:45:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-08 22:32:27 +08:00
										 |  |  | alias vsc="$VSCODE ." | 
					
						
							|  |  |  | alias vsca="$VSCODE --add" | 
					
						
							|  |  |  | alias vscd="$VSCODE --diff" | 
					
						
							|  |  |  | alias vscg="$VSCODE --goto" | 
					
						
							|  |  |  | alias vscn="$VSCODE --new-window" | 
					
						
							|  |  |  | alias vscr="$VSCODE --reuse-window" | 
					
						
							|  |  |  | alias vscw="$VSCODE --wait" | 
					
						
							|  |  |  | alias vscu="$VSCODE --user-data-dir" | 
					
						
							| 
									
										
										
										
											2018-07-03 18:45:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-08 22:32:27 +08:00
										 |  |  | alias vsced="$VSCODE --extensions-dir" | 
					
						
							|  |  |  | alias vscie="$VSCODE --install-extension" | 
					
						
							|  |  |  | alias vscue="$VSCODE --uninstall-extension" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | alias vscv="$VSCODE --verbose" | 
					
						
							|  |  |  | alias vscl="$VSCODE --log" | 
					
						
							|  |  |  | alias vscde="$VSCODE --disable-extensions" |