forked from Maciejonos/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-lazyvim
More file actions
executable file
·43 lines (35 loc) · 1.13 KB
/
setup-lazyvim
File metadata and controls
executable file
·43 lines (35 loc) · 1.13 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
40
41
42
43
#!/bin/bash
set -e
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "$SCRIPT_DIR/lib/helpers.sh"
source "$SCRIPT_DIR/lib/backup.sh"
DOTFILES_DIR="$HOME/.local/share/dotfiles"
if [ -d "$HOME/.config/nvim" ] || [ -L "$HOME/.config/nvim" ]; then
log_info "Existing nvim config found, backing up..."
if [ -e "$HOME/.config/nvim" ]; then
backup_file "$HOME/.config/nvim" || {
log_error "Failed to backup nvim config"
exit 1
}
fi
remove_path "$HOME/.config/nvim"
fi
if ! git clone https://github.com/LazyVim/starter ~/.config/nvim; then
log_error "Failed to clone LazyVim starter"
exit 1
fi
rm -rf ~/.config/nvim/.git
log_info "LazyVim starter cloned"
if [ -d "$DOTFILES_DIR/default/nvim" ]; then
cp -r "$DOTFILES_DIR/default/nvim"/* "$HOME/.config/nvim/"
else
log_error "Could not setup lazyvim"
exit 1
fi
# Append custom options to options.lua
cat >> "$HOME/.config/nvim/lua/config/options.lua" <<'EOF'
local opt = vim.opt
opt.number = true -- Show absolute line numbers
opt.relativenumber = false -- Disable relative line numbers
EOF
log_success "Lazyvim setup finished!"