forked from chrisdail/mac-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
executable file
·112 lines (90 loc) · 3 KB
/
setup
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
DIR=$( cd "$( dirname "$0" )" && pwd )
DOTFILES=$DIR/dotfiles
linked() {
ln -shf "$DOTFILES/$1" "$HOME/$1"
}
dotfiles() {
echo Linking all dotfiles to home directory
linked .gitconfig
mkdir -p ~/.config/fish/functions
linked .config/fish/config.fish
linked .config/fish/functions/fish_prompt.fish
mkdir -p ~/Library/Application\ Support/Code/User
linked "Library/Application Support/Code/User/settings.json"
linked "Library/Application Support/Code/User/keybindings.json"
mkdir -p ~/.ssh
linked .ssh/config
}
updateBrew() {
which brew
if [ $? -ne 0 ] ; then
echo Installing Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo Updating Homebrew
brew update
brew upgrade
}
brewBundle() {
echo Installing packages from Brewfile
brew bundle --verbose
}
iTermConfig() {
# Specify the preferences directory
defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "$DIR/dotfiles/iTerm2"
# Tell iTerm2 to use the custom preferences in the directory
defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true
}
fish() {
echo Setting shell to fish
# Add fish to shells
grep fish /etc/shells
if [ $? -ne 0 ]; then
sudo sh -c "echo /usr/local/bin/fish >> /etc/shells"
fi
# Change shell to fish
chsh -s /usr/local/bin/fish
mkdir ~/bin
}
codeExtensions() {
echo Installing VS Code Extensions
code --install-extension formulahendry.auto-rename-tag
code --install-extension streetsidesoftware.code-spell-checker
code --install-extension ms-azuretools.vscode-docker
code --install-extension dbaeumer.vscode-eslint
code --install-extension eamodio.gitlens
code --install-extension znck.grammarly
code --install-extension christian-kohler.npm-intellisense
code --install-extension christian-kohler.path-intellisense
code --install-extension ms-vscode-remote.vscode-remote-extensionpack
code --install-extension stylelint.vscode-stylelint
code --install-extension cssho.vscode-svgviewer
code --install-extension TabNine.tabnine-vscode
code --install-extension redhat.vscode-yaml
# Themes
code --install-extension emmanuelbeziat.vscode-great-icons
code --install-extension PKief.material-product-icons
code --install-extension Equinusocio.vsc-material-theme
# Vue Extension
code --install-extension octref.vetur
}
osxDefaults() {
echo Mac OS Defaults
# Show all files
defaults write com.apple.finder AppleShowAllFiles YES
# Unnatural scrolling
defaults write -g com.apple.swipescrolldirection -bool false
# Remove all unwanted apps from the dock
defaults delete com.apple.dock persistent-apps
defaults delete com.apple.dock persistent-others
killall Dock
killall Finder /System/Library/CoreServices/Finder.app
}
dotfiles
updateBrew
brewBundle
iTermConfig
fish
codeExtensions
osxDefaults