Merge branch 'master' of github.com:tedkulp/dotfiles

This commit is contained in:
2021-09-20 10:26:45 -04:00
7 changed files with 115 additions and 4 deletions

View File

@@ -2,24 +2,111 @@
cd $HOME
# What are we packing?
system_type=$(uname -s)
# Install submodules
echo "Init submodules"
yadm submodule update --recursive --init
# Link in our tmux config
if [ ! -f "$HOME/.tmux.conf" ]; then
ln -s -f .tmux/.tmux.conf
fi
# Create $GOHOME if necessary
if [ ! -d "$HOME/go" ]; then
mkdir $HOME/go
fi
# Update our origin URL to the git version now that we have
# our ssh config stuff downloaded
echo "Updating the yadm repo origin URL"
yadm remote set-url origin "git@github.com:tedkulp/dotfiles.git"
# Mac Specifics
if [ "$system_type" = "Darwin" ]; then
# install homebrew if it's missing
# Install Homebrew if it's missing
if ! command -v brew >/dev/null 2>&1; then
echo "Installing homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Install all the stuff in Brewfile (get comfortable... have some coffee or adult beverage)
if [ -f "$HOME/.Brewfile" ]; then
echo "Updating homebrew bundle"
brew bundle --global
fi
fi
# Linux Specifics
if [ "$system_type" = "Linux" ]; then
# Install apt stuff
sudo apt update -y
sudo apt upgrade -y
sudo apt install -y zsh software-properties-common python-dev python3-dev python3-pip urlview
# Install node if necessary
if ! command -v node >/dev/null 2>&1; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install node
fi
# Install rust and cargo in necessary
if ! command -v cargo >/dev/null 2>&1; then
curl https://sh.rustup.rs -sSf > rustup-init.sh
chmod 755 rustup-init.sh
./rustup-init.sh -y
rm rustup-init.sh
fi
# Install neovim if necessary
if ! command -v nvim >/dev/null 2>&1; then
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt-get update -y
sudo apt-get install neovim -y
fi
# Install lunarvim
if ! command -v lvim >/dev/null 2>&1; then
. $HOME/.cargo/env
bash <(curl -s https://raw.githubusercontent.com/lunarvim/lunarvim/master/utils/installer/install.sh)
$HOME/.local/bin/lvim +PackerSync
fi
# Install fzf if necessary
if ! command -v fzf >/dev/null 2>&1; then
git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf
$HOME/.fzf/install --bin --no-key-bindings --no-completion --no-update-rc
fi
# Install go if necessary
if ! command -v go >/dev/null 2>&1; then
curl -sLk https://git.io/gobrew | sh -
export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"
export GOPATH="$HOME/.gobrew/current/go"
gobrew use 1.17
fi
# Install powerline-go if necessary
if ! command -v powerline-go >/dev/null 2>&1; then
go install github.com/justjanne/powerline-go@latest
fi
fi
# Oh My ZSH
if [ ! -d "$HOME/.oh-my-zsh" ]; then
echo "Installing oh-my-zsh. Install zsh as default, but then exit out to continue."
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/agkozak/zsh-z $HOME/.config/zsh/plugins/zsh-z
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.config/zsh/plugins/zsh-syntax-highlighting
yadm checkout $HOME/.zshrc # We want our version
fi
# Wrapping up
echo "Don't forget to run yadm decrypt!"
exit 0

2
.config/zsh/autojump.zsh Normal file
View File

@@ -0,0 +1,2 @@
[[ -s /home/ted/.autojump/etc/profile.d/autojump.sh ]] && source /home/ted/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u

13
.config/zsh/fzf.zsh Normal file
View File

@@ -0,0 +1,13 @@
# Setup fzf
# ---------
if [[ ! "$PATH" == *$HOME/.fzf/bin* ]]; then
export PATH="${PATH:+${PATH}:}$HOME/.fzf/bin"
fi
# Auto-completion
# ---------------
[[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.zsh" 2> /dev/null
# Key bindings
# ------------
source "$HOME/.fzf/shell/key-bindings.zsh"

2
.config/zsh/go.zsh Normal file
View File

@@ -0,0 +1,2 @@
export PATH="$HOME/.gobrew/current/bin:$HOME/.gobrew/bin:$PATH"
export GOPATH="$HOME/.gobrew/current/go"

2
.config/zsh/nvm.zsh Normal file
View File

@@ -0,0 +1,2 @@
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

1
.config/zsh/rust.zsh Normal file
View File

@@ -0,0 +1 @@
. $HOME/.cargo/env