improved todo alias by changing it into a function

This commit is contained in:
PowerUser64 2021-09-15 02:58:25 -07:00
parent a4d31650c5
commit f0af0f67b8

10
.zshrc
View file

@ -1,7 +1,7 @@
#!/bin/zsh #!/bin/zsh
# Blake's ZSH config file # Blake's ZSH config file
# vim:fdm=marker:fmr=>>>,<<<:expandtab:sw=3 # vim:fdm=marker:fmr=>>>,<<<:et:ft=zsh:sw=3
### Basic shell configuration >>> ### Basic shell configuration >>>
### Environment variables >>> ### Environment variables >>>
@ -87,7 +87,6 @@
alias \ alias \
nvc="(cd ~/.config/nvim && nvim)" \ nvc="(cd ~/.config/nvim && nvim)" \
zshrc="$EDITOR ~/.zshrc" \ zshrc="$EDITOR ~/.zshrc" \
todo="$EDITOR ~/todo" \
fstab="sudo $EDITOR /etc/fstab" \ fstab="sudo $EDITOR /etc/fstab" \
# Git cLONE # Git cLONE
@ -157,6 +156,13 @@
done done
} }
# an improved way to manage the todo list
todo() {
cd "$(dirname "$(realpath ~/todo)")"
test -d .git || git rev-parse --git-dir > /dev/null 2>&1 && echo 'pulling repository' && git pull
"$EDITOR" ~/todo
}
# Simple extraction script. Taken from manjaro's .bashrc # Simple extraction script. Taken from manjaro's .bashrc
ex() { ex() {
if [ -f $1 ] ; then if [ -f $1 ] ; then