dev: automated commit - 2025-06-08 23:28:55
This commit is contained in:
parent
33106ea4a6
commit
0ab9f62ace
13 changed files with 1255 additions and 715 deletions
55
runs/nvim
Executable file
55
runs/nvim
Executable file
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/env bash
|
||||
# NAME: Setup Neovim configuration
|
||||
# REQUIRES: interactive
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Source common functions
|
||||
source "$(dirname "$0")/../common.sh" || {
|
||||
echo "[ERROR] Could not source common.sh" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
readonly NVIM_REPO="https://github.com/marianozunino/nvim.git"
|
||||
readonly NVIM_CONFIG_DIR="$HOME/.config/nvim"
|
||||
|
||||
check_requirements() {
|
||||
if ! command_exists git; then
|
||||
log_error "git is required but not installed"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
setup_neovim_config() {
|
||||
log_info "Setting up Neovim configuration"
|
||||
|
||||
if [[ -d "$NVIM_CONFIG_DIR" ]]; then
|
||||
local backup_dir="$NVIM_CONFIG_DIR.backup.$(date +%Y%m%d_%H%M%S)"
|
||||
log_info "Backing up existing Neovim config to $backup_dir"
|
||||
mv "$NVIM_CONFIG_DIR" "$backup_dir"
|
||||
fi
|
||||
|
||||
log_info "Cloning Neovim config to $NVIM_CONFIG_DIR"
|
||||
git clone "$NVIM_REPO" "$NVIM_CONFIG_DIR"
|
||||
|
||||
cd "$NVIM_CONFIG_DIR"
|
||||
|
||||
if [[ -d ".githooks" ]]; then
|
||||
git config core.hooksPath .githooks
|
||||
chmod +x .githooks/* 2>/dev/null || true
|
||||
log_info "Git hooks configured"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
init_script
|
||||
|
||||
check_requirements
|
||||
setup_neovim_config
|
||||
|
||||
log_info "Neovim configuration: $NVIM_CONFIG_DIR"
|
||||
|
||||
finish_script 0
|
||||
}
|
||||
|
||||
main "$@"
|
Loading…
Add table
Add a link
Reference in a new issue