mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-13 23:31:08 +02:00
moved from ./Functions/Misc/pushd
This commit is contained in:
parent
533a5b583c
commit
6937dcd394
1 changed files with 13 additions and 0 deletions
13
Functions/Example/pushd
Normal file
13
Functions/Example/pushd
Normal file
|
@ -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
|
Loading…
Reference in a new issue