Search for the latest file by name, not by modification date

This commit is contained in:
Ivan R. 2023-03-13 00:33:11 +05:00
parent 9c9acf9e83
commit 1f5af6af73
No known key found for this signature in database
GPG key ID: 56C7BAAE859B302C

View file

@ -52,7 +52,7 @@ function list {
# Open last note
function last {
_check_editor
LAST_FILE=$(ls -t $BASE_DIR/**/**/* | head -1)
LAST_FILE=$(find $BASE_DIR -type f -name "*.md" | tail -1)
cd $BASE_DIR
$EDITOR $LAST_FILE
cd - > /dev/null