Skip to content

Commit

Permalink
Add tcsh completion
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Oct 5, 2012
1 parent 2dac5b2 commit 715a90f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .cshrc
Expand Up @@ -151,3 +151,19 @@ foreach cmd ( `tpope aliases` )
alias $cmd "tpope $cmd"
end
# }}}1
# Completion {{{1

if ( $?tcsh ) then
if ( -f /etc/complete.tcsh ) source /etc/complete.tcsh
set hosts=(localhost `tpope host list`)
alias _extract_subcommands 'grep "^ [a-z-]*[|)]" \!*|sed -e "s/) .*//"|tr "|" " "'
complete tpope 'p@1@`_extract_subcommands "$HOME/bin/tpope"`@' \
'n@host@`_extract_subcommands $HOME/bin/tpope-host`@' 'N/host/$hosts/' \
'n@config@`_extract_subcommands $HOME/bin/tpope-config`@' 'N/config/$hosts/' \
'n/*/f/'
foreach cmd ( start stop restart reload force-reload status )
complete $cmd 'p@1@`(cd /etc/init.d; echo *)`@'
end
endif

# }}}1

0 comments on commit 715a90f

Please sign in to comment.