diff options
author | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-04-03 15:27:49 +0100 |
---|---|---|
committer | Matthew Lemon <chaffinach+git@protonmail.ch> | 2022-04-03 15:27:49 +0100 |
commit | 1f237d1ed24279b595489d02a37d4ef61a71cd8b (patch) | |
tree | c6a6d5cc2701f71114f9d9dfd1bccd7f4fc99b95 | |
parent | a5471c6471564d66fef1b9fd1db2bbb4c4f5a14a (diff) |
basic lem script and revised batnote to include two new zet dirs
-rwxr-xr-x | batnote | 12 | ||||
-rwxr-xr-x | lem | 14 |
2 files changed, 23 insertions, 3 deletions
@@ -7,8 +7,16 @@ NOTES=/home/$USER/Notes FZF_BIN=/home/$USER/.fzf/bin/fzf BAT=/usr/bin/bat LESS=/usr/bin/less +VIM=/usr/bin/vim + CMD=$LESS +# instead of viewing with less, we want to edit in Vim +if [[ $1 = "-v" ]] +then + CMD=$VIM +fi + # if [[ -z $1 ]]; then # echo "You must provide a file name as the argument to this command." # exit 1 @@ -24,6 +32,8 @@ fi if [[ -x $BAT ]]; then CMD=$BAT fi -$CMD "$(find $NOTES|$FZF_BIN)" +# Thanks to https://stackoverflow.com/a/1489405 for the find command to omit .git +$CMD "$(find $NOTES -name '.git*' -type d -prune -o -type f -print|$FZF_BIN)" + @@ -1,11 +1,21 @@ #!/bin/bash NOTES=/home/$USER/Notes -MOD_NOTES=$NOTES/mod +TARGET_DIR=$NOTES/homezet VIM=/usr/bin/vim +if [[ "$1" = "-m" ]]; then + msg="${*:2}" + TARGET_DIR=$NOTES/modzet + shift +else + msg="$@" + shift +fi + + STAMP="$(date +%G%m%d%H%M%S)" -F_PATH="$MOD_NOTES/$STAMP - $@.md" +F_PATH="$TARGET_DIR/$STAMP-$msg.md" echo $F_PATH $VIM "$F_PATH" |