From 93e76b9e8da827c226c10a099f6290d41e0511ab Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 3 Jun 2012 20:45:53 -0400 Subject: [PATCH] [#149] Move compdef calls into their own files --- modules/utility/functions/_cdls_popdls_pushdls | 12 ++++++++++++ modules/utility/functions/_mkdcd | 14 ++++++++++++++ modules/utility/init.zsh | 4 ---- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 modules/utility/functions/_cdls_popdls_pushdls create mode 100644 modules/utility/functions/_mkdcd diff --git a/modules/utility/functions/_cdls_popdls_pushdls b/modules/utility/functions/_cdls_popdls_pushdls new file mode 100644 index 0000000..58f7cce --- /dev/null +++ b/modules/utility/functions/_cdls_popdls_pushdls @@ -0,0 +1,12 @@ +#compdef cdls popdls pushdls +#autoload + +# +# Completes cdls, popdls, and pushdls. +# +# Authors: +# Sorin Ionescu +# + +_cd + diff --git a/modules/utility/functions/_mkdcd b/modules/utility/functions/_mkdcd new file mode 100644 index 0000000..8191237 --- /dev/null +++ b/modules/utility/functions/_mkdcd @@ -0,0 +1,14 @@ +#compdef mkdcd +#autoload + +# +# Completes mkdcd. +# +# Authors: +# Sorin Ionescu +# + +_wanted directories expl \ + 'parent directory (alternatively specify name of directory)' \ + _path_files -/ || _message 'name of directory' + diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index ae5b914..bcd9a58 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -126,25 +126,21 @@ alias pmine='ps -U "$USER" -o pid,%cpu,%mem,command' function mkdcd { [[ -n "$1" ]] && mkdir -p "$1" && builtin cd "$1" } -compdef '_path_files -/' mkdcd 2> /dev/null # Changes to a directory and lists its contents. function cdls { builtin cd "$argv[-1]" && ls "${(@)argv[1,-2]}" } -compdef _cd cdls 2> /dev/null # Pushes an entry onto the directory stack and lists its contents. function pushdls { builtin pushd "$argv[-1]" && ls "${(@)argv[1,-2]}" } -compdef _cd pushdls 2> /dev/null # Pops an entry off the directory stack and lists its contents. function popdls { builtin popd "$argv[-1]" && ls "${(@)argv[1,-2]}" } -compdef _cd popdls 2> /dev/null # Prints columns 1 2 3 ... n. function slit {