deft icon indicating copy to clipboard operation
deft copied to clipboard

Append date to a string title in the filenaming rules

Open olegbc1 opened this issue 7 years ago • 8 comments

How would I go about getting deft to name files something like 2018-3-1-[custom title].txt?

Thanks!

olegbc1 avatar Mar 01 '18 20:03 olegbc1

I don't think that's possible at present. You can either use deft-new-file-format, which is a date/time format string like "%Y-%m-%d", which would achieve part of what you want, or you can use deft-use-filter-string-for-filename to take "custom title" from the filter string, but not both at once. I'll put this down as a feature request.

jrblevin avatar Mar 01 '18 20:03 jrblevin

Yep, that's what I've been playing with. Thank you for considering this as a feature request!

olegbc1 avatar Mar 01 '18 20:03 olegbc1

Just to add - it may be worthwhile to let Deft save new files in specified directories as well. Maybe use note name as directory and date as file name etc.

I'll see if this can be accomplished with dired

olegbc1 avatar Mar 02 '18 07:03 olegbc1

I would also find this useful. I create note files in the format 20180409-SOME-FILENAME.md so I can look back and find something by date or topic.

rphillips avatar Apr 09 '18 15:04 rphillips

I would also find this useful

jonjnicholson avatar Mar 29 '20 20:03 jonjnicholson

I've created a package that does this by providing an exstention to deft. Actually, it does a whole lot more, as it attempts to create a sort of Zettelkasten type of notetaking system, by giving notes unique IDs (based on their date of creation). These unique IDs then allow links between notes, even as their titles change.

Check it out here: https://github.com/efls/zetteldeft (and read the documentation for a more extensive introduction).

To be clear: this is not a replacement of deft, but really building on top of it.

EFLS avatar Mar 29 '20 20:03 EFLS

@EFLS I tried your package, and I think it's perfect for what I want. Unfortunately, I kept getting duplicate titles in the files. I'm using the default doom emacs deft config, and I tried for quite awhile before giving up for now. I'll try again when I have time.

jonjnicholson avatar Apr 01 '20 13:04 jonjnicholson

@jonjnicholson With doom there is indeed an issue with duplicate #+TITLE: lines that I haven't been able to fully trace because I don't use doom myself. More info here https://github.com/EFLS/zetteldeft/issues/26

EFLS avatar Apr 01 '20 13:04 EFLS