Skip to content

Commit

Permalink
[sorin-ionescu#149] Move compdef calls into their own files
Browse files Browse the repository at this point in the history
  • Loading branch information
RIT80 authored and RIT80 committed Jun 11, 2012
1 parent afbccbf commit 17d40e9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
12 changes: 12 additions & 0 deletions modules/utility/functions/_cdls_popdls_pushdls
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#compdef cdls popdls pushdls
#autoload

#
# Completes cdls, popdls, and pushdls.
#
# Authors:
# Sorin Ionescu <[email protected]>
#

_cd

14 changes: 14 additions & 0 deletions modules/utility/functions/_mkdcd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#compdef mkdcd
#autoload

#
# Completes mkdcd.
#
# Authors:
# Sorin Ionescu <[email protected]>
#

_wanted directories expl \
'parent directory (alternatively specify name of directory)' \
_path_files -/ || _message 'name of directory'

4 changes: 0 additions & 4 deletions modules/utility/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 17d40e9

Please sign in to comment.