From fcd7cd1cfa2ba286f4bf73da7a60116cd3912629 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 8 Jun 1999 09:26:01 +0000 Subject: Initial revision --- Functions/Misc/pushd | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Functions/Misc/pushd (limited to 'Functions/Misc/pushd') diff --git a/Functions/Misc/pushd b/Functions/Misc/pushd new file mode 100644 index 000000000..965c774bf --- /dev/null +++ b/Functions/Misc/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 -- cgit v1.2.3-70-g09d2