#! /bin/zsh
#
# setup_mac.sh
# Copyright (C) 2022 fabian <fabian@FordPrefect.home>
#
# Distributed under terms of the MIT license.
#

brew install neovim tmux alacritty coreutils cmake golang npm virtualenvwrapper
source /opt/homebrew/bin/virtualenvwrapper.sh
mkvirtualenv neovim
pip3 install pynvim
npm install -g neovim
echo For alacritty to work seemlessly with tmux, we will have to add '/usr/local/bin'\
    to the path. This will require your root password.
sudo launchctl config user path /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin 
cp $PWD/nvim/scheme.vim.template $PWD/nvim/scheme.vim
cp $PWD/.config/alacritty/schemes.yml.template $PWD/.config/alacritty/schemes.yml
./clone_and_link_mac.sh

for filename in zsh/.*_mac.example; do
    cp $filename ${filename:0:-12}
done

for filename in tmux/.*_mac.example; do
    cp $filename ${filename:0:-12}
done

for filename in vim/.*_mac.example; do
    cp $filename ${filename:0:-12}
done

open fonts/*.ttf

echo "You should now start tmux (and zsh) and nvim for automatic plugin installation."
