Created
February 9, 2012 04:37
-
-
Save hakobe/1777331 to your computer and use it in GitHub Desktop.
Hatena-Project zsh completion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function h { | |
cd ~/work/hatena/$1 | |
} | |
function _h { | |
local allfiles | |
local -a _projects _others | |
allfiles=`find ~/work/hatena/* -type d -maxdepth 0 -exec basename '{}' ';'` | |
_projects=( $(echo $allfiles | grep '^Hatena-' | sed -e 's/^Hatena-//') ) | |
_describe -t projects "Projects" _projects -P Hatena- | |
_others=( $(echo $allfiles | grep -v '^Hatena-') ) | |
_describe -t others "Others" _others | |
return 1; | |
} | |
compdef _h h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment