File: pushd

package info (click to toggle)
zsh30 3.0.8-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,156 kB
  • ctags: 3,242
  • sloc: ansic: 36,445; sh: 3,125; makefile: 592; perl: 330; awk: 158; sed: 6
file content (13 lines) | stat: -rw-r--r-- 329 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
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