-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·81 lines (68 loc) · 2.18 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
#!/bin/bash
which -s brew
if [[ $? != 0 ]] ; then
echo "Installing homebrew..."
sleep 1
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
function installBrew() {
if [ ! -d "/usr/local/Cellar/$1" ]; then
echo "Installing $1..."
sleep 1
brew install $1
else
echo "$1 is already installed."
fi
}
function installCask() {
if [ ! -d "/usr/local/Caskroom/$1" ]; then
echo "Installing $1..."
sleep 1
brew install --cask $1
else
echo "$1 is already installed."
fi
}
installBrew tmux
installBrew node
installBrew yarn
installBrew zsh
installBrew fzf
installCask telegram
installCask spectacle
installCask spotify
installCask iterm2
installCask karabiner-elements
if [ ! -d "/Library/Developer/CommandLineTools" ]; then
xcode-select --install
fi
# Install Vim plugin manager
echo "Setting up vim and tmux config...";
if [ ! -d "$HOME/.vim/bundle/Vundle.vim/" ]; then
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
# Get files from dotfiles repo
git clone https://github.com/cynthi-a/dotfiles.git $TMPDIR/dotfiles
cp $TMPDIR/dotfiles/.vimrc ~/.vimrc
cp $TMPDIR/dotfiles/.tmux.conf ~/.tmux.conf
cp $TMPDIR/dotfiles/.gitignore ~/.gitignore_global
echo "Setting up aliases..."
cp $TMPDIR/dotfiles/.bashrc ~/.bashrc
rm -rf $TMPDIR/dotfiles
# Source configuration files
echo "Sourcing config files..."
tmux source-file ~/.tmux.conf
git config --global core.excludesfile ~/.gitignore
echo "Installing vim plugins..."
vim +PluginInstall +qall
echo "Maximising key repeat..."
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms);
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
echo "Disable press and hold for VS Code"
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
echo "Install Oh My Zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo "Done!"