mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-18 21:14:11 +01:00
moved from ./Functions/Misc/pushd
This commit is contained in:
parent
533a5b583c
commit
6937dcd394
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 New Issue
Block a user