Defile provides tools to embed metadata in file names, namely IDs and
tags. File names are formatted as follows, with []
indicating
optional fields:
[ID--]TITLE[__TAG1_TAG2][.EXT]
The main benefits of this format are:
- An alternative to a directory hierarchy. In many cases, it doesn’t
make sense to distinguish
tag1/tag2/title
fromtag2/tag1/title
. - An unchanging ID for links, currently used by the “defile” Org link format.
Some unfortunate downsides are:
- File name lengths are limited, which then limits the length of the ID and tags.
- A long ID or lots of tags make the file name ugly.
The main features Defile provides are:
- Renaming files with special completion (
defile-rename-file
,defile-dired-do-rename
). - A file for adding descriptions to tags, which are shown when
completing a tag (
defile-tag-file
). - Renaming a tag, which renames all files with that tag
(
defile-rename-tags
). - An Org link format “defile” (accessible from
org-store-link
andorg-insert-link
).
Defile was largely inspired by Denote. Some major similarities and differences:
- By default, denote and defile share the same
ID--TITLE__TAGS.ext
format. - The ID in Denote is a ISO 8601 timestamp. It can be anything in Defile.
- Denote has many features for working with plain-text notes. Defile does not.
If you include denote-directory
in your defile-lookup-path
, your
Denote notes will be included as Defile files. For example, Defile
tag completions will include Denote tags.
Using elpaca and elpaca-use-package-mode
:
(use-package defile
:ensure ( defile :type git :host github
:repo "nick4f42/defile.el" :depth nil)
:init
(with-eval-after-load 'dired
(add-hook 'dired-mode-hook #'defile-dired-mode))
:config
(setopt defile-lookup-path '("~/Documents")))