dotfiles/install.zsh

33 lines
714 B
Bash
Raw Normal View History

#!/usr/bin/env zsh
2019-05-22 14:11:02 +00:00
DOTFILES_PATH="${0:a:h}"
install_dotfile() {
local dest="$1"
2019-05-20 21:30:50 +00:00
local contents="$2"
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"
}
# ZSH
2019-06-02 12:11:40 +00:00
for file_name in zshrc; do
file_path="$DOTFILES_PATH/zsh/$file_name"
install_dotfile "$HOME/.$file_name" "source ${(q)file_path}"
done
# Neovim
2019-06-02 12:11:40 +00:00
for file_name in {init,ginit}.vim; do
file_path="$DOTFILES_PATH/nvim/$file_name"
install_dotfile "$HOME/.config/nvim/$file_name" "source ${(q)file_path}"
done
# Kitty
file_name=kitty.conf
2019-06-09 16:04:17 +00:00
file_path="$DOTFILES_PATH/kitty/$file_name"
2019-06-02 12:11:40 +00:00
install_dotfile "$HOME/.config/kitty/$file_name" "include ${(q)file_path}"