-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathnvim.sh
More file actions
executable file
·37 lines (28 loc) · 1.06 KB
/
nvim.sh
File metadata and controls
executable file
·37 lines (28 loc) · 1.06 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
#!/bin/bash
set -e
source ./scripts/utils.sh
# Check if Neovim is installed via Homebrew
if ! brew list | grep -q "^neovim$"; then
print_error "Neovim is not installed. Please ensure it was installed via Homebrew"
exit 1
fi
# Create Neovim config directory if it doesn't exist
NVIM_CONFIG_DIR="$HOME/.config/nvim"
step "Setting up Neovim configuration directory..."
mkdir -p "$NVIM_CONFIG_DIR"
# Backup existing config if it exists
if [ -d "$NVIM_CONFIG_DIR" ] && [ "$(ls -A $NVIM_CONFIG_DIR)" ]; then
step "Backing up existing Neovim configuration..."
mv "$NVIM_CONFIG_DIR" "$NVIM_CONFIG_DIR.backup.$(date +%Y%m%d_%H%M%S)"
mkdir -p "$NVIM_CONFIG_DIR"
fi
# Copy new configuration
step "Installing Neovim configuration..."
cp -r configs/nvim/* "$NVIM_CONFIG_DIR/"
# Install LazyVim if not already present
step "Setting up LazyVim..."
if [ ! -d "$NVIM_CONFIG_DIR/lazy" ]; then
print_muted "LazyVim will be automatically installed on first run"
fi
print_success "Neovim setup completed!"
print_muted "Run 'nvim' to start Neovim and complete the LazyVim installation"