-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·80 lines (60 loc) · 2.29 KB
/
install.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
set -e
DOTFILES=$HOME/.dotfiles
#----------------------------------------------------------------------------------------
# Install essential programs and applications
#----------------------------------------------------------------------------------------
brew install iterm2 tmux fzf htop
brew install ripgrep fd bat eza
brew install nvim ctags
brew install font-hack-nerd-font
#----------------------------------------------------------------------------------------
# Initialize
#----------------------------------------------------------------------------------------
cd ~/.dotfiles/
command_exists() {
type "$1" > /dev/null 2>&1
}
#echo "Initializing submodule(s)"
#echo "=============================="
#git submodule update --init --recursive
echo -e "\n\nSettign up ZSH shell"
echo "=============================="
if ! command_exists zsh; then
echo "ZSH not found. Installing ZSH:"
sudo pacman -Sy --noconfirm zsh
fi
if ! [[ $SHELL =~ .*zsh.* ]]; then
echo "Setting ZSH as default shell:"
chsh --shell $(which zsh)
echo "To use new shell restart session"
fi
echo -e "\n\nLinking configuration files"
echo "=============================="
$DOTFILES/zsh/init.sh
for config in "$DOTFILES"/config/*; do
target=$HOME/.config/$( basename $config )
if [ -e "$target" ]; then
rm -rf $target
fi
ln -s $config $target
done
ln -s $DOTFILES/.gitignore $HOME/.gitignore
# Install neovim plugins
nvim +PlugInstall +qall
#----------------------------------------------------------------------------------------
# Git configuration
#----------------------------------------------------------------------------------------
brew install git-delta
printf "Setting up Git...\n\n"
defaultName=$( git config --global user.name )
defaultEmail=$( git config --global user.email )
defaultGithub=$( git config --global github.user )
read -p "Name [$defaultName] " name
read -p "Email [$defaultEmail] " email
read -p "Github username [$defaultGithub] " github
git config --global user.name "${name:-$defaultName}"
git config --global user.email "${email:-$defaultEmail}"
git config --global github.user "${github:-$defaultGithub}"
#----------------------------------------------------------------------------------------
echo "Installation complete. Reload your terminal."