-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
executable file
·65 lines (57 loc) · 1.94 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
#!/bin/bash
clone_if_required() {
if ! git remote show origin | grep "dotfiles" > /dev/null ; then
git clone https://github.com/muralisc/dotfiles
cd dotfiles
fi
DOTFILES_PATH=$(pwd)
}
vim_setup() {
if [[ ! -a ~/.vim/autoload/plug.vim ]] ;
then
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
mkdir -p ~/.vim/vimundo
fi
vim +PlugInstall +qall! #vim -c PlugInstall -c qall!
}
git_setup() {
git config --global core.whitespace "tab-in-indent"
#git config --global credential.helper 'cache --timeout=80000'
git config --global credential.helper /usr/lib/git-core/git-credential-libsecret
git config --global diff.tool 'meld'
git config --global user.useConfigOnly true
git config --global core.pager 'less -RS'
git config --global blame.date relative
git config --global init.templatedir '~/.git_template'
}
get_zsh_plugins() {
curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/plugins/shrink-path/shrink-path.plugin.zsh \
--create-dirs -o ~/.local/shrink-path.plugin.zsh
mkdir -p ~/.zsh;
git clone https://github.com/zsh-users/zsh-history-substring-search ~/.zsh/zsh-history-substring-search
# rg completion
curl https://raw.githubusercontent.com/BurntSushi/ripgrep/master/complete/_rg \
--create-dirs -o ~/.zsh/completion/_rg
}
symlink_files() {
allfiles=$(find $DOTFILES_PATH -type f -not \( \
-ipath '*.git/*' -o \
-name README.md -o \
-name crontab -o \
-name install.sh \) )
for file in $allfiles; do
homepath="${HOME}$( sed "s#$DOTFILES_PATH##" <<< $file )"
mkdir -p $(dirname $homepath)
ln -vs --backup=numbered $file $homepath
done
}
extra_install() {
[[ -f ~/.extra ]] && source ~/.extra
}
clone_if_required
git_setup
get_zsh_plugins
symlink_files
vim_setup
extra_install