improved todo alias by changing it into a function

This commit is contained in:
PowerUser64 2021-09-15 02:58:25 -07:00
parent 6f2a76ffdf
commit c322f4899f

10
.zshrc
View file

@ -1,7 +1,7 @@
#!/bin/zsh
# Blake's ZSH config file
# vim:fdm=marker:fmr=>>>,<<<:expandtab:sw=3
# vim:fdm=marker:fmr=>>>,<<<:et:ft=zsh:sw=3
### Basic shell configuration >>>
### Environment variables >>>
@ -87,7 +87,6 @@
alias \
nvc="(cd ~/.config/nvim && nvim)" \
zshrc="$EDITOR ~/.zshrc" \
todo="$EDITOR ~/todo" \
fstab="sudo $EDITOR /etc/fstab" \
# Git cLONE
@ -157,6 +156,13 @@
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
ex() {
if [ -f $1 ] ; then