1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00
dotfiles/install

53 lines
1.4 KiB
Plaintext
Raw Normal View History

2020-02-14 15:03:21 +00:00
#!/usr/bin/env sh
2016-11-09 13:09:59 +00:00
2020-02-09 09:01:02 +00:00
# We need the environment to be able to symlink files accordingly
case "$1" in
desktop)
EXTENSION="desktop"
;;
thinkpad)
EXTENSION="thinkpad"
;;
esac
2020-02-14 15:50:49 +00:00
# Create nvim config directory if it doesn't exist
if [ ! -d ~/.config/nvim ]; then
echo "Creating ~/.config/nvim"
mkdir -p ~/.config/nvim
fi
2020-02-02 17:40:52 +00:00
for d in $(find -- */ -maxdepth 0 -type d | cut -f1 -d '/'); do
echo "Linking $d..."
(stow -t "$HOME" "$d")
2016-11-09 13:09:59 +00:00
done
2020-02-02 17:40:52 +00:00
2020-02-14 15:03:21 +00:00
# Refresh xgd
update-desktop-database ~/.local/share/applications/
xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol
2020-02-14 15:50:49 +00:00
# Install zplug if it doesn't exist yet
if [ ! -d ~/.zplug ]; then
echo "Installing zplug"
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
fi
2020-02-14 15:03:21 +00:00
# Install vim plugins & requirements
if [ ! "$(pip list --user | grep 'pynvim' | wc -l)" -ge 1 ]; then
pip install --user pynvim
fi
2020-02-14 15:50:49 +00:00
# Install plug package manager if it doesn't exist
if [ ! -d ~/.config/nvim/plugged ]; then
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
2020-02-14 15:03:21 +00:00
fi
2020-02-14 15:50:49 +00:00
# Install Neovim plugins
nvim +PlugInstall +qall
2020-02-14 15:03:21 +00:00
# Notify user to manually symlink files
if [ ! -z "$EXTENSION" ]; then
echo "\n\nDon't forget to symlink these files:\n\n"
find ~ \( -type l -o -type f \) -name "*.$EXTENSION" -exec ls -al {} \;
fi