commit
178bce287e
9 changed files with 122 additions and 7 deletions
@ -0,0 +1,18 @@ |
|||||||
|
_git_remote_branch() { |
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null) |
||||||
|
if [[ -n $ref ]]; then |
||||||
|
if (( CURRENT == 2 )); then |
||||||
|
# first arg: operation |
||||||
|
compadd create publish rename delete track |
||||||
|
elif (( CURRENT == 3 )); then |
||||||
|
# second arg: remote branch name |
||||||
|
compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"` |
||||||
|
elif (( CURRENT == 4 )); then |
||||||
|
# third arg: remote name |
||||||
|
compadd `git remote` |
||||||
|
fi |
||||||
|
else; |
||||||
|
_files |
||||||
|
fi |
||||||
|
} |
||||||
|
compdef _git_remote_branch grb |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
alias h='history' |
||||||
|
|
||||||
|
function hs |
||||||
|
{ |
||||||
|
history | grep $* |
||||||
|
} |
||||||
|
|
||||||
|
alias hsi='hs -i' |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
# symfony basic command completion |
||||||
|
|
||||||
|
_symfony_get_command_list () { |
||||||
|
./symfony | sed "1,/Available tasks/d" | awk 'BEGIN { cat=null; } /^[A-Za-z]+$/ { cat = $1; } /^ :[a-z]+/ { print cat $1; }' |
||||||
|
} |
||||||
|
|
||||||
|
_symfony () { |
||||||
|
if [ -f symfony ]; then |
||||||
|
compadd `_symfony_get_command_list` |
||||||
|
fi |
||||||
|
} |
||||||
|
|
||||||
|
compdef _symfony symfony |
||||||
Loading…
Reference in new issue