summaryrefslogtreecommitdiffstats
path: root/.shrc
blob: 30aa340b7078f51d6a007ee0eecf083e80fcf7d0 (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
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh -i

case $- in
	*i*) ;;

	*)
		return
		;;
esac

set -o vi
set -o nounset
set -o noclobber
set -o ignoreeof

unalias du 2> /dev/null
du() (
        set -- -k "$@"
        exec du "$@"
)

unalias df 2> /dev/null
df() (
        set -- -k "$@"
        exec df "$@"
)

unalias ls 2> /dev/null
ls() (
        set -- -Fkq "$@"
        exec ls  "$@"
)

for cmd in egrep fgrep dir vdir which
do
	unalias "$cmd" 2> /dev/null
	if command -v "$cmd" > /dev/null
	then
		eval "$(cat <<-EOF
			$cmd(){
				printf "%s: %s: command is disabled.\n" \
					"$0" "$cmd" >&2
				return 1
			}
			EOF
		)"
	fi
done

sudo() (
	command sudo -nv 2> /dev/null
	exec sudo "$@"
)

sudoedit() (
	sudo -e "$@"
)

if command -v pyenv > /dev/null
then
	eval "$(pyenv init -)"
fi

if command -v nodenv > /dev/null
then
	eval "$(nodenv init -)"
fi

if test -n "${TTY-}" && test -t 0
then
	TTY=$(tty)
	export TTY
	export GPG_TTY="$TTY"
fi

PS1='$(sh-prompt $?)'