Created
January 14, 2013 01:50
-
-
Save jondeandres/4527242 to your computer and use it in GitHub Desktop.
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
export PROJECTS=~/wuaki/ | |
function cs { | |
local dest current | |
mkdir -p "$PROJECTS" | |
cd "$PROJECTS/$1" | |
} | |
function _cs_scandir | |
{ | |
local base ext | |
base=$1 | |
if [ -d $base ]; then | |
for d in `ls $base`; do | |
if [ -d $base/$d ]; then | |
dirs="$dirs $d" | |
fi | |
done | |
fi | |
} | |
function _cs() | |
{ | |
local cur dirs | |
_cs_scandir "$PROJECTS" | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
COMPREPLY=( $(compgen -W "${dirs}" -- ${cur}) ) | |
} | |
complete -F _cs cs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This file is taken and modified from the KDE project. You can use it with zsh if you write this in your .zshrc: