Daf (Hebrew דף — "sheet/page") is a simple console text editor written in C.
Three built-in 256-color themes: dark (default), light, and mono (the
original reverse-video/underline look, for terminals or tastes that don't
want real colors). Resolved in this order:
--theme=NAMEon the command line- the
DAF_THEMEenvironment variable theme=NAMEin the config file ($XDG_CONFIG_HOME/daf/config, or~/.config/daf/config) —#starts a comment- the build-time default (
meson configure -Ddefault_theme=NAME)
The config file's own location can be changed at build time too, with
meson configure -Dconfig_subpath=....
Any --theme=NAME (or DAF_THEME, or config theme=) that isn't
dark/light/mono is looked up as a file at
$XDG_CONFIG_HOME/daf/themes/NAME.conf (or
~/.config/daf/themes/NAME.conf — directory changeable at build time via
meson configure -Dtheme_dir_subpath=...). It's key=value lines, each
value a 256-color palette index as fg or fg,bg:
# ~/.config/daf/themes/mytheme.conf
base=dark # start from a built-in theme; defaults to dark
selection=196,231 # override just the roles you want
Unset roles are inherited from base. Available roles: normal, gutter,
gutter_current (the current line's line-number digit), selection,
search_match, status_bar, tilde.
Built with Meson:
meson setup build
ninja -C buildThe binary is produced at build/src/daf.
Run the test suite with:
meson test -C buildbuild/src/daf [file]If no file is given, the editor opens an empty, unnamed buffer.
| Keys | Action |
|---|---|
| Arrows | Move the cursor |
| Shift + arrows/Home/End/PgUp/PgDn | Select text |
| Home | Smart jump to start of line |
| End | Jump to end of line |
| Tab / Shift-Tab | Insert tab / indent or dedent the selection |
| Ctrl-S | Save (prompts for a name if the file is new) |
| Ctrl-Q | Quit (press again to discard unsaved changes) |
| Ctrl-F | Find: all matches are highlighted with a count in the prompt; Ctrl-F again jumps to the next match (wraps around), Enter confirms, Esc cancels |
| Ctrl-G | Jump to a line number (Enter jumps, Esc cancels) |
| Ctrl-R | Search & replace: type the search text, Enter, then the replacement text, Enter to replace every match at once (Esc cancels either step) |
| Ctrl-Z / Ctrl-Y | Undo / redo |
| Ctrl-C / Ctrl-X | Copy / cut the selection (also pushed to the system clipboard) |
| Ctrl-V | Paste the internal clipboard |
| Backspace / Delete | Delete a character or the selection |
| Esc | Clear the selection |
Enter also auto-indents: a new line inherits the current line's leading whitespace.
GNU GPL 3.0.