diff --git a/completion b/completion index ce74009..e107bd9 100644 --- a/completion +++ b/completion @@ -21,3 +21,13 @@ complete -F cmpt_newp newp # done # } # complete -F cmpt_prj prj + +source ~/dev/script.download/git-completion.bash +__git_complete g git + +cmpt_cs(){ + for opt in `ls ~/dev/cheat-sheet`; do + COMPREPLY+=("$opt") + done +} +complete -F cmpt_cs cs diff --git a/cs b/cs new file mode 100755 index 0000000..daad84a --- /dev/null +++ b/cs @@ -0,0 +1,20 @@ +#!/bin/bash + + +if [[ $1 = "-l" ]]; then + ls ~/dev/cheat-sheet + exit +fi +if [[ $1 = "-ln" ]]; then + ln -s ~/dev/cheat-sheet/$2 $3 + exit +fi +if [[ $1 = "-h" ]]; then + echo "cs -h : affiche commande" + echo "cs : ouvre le cheat-sheet ou le crée s'il n'exite pas" + echo "cs -l : affiche liste cheat sheet" + echo "cs -ln : crée un lien symbolique du cheat-sheet nommé lien" + exit +fi + +nvim ~/dev/cheat-sheet/$1