1
0
Fork 0

[#149] Move compdef calls into their own files

pull/174/merge
Sorin Ionescu 13 years ago
parent fdb3f4152f
commit 93e76b9e8d

@ -0,0 +1,12 @@
#compdef cdls popdls pushdls
#autoload
#
# Completes cdls, popdls, and pushdls.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
_cd

@ -0,0 +1,14 @@
#compdef mkdcd
#autoload
#
# Completes mkdcd.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
_wanted directories expl \
'parent directory (alternatively specify name of directory)' \
_path_files -/ || _message 'name of directory'

@ -126,25 +126,21 @@ alias pmine='ps -U "$USER" -o pid,%cpu,%mem,command'
function mkdcd { function mkdcd {
[[ -n "$1" ]] && mkdir -p "$1" && builtin cd "$1" [[ -n "$1" ]] && mkdir -p "$1" && builtin cd "$1"
} }
compdef '_path_files -/' mkdcd 2> /dev/null
# Changes to a directory and lists its contents. # Changes to a directory and lists its contents.
function cdls { function cdls {
builtin cd "$argv[-1]" && ls "${(@)argv[1,-2]}" 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. # Pushes an entry onto the directory stack and lists its contents.
function pushdls { function pushdls {
builtin pushd "$argv[-1]" && ls "${(@)argv[1,-2]}" 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. # Pops an entry off the directory stack and lists its contents.
function popdls { function popdls {
builtin popd "$argv[-1]" && ls "${(@)argv[1,-2]}" builtin popd "$argv[-1]" && ls "${(@)argv[1,-2]}"
} }
compdef _cd popdls 2> /dev/null
# Prints columns 1 2 3 ... n. # Prints columns 1 2 3 ... n.
function slit { function slit {

Loading…
Cancel
Save