Skip to content

Instantly share code, notes, and snippets.

@mmatczuk
Last active August 3, 2021 08:13
Show Gist options
  • Save mmatczuk/bab9b69f0b7a4aa986e1e74e7d1f16a0 to your computer and use it in GitHub Desktop.
Save mmatczuk/bab9b69f0b7a4aa986e1e74e7d1f16a0 to your computer and use it in GitHub Desktop.
Configs
# Git
source ~/.git-prompt.sh
PROMPT_COMMAND='case $PWD in
$HOME) HPWD="~";;
$HOME/*/*) HPWD="${PWD#"${PWD%/*/*}/"}";;
$HOME/*) HPWD="~/${PWD##*/}";;
/*/*/*) HPWD="${PWD#"${PWD%/*/*}/"}";;
*) HPWD="$PWD";;
esac; __git_ps1 " \u@\h:$HPWD" "\\\$ "'
# Make
export MAKEFLAGS="-j4"
[user]
name = Michał Matczuk
email = michal@scylladb.com
[push]
default = upstream
[pull]
rebase = true
[diff]
color = auto
renames = copies
[format]
thread = true
[merge]
conflictstyle = diff3
[branch]
autosetupmerge = true
sort = -committerdate
[rerere]
enabled = true
[rebase]
autosquash = true
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[alias]
co = checkout
br = branch
ci = commit
st = status
publish = "!sh -c 'git push -u ${1:-origin} $(git rev-parse --abbrev-ref HEAD)' -"
pr = "!sh -c 'git fetch origin pull/$0/head:pr/$0 && git co pr/$0'"
hist = log --pretty=format:'%Cred%h%Creset %C(bold blue)<%an>%Creset%C(yellow)%d%Creset %Cgreen(%cr)%Creset%n%w(80,8,8)%s%n' --graph --name-status
ls = log --pretty=format:'%C(yellow)%h %C(white dim)%cd %<|(42,trunc)%an %C(reset)%s' --date=short --abbrev=8 --no-merges
lsm = log --pretty=format:'%C(yellow)%h %C(white dim)%cd %<|(42,trunc)%an %C(reset)%s' --date=short --abbrev=8 --merges
show-changes = !sh -c 'git fetch' && git ls HEAD..origin/$(git rev-parse --abbrev-ref HEAD)
purge = !git branch --merged=master | grep -Ev '^\\* | master$' | xargs -r git branch -d
mrproper = !git remote prune origin && git gc && git clean -df
[core]
autocrlf = input
pager = less -R
## mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
## arrow up
"\e[A": history-search-backward
## arrow down
"\e[B": history-search-forward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment