-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac
executable file
·61 lines (52 loc) · 1.86 KB
/
mac
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
#!/bin/sh
# Functions definition
install_package () {
if ! command -v $1 &> /dev/null
then
echo "🚀 Installing $1."
$2
fi
}
# Install homebrew
install_package 'brew' '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"'
echo "🔨 Check for packages installation."
# MacOS comes with vim, zsh and git.
# Since every version of git comes with a lot of features we are upgrading it from the system one
install_package '/usr/local/bin/git' 'brew install git'
install_package 'antigen' 'brew install antigen'
install_package 'tree' 'brew install tree'
install_package 'lazygit' 'brew install lazygit'
install_package 'rbenv' 'brew install rbenv'
install_package 'delta' 'brew install git-delta'
install_package 'bat' 'brew install bat'
echo "🔨 Updating homebrew."
brew update
brew upgrade
echo "🔨 Setup dotfiles."
# Clean dotfiles
rm -f "$HOME/.gemrc"
rm -f "$HOME/.gitconfig"
rm -f "$HOME/.gitignore"
rm -f "$HOME/.vimrc"
rm -f "$HOME/.zshrc"
# Link dotfiles
ln -s "$PWD/dotfiles/gemrc" "$HOME/.gemrc"
ln -s "$PWD/dotfiles/gitconfig" "$HOME/.gitconfig"
ln -s "$PWD/dotfiles/gitignore" "$HOME/.gitignore"
ln -s "$PWD/dotfiles/vimrc" "$HOME/.vimrc"
ln -s "$PWD/dotfiles/zshrc" "$HOME/.zshrc"
# Check if Vundle (VIM dependency manager) is installed
if [ ! -d "$HOME/.vim/bundle/Vundle.vim" ]; then
echo "🚀 Installing Vundle."
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
# Install all vim depdendencies
echo "🔨 Updating Vundle."
vim +PluginInstall +qall
# Download terminal custom theme and setup custom configuration
echo "🔨 Configuring Terminal."
rm "$HOME/Library/Preferences/com.apple.Terminal.plist"
ln -s "$PWD/config/com.apple.Terminal.plist" "$HOME/Library/Preferences/com.apple.Terminal.plist"
# Create VIM swap and backup folders
mkdir -p ~/.vim/backup
mkdir -p ~/.vim/swap