#!/usr/bin/env bash

# omarchy:summary=Install Neovim with the LazyVim configuration
# omarchy:requires-sudo=true

# Based: Neovim from apt or brew with what LazyVim's plugins need, then the
# LazyVim configuration from config/nvim into ~/.config/nvim when the user
# has none. A configuration that is already there stays the user's.

set -eo pipefail

echo "Installing Neovim..."
omarchy-pkg-add neovim git ripgrep fd-find brew=fd build-essential linux=only

if [[ ! -e ~/.config/nvim ]]; then
  echo "Installing the LazyVim configuration..."
  mkdir -p ~/.config
  cp -R "$OMARCHY_PATH/config/nvim" ~/.config/nvim
fi
