Tools Scripts Runtimes
This is a personal reference of tools/scripts/runtimes/package managers etc that I use with some setup instructions.
Homebrew
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
git
$ brew install git
My .gitconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Dave Normington | |
email = <work.email@address.com> # <--- change this | |
[alias] | |
wipe = reset --hard head | |
l = log --pretty=format:'%C(yellow)%h %Cred%ad %Cblue%an%Cgreen%d %Creset%s' --date=short | |
out-bw = log --pretty=format:'%h %ad %an%d %s' --date=short --no-color | |
last = log -1 HEAD | |
ch = checkout | |
co = commit | |
coa = commit -a --amend --no-edit | |
coanv = commit -a --amend --no-edit --no-verify | |
br = branch | |
st = status | |
st-last = diff head^ --name-only | |
cp = cherry-pick | |
r = rebase | |
rc = "!f(){ git add . && git rebase --continue; }; f" | |
ra = rebase --abort | |
pop = reset --soft head^ | |
cut = reset --hard head^ | |
dno = diff --name-only | |
cobr = "!f(){ git commit -am \"$(git symbolic-ref --short head | cut -d '/' -f 1) $@\"; }; f" | |
# fetch and update master | |
update = "!f(){ git fetch -apt; git ch master; git merge origin/master; git ch -; }; f" | |
# list files with date of last commit: git ls-files-dated <path> | |
ls-files-dated = "!f() { git ls-files $1 | xargs -I{} sh -c \"git log --format='%aD {}' {} | head -n1\"; }; f" | |
# Deletes local branches if remote branch doesn't exist | |
prune-local-branches = "!f() { git fetch -apt; git branch -vv | grep ': gone]' | grep -v \"\\*\" | awk '{ print $1; }' | xargs git br -D; }; f" | |
[push] | |
default = current | |
[core] | |
fileMode = true | |
[credential] | |
helper = osxkeychain | |
[pager] | |
branch = false | |
[pull] | |
ff = only |
tig
$ brew install tig
tmux
https://github.com/tmux/tmux/wiki
$ brew install tmux
My .tmux.conf:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remap prefix from C-b to ` (backtick) | |
unbind C-b | |
set-option -g prefix ` | |
bind-key ` send-prefix | |
unbind ^A | |
# Start window numbering at 1 | |
set -g base-index 1 | |
# use 256 term for pretty colors | |
set -g default-terminal "screen-256color" | |
# increase scroll-back history | |
set -g history-limit 10000 | |
# select pane via mouse click | |
set -g mouse on | |
# copy + paste | |
# Use vim keybindings in copy mode | |
setw -g mode-keys vi | |
# vim bindings for select and copy | |
bind-key -Tcopy-mode-vi 'v' send -X begin-selection | |
bind-key -Tcopy-mode-vi 'V' send -X select-line | |
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" | |
bind-key -Tcopy-mode-vi Escape send -X cancel | |
# open pane/window in same directory | |
bind '"' split-window -c "#{pane_current_path}" | |
bind % split-window -h -c "#{pane_current_path}" | |
bind c new-window -c "#{pane_current_path}" | |
run-shell ~/clone/path/resurrect.tmux |
zsh
https://github.com/romkatv/powerlevel10k
$ brew install zsh
$ chsh -s /usr/local/bin/zsh
$ brew install romkatv/powerlevel10k/powerlevel10k
My .zshrc
Node (fnm)
Install Node.js and npm
$ brew install fnm
$ fnm use 16
vim
Install a more recent version of vim. I used to have a fairly sophisticated .vimrc but now I just use it bare bones because I use VSCode as my code editor
$ brew install vim
VSCode
https://code.visualstudio.com/
Download the latest version from the website. If you signin then you can choose to sync all your settings 🎉