-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_configs.sh
More file actions
executable file
·65 lines (51 loc) · 1.44 KB
/
setup_configs.sh
File metadata and controls
executable file
·65 lines (51 loc) · 1.44 KB
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
#!/bin/bash
# Check if the parameter is provided
if [ -z "$1" ]; then
echo "Usage: $0 <HOME_DIRECTORY>"
exit 1
fi
# Set HOME to the provided parameter
export HOME="$1"
echo "HOME is set to $HOME"
# Change to HOME directory
cd "$HOME" || exit
# Pull the repo
git clone git@github.com:mattmartineau/configs.git
# Change to the configs directory
cd configs || exit
# Symlink all the dot files
for file in .??*; do
if [ -f "$file" ]; then
ln -sf "$PWD/$file" "$HOME/$file"
fi
done
ln -sf "$PWD/.vim" "$HOME/.vim"
ln -sf "$PWD/tmux.sh" "$HOME/tmux.sh"
cd "$HOME" || exit
## Install vim locally
#git clone https://github.com/vim/vim.git vim_src
#cd vim_src
#./configure --with-features=huge \
# --with-x \
# --enable-gui=gtk3 \
# --enable-cscope \
# --prefix=${HOME}/vim/
#make
#make install
#cd ${HOME}
#rm -rf vim_src
# Install vim-plug if not already installed
if [ ! -f "$HOME/.vim/autoload/plug.vim" ]; then
curl -fLo "$HOME/.vim/autoload/plug.vim" --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# Set up vim plugins using vim-plug
if [ -f "$HOME/.vimrc" ]; then
vim +PlugInstall +qall
fi
# # Put something like this in ~/.profile
# export ROOTDIR=/home/scratch.mmartineau_sw
# export MYVIMRC="${ROOTDIR}/.vimrc"
# export VIMINIT='let $MYVIMRC="${ROOTDIR}/.vimrc" | set runtimepath+=${ROOTDIR}/.vim/ | source $MYVIMRC'
# cd ${ROOTDIR}
echo "Setup completed successfully."