summaryrefslogtreecommitdiff
path: root/.zshrc
blob: 504673496a323865fa3c075e0bddcabfa97e6b46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
if [ "$(uname)" = "Darwin" ]; then
	alias pkg='brew'
elif [ "$(uname)" = "Linux" ]; then
	alias pkg='sudo dnf'
fi


# Verbose push
function git {
	if [[ "$1" == "push" && "$@" != *"--help"* ]]; then
		shift 1
		command git push -v "$@"
	else
		command git "$@"
	fi
}

alias rawuconf="git --git-dir=$HOME/Repos/uconf.git --work-tree=$HOME"
function uconf {
	if [[ "$1" == "commit" ]]; then
		shift 1
		rawuconf commit "$@"
	elif [[ "$1" == "add" ]]; then
		shift 1
		rawuconf add "$@"
	elif [[ "$1" == "push" ]]; then
		shift 1
		rawuconf push "$@"
	elif [[ "$1" == "status" ]]; then
		shift 1
		rawuconf status "$@"
	elif [[ "$1" == "pull" ]]; then
		shift 1
		rawuconf pull "$@"
	elif [[ "$1" == "fetch" ]]; then
		shift 1
		rawuconf fetch "$@"
	elif [[ "$1" == "merge" ]]; then
		shift 1
		rawuconf merge "$@"
	elif [[ "$1" == "checkout" ]]; then
		shift 1
		rawuconf checkout "$@"
	elif [[ "$1" == "diff" ]]; then
		shift 1
		rawuconf diff "$@"
	elif [[ "$1" == "log" ]]; then
		shift 1
		rawuconf log "$@"
	elif [[ "$1" == "branch" ]]; then
		shift 1
		rawuconf branch "$@"
	elif [[ -z "$1" ]]; then
		rawuconf status
	else
		printf '%s: unknown command %s\n' "$0" "$1" >&2
	fi
}

alias ls="ls --color=auto"

PS1="%~ %# "

export GPG_TTY="$(tty)"

source <(fzf --zsh)