UP | HOME

Deft create new file with custom name

When using deft, by default, it will create a new file with a name in the format of YYYY-dd-mm-something.md, this doesn't fit my workflow well.

We can fix this by adding these configs:

(setq deft-default-extension "org")
(setq deft-text-mode 'org-mode)
(setq deft-use-filter-string-for-filename t)

First, we set the default mode for note files to org, then, deft-use-filter-string-for-filename will help us create a new file using the search string.

From now, I can create a new note by typing:

deft: emacs/deft-create-new-file-with-custom-name <RET>

It must be better to have a custom function for this, so I can programmatically replace every space to dash characters, for a more freedom UX.

Date: 2019-01-18 Fri 00:00

Author: Huy Tran

Created: 2019-04-22 Mon 14:41