Skip to content

Basic usage

Darren Li edited this page Oct 13, 2025 · 10 revisions

Restrict file extensions

The set of files for multiline search mode and single line search mode are separate.

For example, the following restricts multiline search mode files to just markdown files in the current directory. But since we have not reset the single line mode files, if there are any, say, csv files present, they would also be captured:

$ docfd --exts md

To really restrict to just markdown files, do:

$ docfd --exts md --single-line-exts ""

Include additional file extensions

$ docfd --add-exts sql --single-line-add-exts debug-log

Globbing

Alternatively, since using --glob prevents Docfd from defaulting to scanning ., we can do the following to recursively grab all markdown files without considering --exts and --single-line-exts:

$ docfd --glob '**.md'

or add \c anywhere in the string for case-insensitive match just in case of inconsistent casing of file extension, e.g. Md, MD.

$ docfd --glob '**.md\c'

See File collection rules for details on how the combination of file collection related command line arguments affect overall behavior.

Resolution of relative globs starts at current working directory.

Scan for files then select with fzf

$ docfd [PATH]... ?

The ? can be in any position in the path list. If any of the path is ?, then file selection of the discovered files via fzf is invoked.

Read from piped stdin

$ command | docfd

No paths should be supplied as arguments in this case. If any paths are specified, then stdin is ignored.

Filtering files

TODO

Using list of paths from file

$ docfd [PATH]... --paths-from paths.txt

The final list of paths used is then the concatenation of PATHs and paths listed in paths.txt, which has one path per line.

Redo/undo command

In Docfd, most UI interactions are mapped to a command. This includes search and filter.

To undo the last command, press u, Ctrl+Z or Left arrow

To redo the command, press Ctrl+R, Ctrl+Y or Right arrow

Clone this wiki locally