diff options
| author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-02 12:27:06 +0000 |
|---|---|---|
| committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-02 12:27:06 +0000 |
| commit | 6937dcd394e74163c3651a88b79d35c65cc935e1 (patch) | |
| tree | 27bfb923775eaa09935afef9487fe303843790df /Functions/Example/pushd | |
| parent | moved to ./Functions/Example/pushd (diff) | |
| download | zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.tar zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.tar.gz zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.tar.bz2 zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.tar.lz zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.tar.xz zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.tar.zst zsh-6937dcd394e74163c3651a88b79d35c65cc935e1.zip | |
moved from ./Functions/Misc/pushd
Diffstat (limited to 'Functions/Example/pushd')
| -rw-r--r-- | Functions/Example/pushd | 13 |
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 |
