-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_bashrc.tmpl
74 lines (57 loc) · 1.81 KB
/
dot_bashrc.tmpl
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
#!/bin/bash
# If not running interactively, don't do anything
if [[ -z "${PS1}" ]]; then
return
fi
# Source global configuration between bash and zsh
if [[ -r "${HOME}/.shrc" ]]; then
# shellcheck disable=SC1091
source "${HOME}/.shrc"
fi
# Source global definitions
if [[ -r "/etc/bashrc" ]]; then
# shellcheck disable=SC1091
source "/etc/bashrc"
fi
# kubectl completions
# https://kubernetes.io/docs/reference/kubectl/cheatsheet/#bash
if command -v kubectl >/dev/null; then
# shellcheck disable=SC1090
source <(kubectl completion bash)
# Add kubectl completions to "alias k=kubectl"
complete -o default -F __start_kubectl k
fi
{{- if eq .chezmoi.os "darwin" }}
# https://support.apple.com/en-us/HT208050
export BASH_SILENCE_DEPRECATION_WARNING=1
# Bash completions on macOS
# https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/bash-completion%402.rb#L50
readonly bash_completion_path="/usr/local/etc/profile.d/bash_completion.sh"
if [[ -r "${bash_completion_path}" ]]; then
# shellcheck disable=SC1090
source "${bash_completion_path}"
fi
# Google Cloud SDK tools and completions
readonly gcloud_inc_path="${HOMEBREW_PREFIX}/share/google-cloud-sdk/path.bash.inc"
if [[ -r "${gcloud_inc_path}" ]]; then
# shellcheck disable=SC1090
source "${gcloud_inc_path}"
fi
{{- end }}
if command -v rbenv >/dev/null; then
eval "$(rbenv init - bash)"
fi
# GitHub Copilot CLI aliases (ghcs, ghce)
if command -v gh >/dev/null; then
eval "$(gh copilot alias -- bash)"
fi
# Don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# For setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# Prompt
if command -v starship >/dev/null; then
eval "$(starship init bash)"
fi