summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-11-22 12:52:49 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-11-22 12:52:49 +0100
commit06c5e2becdfd9293aa8d90d3e517ef1f03ac653c (patch)
tree48e649e75fca3b2666c8cb92650aa10a0b9b8cbb /etc/functions
parent9fc91f8ca80c4dd8b109350d01e4a26993dcb71e (diff)
make the zshrc work without packages/zsh/etc
Diffstat (limited to 'etc/functions')
-rw-r--r--etc/functions/chpwd6
-rw-r--r--etc/functions/dirinfo19
-rw-r--r--etc/functions/salias37
-rw-r--r--etc/functions/xhashd7
-rw-r--r--etc/functions/xsource22
5 files changed, 0 insertions, 91 deletions
diff --git a/etc/functions/chpwd b/etc/functions/chpwd
deleted file mode 100644
index e950844..0000000
--- a/etc/functions/chpwd
+++ /dev/null
@@ -1,6 +0,0 @@
-## vim:ft=zsh
-
-# This all belongs into the prompt, but since it only changes
-# when changing directories, it's more efficient to do it here
-psvar[1]=$(dirinfo)
-psvar[2]=$(rtab)
diff --git a/etc/functions/dirinfo b/etc/functions/dirinfo
deleted file mode 100644
index 689c20f..0000000
--- a/etc/functions/dirinfo
+++ /dev/null
@@ -1,19 +0,0 @@
-## vim:ft=zsh
-## Collect some directory information for the prompt
-
-typeset string
-
-[[ -r .todo ]] && string+='todo '
-[[ -f .fehindex.jpg ]] && string+='feh '
-[[ -d .hg ]] && string+='hg '
-[[ -d .git ]] && string+='git '
-[[ -d .svn ]] && string+='svn '
-[[ -f Makefile || -f makefile ]] && string+='make '
-
-# if we're running in screen, we're the only one writing into the prompt
-# -> no trailing whitespace
-if [[ $TERM == screen ]] {
- echo ${string% }
-} else {
- echo $string
-}
diff --git a/etc/functions/salias b/etc/functions/salias
deleted file mode 100644
index d8a3340..0000000
--- a/etc/functions/salias
+++ /dev/null
@@ -1,37 +0,0 @@
-## vim:ft=zsh
-## creates an alias and precedes the command with sudo if $EUID is not zero.
-## Taken from the grml zshrc - http://grml.org
-local only=0
-local multi=0
-while [[ ${1} == -* ]] ; do
- case ${1} in
- (-o) only=1 ;;
- (-a) multi=1 ;;
- (--) shift ; break ;;
- (-h)
- printf 'usage: salias [-h|-o|-a] <alias-expression>\n'
- printf ' -h shows this help text.\n'
- printf ' -a replace '\'' ; '\'' sequences with '\'' ; sudo '\''.\n'
- printf ' be careful using this option.\n'
- printf ' -o only sets an alias if a preceding sudo would be needed.\n'
- return 0
- ;;
- (*) printf "unkown option: '%s'\n" "${1}" ; return 1 ;;
- esac
- shift
-done
-
-if (( ${#argv} > 1 )) ; then
- printf 'Too many arguments %s\n' "${#argv}"
- return 1
-fi
-
-key="${1%%\=*}" ; val="${1#*\=}"
-if (( EUID == 0 )) && (( only == 0 )); then
- alias -- "${key}=${val}"
-elif (( EUID > 0 )) ; then
- (( multi > 0 )) && val="${val// ; / ; sudo }"
- alias -- "${key}=sudo ${val}"
-fi
-
-return 0
diff --git a/etc/functions/xhashd b/etc/functions/xhashd
deleted file mode 100644
index 2909ea7..0000000
--- a/etc/functions/xhashd
+++ /dev/null
@@ -1,7 +0,0 @@
-## vim:ft=zsh
-## hash a directory if it exists
-typeset directory=${~1#*\=} name=${1%%\=*}
-
-if [[ -d $directory ]] {
- hash -d $name=$directory
-}
diff --git a/etc/functions/xsource b/etc/functions/xsource
deleted file mode 100644
index 50ad5be..0000000
--- a/etc/functions/xsource
+++ /dev/null
@@ -1,22 +0,0 @@
-## vim:ft=zsh
-# Note: This function's behaviour differs hrom source.
-# With source, parameters declared local are available to the sourcing script.
-# With xsource, parameters declared local will NOT be available unless you use
-# eval $(xsource -e file)
-typeset -i eval=0
-
-while [[ $1 == -* ]] {
- case $1 in
- -e) eval=1 ;;
- esac
- shift
-}
-
-
-if [[ -r $1 ]] {
- if (( eval )) {
- echo source $1
- } else {
- source $1
- }
-}