2019-04-21 11:42:15 +00:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
install_dotfile() {
|
|
|
|
local dest="$1"
|
2019-05-20 21:30:50 +00:00
|
|
|
local contents="$2"
|
2019-04-21 11:42:15 +00:00
|
|
|
|
|
|
|
if [[ -f "$dest" ]]; then
|
|
|
|
mv -vi "$dest" "$dest.dmitmel-dotfiles-backup"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "${dest:h}"
|
2019-05-20 21:30:50 +00:00
|
|
|
echo "$contents" > "$dest"
|
2019-04-21 11:42:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# ZSH
|
|
|
|
for zsh_file_name in zshrc; do
|
2019-05-20 21:30:50 +00:00
|
|
|
install_dotfile "$HOME/.$zsh_file_name" '
|
2019-04-21 11:42:15 +00:00
|
|
|
#!/usr/bin/env zsh
|
2019-04-22 15:07:02 +00:00
|
|
|
source "$PWD/zsh/$zsh_file_name"
|
2019-05-20 21:30:50 +00:00
|
|
|
'
|
2019-04-21 11:42:15 +00:00
|
|
|
done
|
|
|
|
unset zsh_file_name
|
|
|
|
|
|
|
|
# Neovim
|
2019-05-20 21:30:50 +00:00
|
|
|
install_dotfile ~/.config/nvim/init.vim 'source $PWD/nvim/init.vim'
|
|
|
|
install_dotfile ~/.config/nvim/ginit.vim 'source $PWD/nvim/ginit.vim'
|