Last active
July 6, 2018 01:17
-
-
Save astrsk-hori/6d034a36851569a40b54118ccb9bf9a9 to your computer and use it in GitHub Desktop.
todo (use peco)
This file contains hidden or 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
| alias tcl="cat ~/.todo_history|nl" | |
| alias tl="cat ~/.todo|nl" | |
| alias te="vim ~/.todo" | |
| alias td="remove-todo" | |
| function remove-todo() { | |
| TARGET=$(tl|peco) | |
| NUM=$(echo $TARGET|cut -f1|tr -d ' ') | |
| cat ~/.todo|sed -e "${NUM}d" >~/.todo_tmp | |
| rm ~/.todo | |
| mv ~/.todo_tmp ~/.todo | |
| BK=$(echo $TARGET|cut -f2) | |
| COMPDATE=$(date '+%F %T') | |
| echo "${COMPDATE} ${BK}" >> ~/.todo_history | |
| echo $TARGET | |
| echo "上記TODOを削除しました。" | |
| tl | |
| } | |
| alias ta="add-todo" | |
| function add-todo() { | |
| if [ "$*" = "" ];then | |
| echo "Please Input todo!" | |
| else | |
| echo "$*" >> ~/.todo | |
| tl | |
| fi | |
| } | |
| function remove-todo-by-no() { | |
| NUM=$1 | |
| if [ "$NUM" = "" ];then | |
| echo "Please Input todo Number!" | |
| else | |
| cat ~/.todo|sed -e "${NUM}d" >~/.todo_tmp | |
| rm ~/.todo | |
| mv ~/.todo_tmp ~/.todo | |
| fi | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
terminal で使う簡易TODO
tltodoのリスト表示tatodoの追加tetodoの修正tdtodoの完了(削除)tcl完了したtodoの一覧