summaryrefslogtreecommitdiff
path: root/system/zsh/zshrc
diff options
context:
space:
mode:
authorDan Theisen <djt@hxx.in>2018-06-23 18:52:26 +0000
committerDan Theisen <djt@hxx.in>2018-06-23 19:02:40 +0000
commit4d991936c0489b5a4e12e5a06de56a68a0e37b97 (patch)
tree2f92a501b2d98d3b4c434f5628223c565b3acf54 /system/zsh/zshrc
parent8d0e88d6c984d71677b3abc2c83d9d8e288d19e9 (diff)
downloadpackages-4d991936c0489b5a4e12e5a06de56a68a0e37b97.tar.gz
packages-4d991936c0489b5a4e12e5a06de56a68a0e37b97.tar.bz2
packages-4d991936c0489b5a4e12e5a06de56a68a0e37b97.tar.xz
packages-4d991936c0489b5a4e12e5a06de56a68a0e37b97.zip
system/zsh: [PD] bump, fix maintainer, clean up
Diffstat (limited to 'system/zsh/zshrc')
-rw-r--r--system/zsh/zshrc32
1 files changed, 32 insertions, 0 deletions
diff --git a/system/zsh/zshrc b/system/zsh/zshrc
new file mode 100644
index 000000000..11546c289
--- /dev/null
+++ b/system/zsh/zshrc
@@ -0,0 +1,32 @@
+# enable emacs input mode by default
+bindkey -e
+
+# set standard PS1
+do_colour() {
+ local colourise=false
+
+ LS_COLORS=
+ eval "$(dircolors -b)"
+ if [[ -n ${LS_COLORS:+set} ]]; then
+ colourise=true
+ else
+ unset LS_COLORS
+ fi
+
+ if ${colourise} ; then
+ if [[ ${EUID} == 0 ]] ; then
+ PS1='%B%F{white}%m%f%b %B%F{cyan}%~%f%b %B%F{red}%#%f%b '
+ else
+ PS1='%n on %B%F{white}%m%f%b %~ %B%F{green}%#%f%b '
+ fi
+ else
+ if [[ ${EUID} == 0 ]] ; then
+ # show root@ when we don't have colors
+ PS1='! %n on %m %~ %# '
+ else
+ PS1='%n on %m %~ %# '
+ fi
+ fi
+}
+
+do_colour