From b0a149076fc39ff2707279c2246744378643c0d5 Mon Sep 17 00:00:00 2001 From: Ben Klein Date: Sat, 16 Jun 2018 20:35:41 -0400 Subject: [PATCH] Allow arguments to `d` to be passed to dirs Replace the alias with a function. Call `dirs` if arguments are given to `d`. --- lib/directories.zsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/directories.zsh b/lib/directories.zsh index 14064b86f..355c442d2 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -21,7 +21,14 @@ alias 9='cd -9' alias md='mkdir -p' alias rd=rmdir -alias d='dirs -v | head -10' +function d () { + if [[ -n $1 ]]; then + dirs "$@" + else + dirs -v | head -10 + fi +} +compdef _dirs d # List directory contents alias lsa='ls -lah'