Skip to content

Instantly share code, notes, and snippets.

@callumflack
Last active July 20, 2022 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callumflack/5847a2a19a8a64b004f872137bcf2bcf to your computer and use it in GitHub Desktop.
Save callumflack/5847a2a19a8a64b004f872137bcf2bcf to your computer and use it in GitHub Desktop.
Dotfiles
## https://github.com/mdo/config/blob/master/.gitconfig
## https://github.com/ajmalsiddiqui/dotfiles/blob/master/.gitconfig
## https://github.com/necolas/dotfiles/blob/master/git/gitconfig
# NB. When in terminal, you can replace "git config" with "git config --global" to set a default preference for all repositories, which are stored here.
[user]
name = Callum Flack
email = callum@callumflack.design
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[core]
# use vs code
editor = code --wait
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
# Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
[credential]
helper = osxkeychain
# Default pull config
# Pulling without specifying how to reconcile divergent branches is discouraged
# You can also pass --rebase, --no-rebase, or --ff-only on the command line
# to override the configured default per invocation.
# https://spin.atomicobject.com/2020/05/05/git-configurations-default/
# - git config pull.rebase false # merge (the default strategy)
# - git config pull.rebase true # rebase (better!)
# - git config pull.ff only # fast-forward only
# I never leave home without: rebase.autostash and rebase.autoSquash
# “git config –global push.default simple” to push only the current branch
[pull]
rebase = true
[fetch]
prune = true
[diff]
colorMoved = zebra
# Aliases
# See more in…
# https://gist.github.com/sw-yx/7fa1009e460ecb818d5e6d9ca4616a05
[alias]
br = branch
co = checkout
cp = cherry-pick
ci = commit
st = status
# alias add='git add .'
# alias log='git log'
# alias diff='git diff'
# alias branch='git branch'
# alias st='git status'
# alias stash='git stash'
# alias fetch='git fetch'
# alias push='git push origin head'
# alias pull='git pull'
# alias pullr='git pull --rebase'
# alias fp='fetch && pull'
# alias gmm='git merge master'
# https://git.wiki.kernel.org/articles/a/l/i/Aliases.html
# `git remote prune origin`: remove remote-tracking branches that were deleted from the remote repo
# `git gc`: cleanup unnecessary files and optimize the local repository
# `git clean -df`: remove untracked files and directories from the working tree
# `git stash clear`: remove all stashed states
trim = !git remote prune origin && git gc
cleanup = !git clean -df && git stash clear
# Add untracked, remove deleted, and show status
adda = !git add -A && git status
# Diff what is staged for the next commit
diffc = diff --cached
# Diff overview
diffst = diff --stat
[commit]
template = ~/.stCommitMsg
# color opts: normal, black, red, green, yellow, blue, magenta, cyan, or white
[color]
ui = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow
frag = magenta
old = red
new = green
[color "status"]
added = yellow
changed = green
untracked = cyan
# https://gist.github.com/sw-yx/7fa1009e460ecb818d5e6d9ca4616a05
# run git config --global core.excludesfile ~/.gitignore_global
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store
.vscode
.idea
Thumbs.db
Exact default set-up except for:
module.exports = {
config: {
...
fontSize: 12,
fontFamily:
fontFamily:
'"JetBrains Mono Light", InputMonoCompressed-Light, Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
...
plugins: [
"hypercwd",
"hyperlinks",
"hyper-search",
"hyper-spacegray-eighties",
],
...
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# export PATH="/usr/local/bin:$PATH"
# export PATH="/usr/local/sbin:$PATH"
# Path to your oh-my-zsh installation.
export ZSH="/Users/callumflack/.oh-my-zsh"
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
plugins=(git)
# plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source $ZSH/oh-my-zsh.sh
# use VS Code
## export EDITOR="code -w" ?
export EDITOR="Visual Studio Code"
# ----------------------------------
# Path shit…
# ----------------------------------
# NPM
## export PATH="$HOME/node_modules/bin:$PATH"
## https://gist.github.com/DanHerbert/9520689
# export PATH="$HOME/.npm-packages/bin:$PATH"
# n: https://github.com/tj/n
# https://www.notion.so/callum/Multiple-Node-versions-on-a-Mac-20bb4f1bf5314072bd61055ed7840c7c
# Yarn?
# export PATH="$(yarn global bin):$PATH"
# https://github.com/wting/autojump
# this might be vim stuff… got back to j?
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[[ -s `brew --prefix`/etc/autojump.sh ]] && . `brew --prefix`/etc/autojump.sh
# ----------------------------------
# Aliases
# For a full list of active aliases, run `alias`
# ----------------------------------
alias ls='ls -al'
alias gitc='code ~/.gitconfig'
alias zs="code ~/.zshrc"
alias ohmyzsh="code ~/.oh-my-zsh"
# Git specific aliases: see .gitconfig
alias g='git'
# PNPM
# https://pnpm.io/cli/add
alias nr='pnpm run'
alias nd='pnpm run dev'
alias ni='pnpm install'
alias nid='pnpm install -D'
alias nu='pnpm uninstall'
alias nre='pnpm remove'
alias nup='pnpm update'
# Yarn
alias y='yarn'
alias ya='yarn add'
alias yd='yarn dev'
alias yb='yarn build'
alias ys='yarn start'
alias yg='yarn generate'
# Postgres
alias pgstart='pg_ctl -D /usr/local/var/postgres start'
alias pgstop='pg_ctl -D /usr/local/var/postgres stop'
# Jekyll & Python quick starts
alias js='bundle exec jekyll serve --watch'
alias ps='python -m SimpleHTTPServer 4000'
# Urbit
alias u='~/urbit/urbit'
# https://twitter.com/wesbos/status/601426471240998912
function t() {
tree -I '.git|node_modules|bower_components|.DS_Store' --dirsfirst --filelimit 15 -L ${1:-3} -aC $2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment