about summary refs log tree commit diff
path: root/Functions/Example/pushd
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 12:27:06 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 12:27:06 +0000
commit6937dcd394e74163c3651a88b79d35c65cc935e1 (patch)
tree27bfb923775eaa09935afef9487fe303843790df /Functions/Example/pushd
parent533a5b583c833b5a335f6173c6b52b26f6016fb6 (diff)
downloadzsh-6937dcd394e74163c3651a88b79d35c65cc935e1.tar.gz
zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.tar.xz
zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.zip
moved from ./Functions/Misc/pushd
Diffstat (limited to 'Functions/Example/pushd')
-rw-r--r--Functions/Example/pushd13
1 files changed, 13 insertions, 0 deletions
diff --git a/Functions/Example/pushd b/Functions/Example/pushd
new file mode 100644
index 000000000..965c774bf
--- /dev/null
+++ b/Functions/Example/pushd
@@ -0,0 +1,13 @@
+# pushd function to emulate the old zsh behaviour.  With this function
+# pushd +/-n just lifts the selected element to the top of the stack
+# instead of just cycling the stack.
+
+emulate -R zsh
+setopt localoptions
+
+if [[ ARGC -eq 1 && "$1" == [+-]<-> ]] then
+	setopt pushdignoredups
+	builtin pushd ~$1
+else
+	builtin pushd "$@"
+fi