feat: symlink dotfiles

main
James Spencer 2023-10-01 19:42:33 +01:00
commit c600f80335
Signed by: james
SSH Key Fingerprint: SHA256:7tOVvkg3eVqn4GbEInHoSkEG96Cvqgvwx+VHUD9begc
7 changed files with 99 additions and 0 deletions

5
README.md Normal file
View File

@ -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`

28
gitconfig Normal file
View File

@ -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

3
gitconfig_work Normal file
View File

@ -0,0 +1,3 @@
[user]
name = James Spencer
email = work@company.com

2
gitignore_global Normal file
View File

@ -0,0 +1,2 @@
.DS_Store
.vscode

33
install.sh Executable file
View File

@ -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

1
npmrc Normal file
View File

@ -0,0 +1 @@
//registry.npmjs.org/:_authToken={$insert_your_token_here}

27
zshrc Normal file
View File

@ -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"