From 0fae37be4147e16af6a33f97596c7c667e3e9f40 Mon Sep 17 00:00:00 2001 From: Fredrik Wallgren Date: Mon, 24 Feb 2014 19:25:18 +0100 Subject: [PATCH] Update c function --- bash/functions.sh | 11 ++++------- sublime/User/Package Control.last-run | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bash/functions.sh b/bash/functions.sh index 967fb9c..aedad1d 100644 --- a/bash/functions.sh +++ b/bash/functions.sh @@ -1,16 +1,13 @@ # Jump to code - c() { cd ~/gitrepositories/$1; } _c() { - local cur - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" + local cur=${COMP_WORDS[COMP_CWORD]} - local tags=$(for t in `ls ~/gitrepositories | \ - awk '{print $1}'`; do echo ${t}; done) - COMPREPLY=($(compgen -W "${tags}" $cur)) + COMPREPLY=($(cd ~/gitrepositories; compgen -o dirnames -S '/' -f -- $cur)) } +complete -o nospace -F _c c + complete -F _c c # Create a new directory and enter it diff --git a/sublime/User/Package Control.last-run b/sublime/User/Package Control.last-run index 4f01b93..81093ef 100644 --- a/sublime/User/Package Control.last-run +++ b/sublime/User/Package Control.last-run @@ -1 +1 @@ -1393181634 \ No newline at end of file +1393266244 \ No newline at end of file