From 7862bc6473935e43b927b7c8085f1dcf81bb39cb Mon Sep 17 00:00:00 2001 From: Michele Gerarduzzi Date: Sun, 10 Dec 2023 16:54:31 +0100 Subject: [PATCH] Fix LazyVim installation --- .gitignore | 1 + src/os/installs/neovim.sh | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index bd9f301..db1ac1e 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ src/shell/config/nvim/* !src/shell/config/nvim/lua src/shell/config/nvim/lua/* !src/shell/config/nvim/lua/plugins +src/shell/config/nvim/lua/plugins/example.lua !src/shell/config/starship.toml !src/shell/config/tmux diff --git a/src/os/installs/neovim.sh b/src/os/installs/neovim.sh index 476cd39..bbb3d7f 100755 --- a/src/os/installs/neovim.sh +++ b/src/os/installs/neovim.sh @@ -6,9 +6,14 @@ cd "$(dirname "${BASH_SOURCE[0]}")" \ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - install_lazyvim() { - - git clone https://github.com/LazyVim/starter ~/.config/nvim && \ - rm -rf ~/.config/nvim/.git &> /dev/null + declare -r NVIM_DIRECTORY="$HOME/.config/nvim" + + # Clone the repository into an non-empty directory + git -C "$NVIM_DIRECTORY" init &> /dev/null + git -C "$NVIM_DIRECTORY" remote add origin https://github.com/LazyVim/starter &> /dev/null + git -C "$NVIM_DIRECTORY" fetch &> /dev/null + git -C "$NVIM_DIRECTORY" checkout origin/main &> /dev/null + rm -rf "$NVIM_DIRECTORY/.git" &> /dev/null print_result $? "Install LazyVim"