commit c600f80335f5d849f0c19b6f299886383ff96012 Author: James Spencer Date: Sun Oct 1 19:42:33 2023 +0100 feat: symlink dotfiles diff --git a/README.md b/README.md new file mode 100644 index 0000000..84d6ded --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +After installation + +- Set `gitconfig_work` to your work email address +- Set up `.ssh/config` to use 1Password SSH Keys +- Provide `authToken` for work npm registry in `.npmrc` diff --git a/gitconfig b/gitconfig new file mode 100644 index 0000000..0ee7f34 --- /dev/null +++ b/gitconfig @@ -0,0 +1,28 @@ +[user] + name = James Spencer + email = james@jmes.tech + +[alias] + yolo = "!f() { git add -A . && git commit -m $1 && git push -f origin main; }; f" + +[apply] + whitespace = nowarn + +[commit] + gpgsign = true + +[core] + excludesFile = ~/.gitignore_global + editor = code --wait + +[gpg] + format = ssh + +[gpg "ssh"] + program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign + +[init] + defaultBranch = main + +[includeIf "gitdir:~/work/"] + path = ~/.gitconfig_work diff --git a/gitconfig_work b/gitconfig_work new file mode 100644 index 0000000..2db421e --- /dev/null +++ b/gitconfig_work @@ -0,0 +1,3 @@ +[user] + name = James Spencer + email = work@company.com diff --git a/gitignore_global b/gitignore_global new file mode 100644 index 0000000..94f1119 --- /dev/null +++ b/gitignore_global @@ -0,0 +1,2 @@ +.DS_Store +.vscode diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..1c5caa3 --- /dev/null +++ b/install.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# Save the current working directory +DIR=$(pwd) + +# TODO: Pretty colours (from holman) + +# Go to the home directory +cd ~ + +# Begin Symlinks +echo "Linking dotfiles..." + +LINKS='zshrc +gitconfig +gitconfig_work +gitignore_global +npmrc' + +echo +for L in $LINKS; do + # check if the LINK exists, back up the existing version + if [[ -e ".$L" ]]; then + echo "Backing up .$L" + mv ".$L" ".$L.backup" + fi + + echo "Linking .$L" + ln -s "$DIR/$L" ".$L" +done +echo + +echo "Done linking dotfiles." +# End Symlinks diff --git a/npmrc b/npmrc new file mode 100644 index 0000000..ab0cad1 --- /dev/null +++ b/npmrc @@ -0,0 +1 @@ +//registry.npmjs.org/:_authToken={$insert_your_token_here} diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..a777027 --- /dev/null +++ b/zshrc @@ -0,0 +1,27 @@ +export ZSH="$HOME/.oh-my-zsh" +export EDITOR="code --wait" + +ZSH_THEME="robbyrussell" + +plugins=(git zsh-syntax-highlighting) + +source $ZSH/oh-my-zsh.sh + +# Begin Aliases +alias gc="git commit" +alias gfp="git fetch && git pull" +alias mkdir = "mkdir -p" + +alias ..='cd ..' +alias ...='cd ../..' +alias .3='cd ../../../' +alias .4='cd ../../../../' +alias .5='cd ../../../../..' +alias .6='cd ../../../../../..' +# End Aliases + +autoload -U promptinit; promptinit +prompt pure + +export VOLTA_HOME="$HOME/.volta" +export PATH="$VOLTA_HOME/bin:$PATH"