-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_zshrc.tmpl
100 lines (85 loc) · 2.87 KB
/
dot_zshrc.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# shellcheck disable=SC2148
# Source global configuration between bash and zsh
if [[ -f "${HOME}/.shrc" ]]; then
# shellcheck disable=SC1091
source "${HOME}/.shrc"
fi
# Path to the oh-my-zsh installation.
# Standard installation
if [[ -d "${HOME}/.oh-my-zsh" ]]; then
export ZSH="${HOME}/.oh-my-zsh"
else
# ArchLinux oh-my-zsh-git package
export ZSH="/usr/share/oh-my-zsh"
fi
export ZSH_CACHE_DIR="${HOME}/.cache/zsh"
# Use hyphen-insensitive completion.
# Case sensitive completion must be off. _ and - will be interchangeable.
# shellcheck disable=SC2034
HYPHEN_INSENSITIVE="true"
# Disable bi-weekly auto-update checks.
# shellcheck disable=SC2034
DISABLE_AUTO_UPDATE='true'
# Disable marking untracked files under VCS as dirty.
# This makes repository status check for large repositories much, much faster.
# shellcheck disable=SC2034
DISABLE_UNTRACKED_FILES_DIRTY="true"
# Change the command execution time stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# shellcheck disable=SC2034
HIST_STAMPS="yyyy-mm-dd"
# Disable auto setting the terminal title.
# shellcheck disable=SC2034
DISABLE_AUTO_TITLE="true"
# shellcheck disable=SC2034
plugins=(zsh-syntax-highlighting)
# shellcheck disable=SC1091
source "${ZSH}/oh-my-zsh.sh"
# kubectl completions
# https://kubernetes.io/docs/reference/kubectl/cheatsheet/#zsh
# shellcheck disable=SC2154
if (($+commands[kubectl])); then
# shellcheck disable=SC1090
source <(kubectl completion zsh)
fi
{{- if eq .chezmoi.os "darwin" }}
# Google Cloud SDK tools and completions
readonly gcloud_cask_path="${HOMEBREW_PREFIX}/share/google-cloud-sdk"
readonly gcloud_inc_path="${gloud_cask_path}/path.zsh.inc"
readonly gcloud_completion_path="${gloud_cask_path}/completion.zsh.inc"
if [[ -r "${gcloud_inc_path}" ]]; then
# shellcheck disable=SC1090
source "${gcloud_inc_path}"
fi
if [[ -r "${gcloud_completion_path}" ]]; then
# shellcheck disable=SC1090
source "${gcloud_completion_path}"
fi
{{- end }}
# shellcheck disable=SC2154
if (($+commands[rbenv])); then
eval "$(rbenv init - zsh)"
fi
# GitHub Copilot CLI aliases (ghcs, ghce)
# shellcheck disable=SC2154
if (($+commands[gh])); then
eval "$(gh copilot alias -- zsh)"
fi
if (($+commands[bat])); then
# Syntax highlight --help messages
# https://github.com/sharkdp/bat?tab=readme-ov-file#highlighting---help-messages
alias -g -- --help='--help 2>&1 | bat --language=help --style=plain'
fi
# Prompt
# shellcheck disable=SC2154
if (($+commands[starship])); then
eval "$(starship init zsh)"
else
# export PS1='%n@%m %1~ %# '
autoload -U colors && colors
user_char='$'
if [[ $UID == 0 || $EUID == 0 ]]; then
user_char='#'
fi
export PS1="%B%{${fg[green]}%}%n%{${reset_color}%}%B@%{${fg[blue]}%}%m%{${reset_color}%} %B%{${fg[yellow]}%}%~%{${reset_color}%} ${user_char} "
fi