-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·107 lines (86 loc) · 3.26 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
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
#!/bin/bash
echo "Installing and Upgrading OS Packages ..."
sudo apt-get update -y > /dev/null \
&& sudo apt-get upgrade -y > /dev/null \
&& sudo apt-get install -y > /dev/null \
git \
vim \
build-essential \
wget \
zsh > /dev/null
github_dir="$HOME/Codes/github"
dcorrea_dir="$HOME/Codes/dcorrea"
nerdfonts_dir="$github_dir/nerdfonts"
bundles_vim="$HOME/.vim/bundle"
mkdir $github_dir -p
mkdir $dcorrea_dir -p
mkdir $nerdfonts_dir -p
WHOAMI=$(whoami)
MY_NAME="Danilo Correa"
MY_EMAIL="[email protected]"
GIT_CONFIG_CONTENT=$(cat << EOF
[alias]
l = log --pretty=oneline -n 35 --graph --abbrev-commit
aliases = config --get-regexp alias
whoami = config user.email
contributors = shortlog --summary --numbered
tags = tag -l
branches = branch --all
remotes = remote --verbose
[color]
# Use colors in Git commands that are capable of colored output when
# outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
ui = auto
[color "branch"]
current = yellow reverse
local = yellow bold
remote = green bold
[color "diff"]
meta = yellow bold
frag = magenta bold # line info
old = red # deletions
new = green # additions
[color "status"]
added = green bold
changed = red bold
untracked = cyan bold
[user]
email = $MY_EMAIL
name = $MY_NAME
[core]
editor = vim
[mergetool]
prompt = false
EOF
)
echo "Generating your .gitconfig file."
printf "%s\n" "$GIT_CONFIG_CONTENT" > "$HOME/.gitconfig"
for value in Regular Bold
do
printf "Baixando Ubuntu %s \n" "$value"
printf "Baixando UbuntuMono %s \n \n" "$value"
ubuntu_url="https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/Ubuntu/Regular/complete/Ubuntu%20Nerd%20Font%20Complete.ttf"
ubuntu_mono_url="https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/UbuntuMono/Regular/complete/Ubuntu%20Mono%20Nerd%20Font%20Complete.ttf"
curl -s -fLo "$nerdfonts_dir/Ubuntu Nerd Font Complete.otf" $ubuntu_url > /dev/null
curl -s -fLo "$nerdfonts_dir/UbuntuMono Nerd Font Complete.otf" $ubuntu_mono_url > /dev/null
done
if [ -d $bundles_vim ]; then
rm -rf $bundles_vim
fi
rm -rf ~/.vimrc
printf "%s \n" "Installing Your Vundle Package Manager"
git clone --quiet https://github.com/VundleVim/Vundle.vim.git "$bundles_vim/Vundle.vim" > /dev/null
vim -u "$(pwd)/vimrc_plugins" -c "PluginInstall" -c "qa!"
printf "%s \n" "Configuring your vimrc file"
ln -sfn "$(pwd)/vimrc" ~/.vimrc
rm -rf ~/.oh-my-zsh
rm -rf ~/.zshrc
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
printf "%s \n" "Install plugins to Oh-My-Zsh"
rm -rf ~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
rm -rf ~/.oh-my-zsh/custom}/plugins/plugins/zsh-syntax-highlighting
git clone --quiet https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --quiet https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
old_text="plugins=(git)"
new_text="plugins=(git asdf docker docker-compose extract zsh-autosuggestions copyfile extract gitfast jsontools zsh-syntax-highlighting)"
sed -i "s/$old_text/$new_text/g" ~/.zshrc