forked from hanxi/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·66 lines (54 loc) · 1.39 KB
/
bootstrap.sh
File metadata and controls
executable file
·66 lines (54 loc) · 1.39 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
65
#! /usr/bin/env bash
set -e
set -x
ETC=~/.local/etc
BIN=~/.local/bin
mkdir -p $ETC
mkdir -p $BIN
# git clone respository
cd ~/.local/
if [ -d dotfiles ]; then
cd dotfiles
git pull
else
git clone https://github.com/wtmlon/dotfiles.git
cd dotfiles
fi
cp -rf etc/* $ETC/
cp -rf bin/* $BIN/
cp bootstrap.sh $BIN/
# install oclip
#curl -s https://oclip.hanxi.info/install | bash -- /dev/stdin eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 '11111'
# source init.sh
#sed -i "\:$ETC/init.sh:d" ~/.zshrc
#echo ". $ETC/init.sh" >> ~/.zshrc
#. ~/.zshrc
sed -i "\:$ETC/init.sh:d" ~/.bashrc
echo ". $ETC/init.sh" >> ~/.bashrc
. ~/.bashrc
# for neovim
mkdir -p ~/.config/nvim
cp $ETC/init.vim ~/.config/nvim/init.vim
# source vimrc.vim
touch ~/.vimrc
sed -i "\:$ETC/vimrc.vim:d" ~/.vimrc
echo "source $ETC/vimrc.vim" >> ~/.vimrc
# source tmux.conf
touch ~/.tmux.conf
sed -i "\:$ETC/tmux.conf:d" ~/.tmux.conf
echo "source $ETC/tmux.conf" >> ~/.tmux.conf
# update git config
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global core.quotepath false
# install vim plug
if command -v nvim 2>/dev/null; then
nvim +PlugInstall +qall
else
vim_version=`vim --version | head -1`
if [[ `echo $vim_version | awk -F '[ .]' '{print $5}'` -gt 7 ]]; then
vim +PlugInstall +qall
fi
fi