49 lines
1.2 KiB
Bash
Executable File
49 lines
1.2 KiB
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"
|
|
sudo pacman -S "$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 --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git \
|
|
${ZSH_CUSTOM}/plugins/zsh-syntax-highlighting
|
|
fi
|
|
|
|
|
|
# Install zsh-syntax-highlighting
|
|
if [ ! -d "${ZSH_CUSTOM}/plugins/fzf-zsh-plugin" ]; then
|
|
git clone --depth 1 https://github.com/unixorn/fzf-zsh-plugin.git \
|
|
${ZSH_CUSTOM}/plugins/fzf-zsh-plugin
|
|
fi
|