ajout cheat-sheet + completeion
This commit is contained in:
parent
4b585ed852
commit
2f70a014be
10
completion
10
completion
|
@ -21,3 +21,13 @@ complete -F cmpt_newp newp
|
||||||
# done
|
# done
|
||||||
# }
|
# }
|
||||||
# complete -F cmpt_prj prj
|
# 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
|
||||||
|
|
|
@ -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 <cheat-sheet> : ouvre le cheat-sheet ou le crée s'il n'exite pas"
|
||||||
|
echo "cs -l : affiche liste cheat sheet"
|
||||||
|
echo "cs -ln <cheat-sheet> <lien> : crée un lien symbolique du cheat-sheet nommé lien"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
nvim ~/dev/cheat-sheet/$1
|
Loading…
Reference in New Issue