-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
150 lines (113 loc) · 3.38 KB
/
install
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/usr/bin/env bash
if [ -z "$HOME" ]; then echo "Seems you're \$HOMEless :("; exit 1; fi
##########
# CONFIG
##########
DOTFILES=$HOME/.dotfiles
echo "#########################################"
echo " INSTALLING DOTFILES "
echo "-----------------------------------------\n"
echo "HOME: $HOME"
echo "DOTFILES: $DOTFILES"
echo "#########################################\n"
echo "Cleaning \$HOME and \$DOTFILES"
cd $HOME
rm -rf $DOTFILES
mkdir $DOTFILES
cd $DOTFILES
##########
# SETUP
##########
echo "Cloning git"
git init
git remote add origin git@github.com:Glenf/dotfiles.git
git pull origin main
######################
# GIT
######################
echo "Setting up git\n"
rm -rf \
$HOME/.gitconfig \
$HOME/.gitignore \
ln -s $DOTFILES/gitconfig $HOME/.gitconfig
ln -s $DOTFILES/gitignore $HOME/.gitignore
######################
# VIM / NEOVIM THINGS
######################
echo "Setting up VIM\n"
rm -rf \
$HOME/.vimrc \
$HOME/.vim \
$HOME/.config/nvim/init.vim \
$HOME/.local/share/nvim/
ln -s $DOTFILES/vim $HOME/.vim
ln -s $DOTFILES/vim/vimrc $HOME/.config/nvim/init.vim
ln -s $DOTFILES/vim/vimrc $HOME/.vimrc
mkdir -p \
$HOME/.local/share/vim/{swap,undo,backup} \
$HOME/.config/nvim/
# Plug for Vim (~/.vim/autoload)
curl -fLo $HOME/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# Plug for Neovim (~/.local/share/nvim/site/autoload)
curl -fLo $HOME/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
######################
# TMUX
######################
echo "Setting up TMUX\n"
rm -rf \
$HOME/.tmux.conf \
$HOME/.tmux/plugins/
ln -s $DOTFILES/tmux.conf $HOME/.tmux.conf
mkdir -p $HOME/.tmux/plugins/
# Tmux Plugin Manager
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
###########################
# HOMEBREW / DIRENV / ASDF
###########################
echo "Setting up Direnv\n"
rm -rf $HOME/.config/direnv
ln -s $DOTFILES/direnv $HOME/.config/direnv
if [ "$(uname)" == "Darwin" ]; then
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
echo "Installing Homebrew\n"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "Update Homebrew\n"
brew update
fi
echo "Installing ASDF\n"
brew install asdf
echo "Installing mcfly\n"
brew tap cantino/mcfly
brew install mcfly
else
# Assuming linux
echo "Installing ASDF from git\n"
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.1
. $HOME/.asdf/asdf.sh
echo "Installing mcfly from git\n"
curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sh -s -- --git cantino/mcfly
fi
echo "Setting up ASDF\n"
asdf plugin-add direnv
asdf install direnv latest
asdf global direnv latest
######################
# ZSH
######################
echo "Setting up ZSH\n"
rm -rf $HOME/.zshrc
ln -s $DOTFILES/zshrc ~/.zshrc
echo "#########################################"
echo " ALL DONE "
echo "-----------------------------------------\n"
echo "Remember to update git email\n"
echo "git config --global user.email your.email@here.com\n"
echo "#########################################\n"
cd $HOME
rm -f $HOME/.zcompdump*
exec zsh