Skip to content

Commit

Permalink
feat: update setup.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
reVrost committed Jul 12, 2024
1 parent 2798187 commit 6163aab
Showing 1 changed file with 49 additions and 25 deletions.
74 changes: 49 additions & 25 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
#!/usr/bin/env bash

# Function to install Homebrew if it's not already installed
install_brew() {
if ! command -v brew &>/dev/null; then
printf "\nInstalling Homebrew.."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
else
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
fi
}

# Function to install packages using Homebrew
install_package() {
brew install "$1"
}

# Install Homebrew if not already installed
install_brew

# install zsh
if ! command -v brew &>/dev/null; then
# probably a ubuntu distro
sudo apt update
sudo apt install zsh
else
brew install zsh
if ! command -v zsh &>/dev/null; then
install_package zsh
fi

# oh my zsh
printf "\nInstalling oh my zsh.."
yes | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" &>/dev/null
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions &>/dev/null
# install plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.zsh/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.zsh/zsh-autosuggestions

# Links
printf "\nConfiguring links.."
Expand All @@ -23,32 +39,40 @@ ln -s $(pwd)/.zshrc ~/.zshrc
ln -s ~/code/reVrost/dotfiles/custom ~/.zsh/custom
source ~/.zshrc

# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"

# install direnv
brew install direnv
brew install neovim
# install direnv and neovim
install_package direnv
install_package neovim

# lsps
brew install lua-language-server stylua luarocks luacheck
brew install shellcheck shmft
brew install docker docker-compose
install_package lua-language-server
install_package stylua
install_package luarocks
install_package luacheck
install_package shellcheck
install_package shfmt
install_package bat
install_package docker
install_package docker-compose

# git stuff
brew install git
brew tap microsoft/git
brew install --cask git-credential-manager-core
install_package git

# Install Git Credential Manager for Linux if brew is not available
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
curl -fsSL https://aka.ms/install-gcm.sh | bash
else
brew tap microsoft/git
brew install --cask git-credential-manager-core
fi

# pure prompt
printf "\nInstalling pure prompt.."
mkdir -p "$HOME/.zsh"
git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure"

# install nvchad
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1
nvim +'hi NormalFloat guibg=#1e222a' +PackerSync
git clone -b v2.0 https://github.com/NvChad/NvChad ~/.config/nvim --depth 1
#nvim +'hi NormalFloat guibg=#1e222a' +PackerSync

# git
printf "\nConfiguring git stuff.."
Expand Down

0 comments on commit 6163aab

Please sign in to comment.