aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh28
1 files changed, 16 insertions, 12 deletions
diff --git a/install.sh b/install.sh
index 658c55a..df09f8f 100755
--- a/install.sh
+++ b/install.sh
@@ -50,7 +50,7 @@ ensure_symlink_exists() {
prompt_for_confirmation "Delete and relink?"
answer=$?
if [ $answer -eq 0 ]; then
- rm "$link_path" || exit 1
+ rm -r "$link_path" || exit 1
ln -s "$source_path" "$link_path" || exit 1
echo "Successfully created link to '$link_path'"
else
@@ -62,7 +62,7 @@ ensure_symlink_exists() {
prompt_for_confirmation "Delete and relink?"
answer=$?
if [ $answer -eq 0 ]; then
- rm "$link_path" || exit 1
+ rm -r "$link_path" || exit 1
ln -s "$source_path" "$link_path" || exit 1
echo "Successfully created link to '$link_path'"
else
@@ -74,6 +74,16 @@ ensure_symlink_exists() {
fi
}
+install_packer() {
+ echo "Installing packer.nvim.."
+ if [ ! -d "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then
+ git clone --depth 1 https://github.com/wbthomason/packer.nvim \
+ "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim"
+ else
+ echo "packer.nvim is already installed."
+ fi
+}
+
main() {
has_homebrew=$(command -v brew)
if test -z "$has_homebrew"; then
@@ -106,17 +116,11 @@ main() {
echo "Linking vim config.."
mkdir -p $HOME/.config/nvim
- ensure_symlink_exists "$PWD/.config/nvim/init.vim" "$HOME/.config/nvim/init.vim"
+ ensure_symlink_exists "$PWD/.config/nvim/init.lua" "$HOME/.config/nvim/init.lua"
- echo "Checking vim-plug installation.."
- if [ -e "$HOME/.config/nvim/plugged" ]; then
- echo "vim-plug already installed"
- else
- echo "Installing vim-plug.."
- sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
- https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
- nvim +PlugInstall +qall --headless
- fi
+ install_packer
+ echo "Running PackerSync to install plugins.."
+ nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
}
main