-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.kshrc
61 lines (46 loc) · 1.47 KB
/
.kshrc
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
# ~/.kshrc
set -o emacs
set -o csh-history
HISTFILE="$HOME/.sh_history"
HISTSIZE="5000"
# CTRL-l to clear.
bind -m '^L'=clear'^J'
# Colours
# -----------------------------------------------------------------------------
default="\033[0m"
green="\033[0;32m"
# Completions
#------------------------------------------------------------------------------
# Terraform
if [ -x /usr/local/bin/terraform ]; then
set -A complete_terraform_1 -- apply console destroy env fmt get graph import init output plan providers push refresh show taint untaint validate version workspace
set -A complete_tf_1 -- apply console destroy env fmt get graph import init output plan providers push refresh show taint untaint validate version workspace
fi
# Prompt
#------------------------------------------------------------------------------
if [ -e "$HOME"/bin/git-prompt-ksh.sh ]; then
# shellcheck source=/home/rosstimson/bin/git-prompt-ksh.sh
. "$HOME"/bin/git-prompt-ksh.sh
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWUPSTREAM="auto"
fi
set -A big_gits \
/usr/ports \
/usr/src \
/usr/xenocara
git_prompt() {
# __git_ps1 causes some slowness on large repos, don't run this there.
# shellcheck disable=SC2154
for d in "${big_gits[@]}"; do
if echo "${PWD}" | grep -q "${d}"; then
echo "(BIG)"
return
fi
done
branch=$(__git_ps1 "%s")
if [ "${branch}" != "" ]; then
echo "(${branch})"
fi
}
PS1='${green}\h${default}:\W$(git_prompt) $ '