forked from CoreyMSchafer/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vscode.sh
executable file
·58 lines (49 loc) · 1.85 KB
/
vscode.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env zsh
# Check if Homebrew's bin exists and if it's not already in the PATH
if [ -x "/opt/homebrew/bin/brew" ] && [[ ":$PATH:" != *":/opt/homebrew/bin:"* ]]; then
export PATH="/opt/homebrew/bin:$PATH"
fi
# Install VS Code Extensions
extensions=(
esbenp.prettier-vscode
formulahendry.code-runner
foxundermoon.shell-format
mechatroner.rainbow-csv
ms-python.black-formatter
ms-python.isort
ms-python.pylint
ms-python.python
ms-toolsai.jupyter
ms-vscode.theme-predawnkit
mtxr.sqltools
mtxr.sqltools-driver-sqlite
teabyii.ayu
tomoki1207.pdf
)
# Get a list of all currently installed extensions.
installed_extensions=$(code --list-extensions)
for extension in "${extensions[@]}"; do
if echo "$installed_extensions" | grep -qi "^$extension$"; then
echo "$extension is already installed. Skipping..."
else
echo "Installing $extension..."
code --install-extension "$extension"
fi
done
echo "VS Code extensions have been installed."
# Define the target directory for VS Code user settings on macOS
VSCODE_USER_SETTINGS_DIR="${HOME}/Library/Application Support/Code/User"
# Check if VS Code settings directory exists
if [ -d "$VSCODE_USER_SETTINGS_DIR" ]; then
# Copy your custom settings.json and keybindings.json to the VS Code settings directory
ln -sf "${HOME}/dotfiles/settings/VSCode-Settings.json" "${VSCODE_USER_SETTINGS_DIR}/settings.json"
ln -sf "${HOME}/dotfiles/settings/VSCode-Keybindings.json" "${VSCODE_USER_SETTINGS_DIR}/keybindings.json"
echo "VS Code settings and keybindings have been updated."
else
echo "VS Code user settings directory does not exist. Please ensure VS Code is installed."
fi
# Open VS Code to sign-in to extensions
code .
echo "Login to extensions (Copilot, Grammarly, etc) within VS Code."
echo "Press enter to continue..."
read