]> git.draconx.ca Git - zshconf.git/blobdiff - zprofile
Add functions for manipulating PATH, and use them to set the default.
[zshconf.git] / zprofile
index 73a7cf83d0f4113d55a6cd3854d97b13f80051e0..dba3a21854ea7b43fe821c9e51126b9570d66d10 100644 (file)
--- a/zprofile
+++ b/zprofile
@@ -9,27 +9,14 @@ fi
 
 # You should override these in your ~/.zprofile (or equivalent) for per-user
 # settings.  For system defaults, you can add a new file in /etc/profile.d/.
-export EDITOR=${EDITOR:-/bin/nano}
+export EDITOR=${EDITOR:-/usr/bin/vim}
 export PAGER=${PAGER:-/usr/bin/less}
 
 # 077 would be more secure, but 022 is generally quite realistic
 umask 022
 
-# Set up PATH depending on whether we're root or a normal user.
-# There's no real reason to exclude sbin paths from the normal user,
-# but it can make tab-completion easier when they aren't in the
-# user's PATH to pollute the executable namespace.
-#
-# It is intentional in the following line to use || instead of -o.
-# This way the evaluation can be short-circuited and calling whoami is
-# avoided.
-if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
-       PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
-else
-       PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
-fi
-export PATH
-unset ROOTPATH
+# Setup the default path.
+path_front /{bin,sbin} /usr/{bin,sbin} /usr/local/{bin,sbin} $HOME/bin
 
 shopts=$-
 setopt nullglob
@@ -39,3 +26,9 @@ done
 unsetopt nullglob
 set -$shopts
 unset sh shopts
+
+# Setup colours
+eval `dircolors --sh /etc/DIR_COLORS`
+if [[ -n "$LS_COLORS" && -z "$COLORTERM" ]]; then
+       export COLORTERM="ansi"
+fi