-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·39 lines (30 loc) · 1.05 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·39 lines (30 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
GREEN="\033[0;32m"
YELLOW="\033[1;33m"
RED="\033[0;31m"
RESET="\033[0m"
echo -e "${YELLOW}📦 Starting Neovim configuration installation...${RESET}"
# First install the nvim bruh
if ! command -v nvim &> /dev/null
then
echo -e "${RED}❌ Neovim is not installed. Please install Neovim first.${RESET}"
exit 1
fi
# Paths
NVIM_CONFIG_DIR="$HOME/.config/nvim"
BACKUP_DIR="$HOME/.config/nvim_backup_$(date +%s)"
CURRENT_DIR=$(pwd)
# don't worry, i will backup your file.
if [ -d "$NVIM_CONFIG_DIR" ]; then
echo -e "${YELLOW}⚠️ Found existing Neovim config. Backing up to ${BACKUP_DIR}${RESET}"
mv "$NVIM_CONFIG_DIR" "$BACKUP_DIR"
fi
# Finally, do magic --> config to ~/.config/nvim
echo -e "${GREEN}📁 Copying Neovim config to ${NVIM_CONFIG_DIR}${RESET}"
mkdir -p "$HOME/.config"
cp -r "$CURRENT_DIR" "$NVIM_CONFIG_DIR"
# Install plugins
echo -e "${GREEN}⚙️ Installing Neovim plugins...${RESET}"
nvim --headless "+Lazy! sync" +qa || true
echo -e "${GREEN}✅ Installation complete! Launch Neovim and enjoy your setup.${RESET}"