A semi-generic set of rc files I use for installing a new machine
Last active
May 9, 2025 17:17
-
-
Save shannonwells/2863f6fda48936ec15076081d7b4f5d5 to your computer and use it in GitHub Desktop.
Install scripts for use with a USB key, for setting up a new Mac for development.
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
# handy alias for read-only in vim | |
alias view='vim -R' | |
alias ls='ls --color=auto' | |
alias ll='ls -lhA' | |
alias lsd='ls -d .??*' | |
alias xselin='xsel --clipboard --input' | |
alias xselout='xsel --clipboard --output' | |
alias pullor='git pull origin `parse_git_branch`' | |
alias pullreb='git pull --rebase origin `parse_git_branch`' | |
alias pushor='git push origin `parse_git_branch`' | |
alias pushfor='git push --force-with-lease origin `parse_git_branch`' | |
alias sudo="sudo "; |
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
cat ~/.bash_profile | |
export EDITOR=vim | |
export PS1="\[\033[34m\]\h:\W \[\033[35m\]\$(parse_git_branch)\[\033[00m\]\$(git config user.initials)$\[\033[00m\] " | |
export SUDO_PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[0m\]' | |
export HISTCONTROL=ignoredups; | |
shopt -s histappend; | |
export PROMPT_COMMAND='echo -ne "\033]0;${USER}: ${PWD}\007"' | |
### FUNCTIONS | |
# This function is used in several aliases below. | |
function parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /'; } | |
export -f parse_git_branch | |
for file in "$HOME/.bash_includes/*" ; do source $file ; done | |
eval "$(ssh-agent -s)" |
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 = shannonwells | |
email = [email protected] | |
[merge] | |
tool = diffmerge | |
[mergetool "diffmerge"] | |
cmd = /Applications/DiffMerge.app/Contents/MacOS/DiffMerge "\"$PWD/$BASE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$REMOTE\"" "\"$PWD/$MERGED\"" | |
keepTemporaries = false | |
trustExitCode = false | |
keepBackup = false | |
[diff] | |
tool = diffmerge | |
[difftool "diffmerge"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$LOCAL\"" "\"$REMOTE\"" | |
[filter "lfs"] | |
clean = git-lfs clean %f | |
smudge = git-lfs smudge %f | |
required = true | |
[alias] | |
alias = config --get-regexp alias | |
lll = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
lol = log --graph --decorate --pretty=oneline --abbrev-commit | |
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all | |
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate | |
cm = commit | |
co = checkout | |
cob = checkout -b | |
last = log -1 HEAD --stat | |
st = status | |
pom = pull origin main | |
ftp = fetch -ftp | |
done = push origin HEAD | |
force = push origin --force-with-lease | |
recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format='%(refname:short)' | |
undo = reset HEAD~1 --mixed | |
[mergetool] | |
keepBackup = true | |
[core] | |
excludesfile = ~/.gitignore | |
[push] | |
autoSetupRemote = true | |
[init] | |
defaultBranch = main |
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
openssh-server | |
vim | |
xsel | |
net-tools | |
slack | |
Brave | |
digikam | |
gimp | |
LibreOffice | |
<password manager> | |
<vpn> | |
<IDE> | |
# polkadot dev | |
clang | |
rustup | |
protobuf-compiler | |
subwasm | |
zoom | |
audacity | |
git | |
gdebi |
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
#!/usr/bin/env sh | |
function exit_err { | |
echo "\033[1;37;41m \033[m" | |
echo "\033[1;37;41m $1 \033[m" | |
echo "\033[1;37;41m \033[m" | |
exit 1 | |
} |
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
set nu | |
filetype indent plugin on | |
syntax on | |
set wildmenu | |
set showcmd | |
set hlsearch | |
set autoindent | |
set ruler | |
set laststatus=2 | |
set cmdheight=2 | |
set shiftwidth=4 | |
set softtabstop=4 | |
set expandtab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment