Files
dotfiles/install.sh
2024-12-19 13:05:59 +01:00

41 lines
968 B
Bash
Executable File

#!/bin/bash
command_exists() {
command -v "$1" >/dev/null 2>&1
}
create_symlink() {
local source=$1
local target=$2
if [ ! -e "$target" ]; then
ln -s "$source" "$target"
echo "Added symlink $source -> $target"
fi
}
install_package() {
local package=$1
if ! command_exists "$package"; then
sudo dnf update && sudo dnf install "$package"
fi
}
install_package "neovim"
create_symlink "$HOME/dotfiles/nvim" "$HOME/.config/nvim"
install_package "zsh"
create_symlink "$HOME/dotfiles/zsh/.zshrc" "$HOME/.zshrc"
if [ ! -d "$HOME/.oh-my-zsh" ]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
ZSH_CUSTOM=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}
# Install zsh-syntax-highlighting
if [ ! -d "${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting" ]; then
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting
fi