DTERC(5)

๐Ÿ“ฆ
version 1.10 ยท 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

dterc(5) โ€” the manual page for the command + config language of dte(1) ๐Ÿ’–

File Formats Manual โœจ DTERC(5)


๐ŸŒธ NAME ๐ŸŒธ

dterc โ€” the command and configuration language that dte(1) speaks, bestie ๐Ÿ’…


โœจ SYNOPSIS โœจ

Okay so here's literally every command, grouped by vibe. Copy-paste responsibly ๐Ÿซถ

Commands:

Configuration Commands:
   alias name command
   bind key [command]
   set [-gl] option [value] ...
   setenv name [value]
   hi [-c] name [fg-color [bg-color]] [attribute]...
   ft [-b|-c|-f|-i] filetype string...
   option [-r] filetype option value...
   include [-bq] file
   errorfmt [-i] compiler regexp [file|line|column|message|_]...
   load-syntax filename|filetype

Editor Commands:
   quit [-f|-p] [exitcode]
   suspend
   cd directory
   command [text]
   search [-Hnprw] [pattern]
   refresh

Buffer Management Commands:
   open [-g|-t] [-e encoding] [filename]...
   save [-fp] [-d|-u] [-b|-B] [-e encoding] [filename]
   close [-qw] [-f|-p]
   next
   prev
   view N|last
   move-tab N|left|right

Window Management Commands:
   wsplit [-bghnrt] [filename]...
   wclose [-f|-p]
   wnext
   wprev
   wresize [-h|-v] [N|+N|-- -N]
   wflip
   wswap

Movement Commands:
   left [-c]
   right [-c]
   up [-c|-l]
   down [-c|-l]
   pgup [-c|-l]
   pgdown [-c|-l]
   blkup [-c|-l]
   blkdown [-c|-l]
   word-fwd [-cs]
   word-bwd [-cs]
   bol [-cs]
   eol [-c]
   bof
   eof
   bolsf
   eolsf
   scroll-up
   scroll-down
   scroll-pgup
   scroll-pgdown
   center-view
   match-bracket
   line number
   tag [-r] [tag]
   msg [-n|-p]

Editing Commands:
   cut
   copy [-k]
   paste [-c]
   undo
   redo [choice]
   clear
   join
   new-line
   delete
   erase
   delete-eol [-n]
   erase-bol
   delete-word [-s]
   erase-word [-s]
   delete-line
   case [-l|-u]
   insert [-km] text
   replace [-bcgi] pattern replacement
   shift count
   wrap-paragraph [width]
   select [-bkl]
   unselect

External Commands:
   filter [-l] command [parameter]...
   pipe-from [-ms] command [parameter]...
   pipe-to [-l] command [parameter]...
   run [-ps] command [parameters]...
   compile [-1ps] errorfmt command [parameters]...
   eval command [parameter]...
   exec-open [-s] command [parameter]...
   exec-tag [-s] command [parameter]...

Other Commands:
   repeat count command [parameters]...
   toggle [-gv] option [values]...
   show [-c] type [key]
   macro action

Options:

Global options:
   case-sensitive-search [true]
   display-invisible [false]
   display-special [false]
   esc-timeout [100] 0...2000
   filesize-limit [250]
   lock-files [true]
   newline [unix]
   select-cursor-char [true]
   scroll-margin [0]
   set-window-title [false]
   show-line-numbers [false]
   statusline-left [" %f%s%m%r%s%M"]
   statusline-right [" %y,%X %u %E%s%b%s%n %t %p "]
   tab-bar [true]
   utf8-bom [false]

Local options:
   brace-indent [false]
   filetype [none]
   indent-regex [""]

Local and global options:
   auto-indent [true]
   detect-indent [""]
   emulate-tab [false]
   expand-tab [false]
   file-history [true]
   indent-width [8]
   syntax [true]
   tab-width [8]
   text-width [72]
   ws-error [special]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So dterc is the language that dte(1) uses in its config files (~/.dte/rc) and in command mode inside the editor (Alt+x). The syntax is lowkey similar to shell, but way simpler โ€” no cap ๐Ÿ’…

Commands get separated either by a newline or a ; character. Wanna make a command stretch across multiple lines in an rc file? Escape the newline, bestie โ€” put \ at the end of the line โœจ

Rc files can have comments at the start of a line. Comments start with a # character and can be indented, but they can't be put on the same line as a command โ€” that's not the vibe.

Commands can contain environment variables. Variables always expand into a single argument even if they contain whitespace. But variables inside single or double quotes are NOT expanded ๐Ÿ‘€. This is actually iconic because it means you can bind keys to commands that contain variables (inside single or double quotes), and those get expanded right before the command runs.

Example:

alias x "run chmod 755 $FILE"

So $FILE expands when the alias x gets executed. And the command still works even if $FILE contains whitespace. slay ๐ŸŽ€


๐Ÿ’œ Special variables ๐Ÿ’œ

These variables are always defined and they override environment variables with the same name. main character energy fr fr.

  • $FILE โ€” the filename of the current buffer (or an empty string if it's unsaved).
  • $FILETYPE โ€” the value of the filetype option for the current buffer.
  • $LINENO โ€” the line number of the cursor in the current buffer.
  • $WORD โ€” the selected text, or the word under the cursor.
  • $DTE_HOME โ€” the user configuration directory. This is either the value of $DTE_HOME when the editor first started, or the default value ($HOME/.dte).

๐ŸŽ€ Single quoted strings ๐ŸŽ€

Single quoted strings can't contain single quotes or escaped characters. That's it, that's the whole rule ๐Ÿ’€


๐ŸŒˆ Double quoted strings ๐ŸŒˆ

Double quoted strings may contain the following escapes:

  • \a, \b, \t, \n, \v, \f, \r โ€” control characters (same as in C)
  • \e โ€” escape character
  • \\ โ€” backslash
  • \" โ€” double quote
  • \x0a โ€” hexadecimal byte value 0x0a. Note that \x00 is not supported because strings are NUL-terminated ๐Ÿ™ˆ
  • \u20ac โ€” four hex digit Unicode code point U+20AC
  • \U000020ac โ€” eight hex digit Unicode code point U+20AC

๐Ÿ‘‘ COMMANDS ๐Ÿ‘‘

๐Ÿงš Configuration Commands ๐Ÿงš

Configuration commands are how you customize aspects of the editor โ€” adding key bindings, setting options, etc. And listen: these are the only commands allowed in user config files. periodt.


alias name command

Creates an alias name for command.

Example:

alias read 'pipe-from cat'

Now you can run read file.txt to insert file.txt into the current buffer. obsessed ๐Ÿ˜ญ๐Ÿ’–


bind key [command]

Binds command to key. If no command is given, then any existing binding for key is removed. bye bestie ๐Ÿ‘‹

Special keys:

  • left
  • right
  • up
  • down
  • insert
  • delete
  • home
  • end
  • pgup
  • pgdown
  • begin (keypad "5" with Num Lock off)
  • enter
  • tab
  • space
  • F1..F12

Modifiers:

  • Ctrl: C-X or ^X
  • Alt: M-X
  • Shift: S-left

set [-gl] option [value] ...

Sets value for option. For a boolean option you can just omit the value and it sets it to true โœจ. You can set multiple options at once, but then a value must be given for every option.

There are three kinds of options.

  1. Global options.
  2. Local options. These are file specific options. Each open file has its own copies of the option values.
  3. Options that have both global and local values. The global value is just a default local value for opened files and is never used for anything else. Changing the global value does not affect any already opened files.

By default set changes both global and local values.

  • -g โ€” change only the global option value
  • -l โ€” change only the local option value of the current file

In configuration files only global options can be set (no need to specify the -g flag).

See also: toggle and option commands.


setenv name [value]

Set (or unset) an environment variable. ๐Ÿซถ


hi [-c] name [fg-color [bg-color]] [attribute]...

Set highlight color. โœจ

The name argument can be a token name defined by a dte-syntax(5) file, or one of the following built-in highlight names:

  • default
  • nontext
  • noline
  • wserror
  • selection
  • currentline
  • linenumber
  • statusline
  • commandline
  • errormsg
  • infomsg
  • tabbar
  • activetab
  • inactivetab
  • dialog

The fg-color and bg-color arguments can be one of the following:

  • No value (equivalent to default)
  • A numeric value between -2 and 255
  • A 256-color palette value in R/G/B notation (e.g. 0/3/5)
  • A true color value in CSS-style #RRGGBB notation (e.g. #ab90df)
  • keep (-2)
  • default (-1)
  • black (0)
  • red (1)
  • green (2)
  • yellow (3)
  • blue (4)
  • magenta (5)
  • cyan (6)
  • gray (7)
  • darkgray (8)
  • lightred (9)
  • lightgreen (10)
  • lightyellow (11)
  • lightblue (12)
  • lightmagenta (13)
  • lightcyan (14)
  • white (15)

Colors 16 to 231 correspond to R/G/B colors. Colors 232 to 255 are grayscale values.

If the terminal has limited support for rendering colors, the fg-color and bg-color arguments will fall back to the nearest supported color (unless the -c flag is used).

The attribute argument(s) can be any combination of the following:

  • bold
  • dim
  • italic
  • underline
  • strikethrough
  • blink
  • reverse
  • invisible
  • keep

The color and attribute value keep is useful in selected text to keep fg-color and attributes and change only bg-color. ๐Ÿ’…

NOTE: Because keep is both a color and an attribute, you need to specify both fg-color and bg-color if you want to set the keep attribute.

Unset fg/bg colors are inherited from highlight color default. If you don't set fg/bg for the highlight color default, then the terminal's default fg/bg is used.

  • -c โ€” do nothing at all if the terminal can't display fg-color and/or bg-color with full precision

ft [-b|-c|-f|-i] filetype string...

Add a filetype association. Filetypes are used to determine which syntax highlighter and local options to use when opening files. ๐Ÿ”ฅ

By default string is interpreted as one or more filename extensions.

  • -b โ€” interpret string as a file basename
  • -c โ€” treat string as a regex(7) pattern and match it against the contents of the first line of the file ๐Ÿ’…
  • -f โ€” treat string as a regex(7) pattern and match it against the full (absolute) filename ๐Ÿ—‚๏ธ
  • -i โ€” treat string as a command interpreter name and match it against the Unix shebang line (after stripping any path prefix and/or version suffix) ๐Ÿ

Examples, fr fr โ€” copy these exactly:

ft c c h
ft -b make Makefile GNUmakefile
ft -c xml '<\?xml'
ft -f mail '/tmpmsg-.*\.txt$'
ft -i lua lua luajit

Also go peep:

  • The option command (right below this ๐Ÿ‘‡)
  • The filetype option (also below ๐Ÿ‘‡)
  • The dte-syntax(5) man page

option [-r] filetype option value...

Adds an automatic option for a filetype (one you already registered with the ft command up there โฌ†๏ธ). Automatic options get set whenever files are opened. Set it and forget it, bestie โœจ

  • -r โ€” interpret the filetype argument as a regex(7) pattern instead of a filetype, and match it against full filenames

include [-bq] file

Read and execute commands from file.

  • -b โ€” read a built-in file instead of reading from the filesystem ๐Ÿ“ฆ
  • -q โ€” don't show an error message if file doesn't exist (shhh, it's fine ๐Ÿ™ˆ)
Note: "built-in files" are config files bundled right into the program binary. See the -B and -b flags in the dte(1) man page for the deets.

errorfmt [-i] compiler regexp [file|line|column|message|_]...

Registers a regex(7) pattern for later use with the compile command.

When compile is invoked with a specific compiler name, the regexp pattern(s) you previously registered under that name get used to parse messages out of that program's output.

Your regexp pattern should contain as many capture groups as there are extra arguments. Those capture groups are what parse the file, line, message, etc. out of the output and โ€” if possible โ€” jump you straight to the corresponding file position. Wanna use parentheses in the regexp but not capture them? Just use _ as the extra argument. ๐ŸŽฏ

Run errorfmt multiple times with the same compiler name and each regexp gets appended to a list. When you run compile, the entries in that list are checked for a match in the exact order they were added.

For a basic example of how this works, go look at the output of dte -b compiler/go.

  • -i โ€” ignore this error ๐Ÿ™…โ€โ™€๏ธ

load-syntax filename|filetype

Loads a dte-syntax(5) file into the editor. If the argument contains a / character, it's treated as a filename.

Note: this command only loads a syntax file, ready for later. To actually apply a syntax highlighter to the current buffer, use the set command to change the buffer's filetype instead โ€” e.g. set filetype html. That's the one that does the thing, bestie ๐Ÿ’…

๐ŸŒธ Editor Commands ๐ŸŒธ

quit [-f|-p] [exitcode]

Quits the editor. Bye bestie ๐Ÿ‘‹

The exit status of the process is set to exitcode, which can be anywhere in the range 0..125, or defaults to 0 if you don't specify one.

  • -f โ€” force quit, even if there are unsaved files ๐Ÿ˜ค
  • -p โ€” prompt for confirmation if there are unsaved files

suspend

Suspends the editor (run fg in the shell to resume it). Nap time ๐Ÿ˜ด

cd directory

Changes the working directory and updates $PWD and $OLDPWD. Running cd - changes to the previous directory ($OLDPWD). Classic.

command [text]

Enter command mode. If text is given, it gets written to the command line (see the default ^L key binding for why this is useful ๐Ÿ‘€).

search [-Hnprw] [pattern]

If there are no flags, or just -r, and no pattern given, then dte switches to search mode where you can type a regular expression to search. Type that regex, queen ๐Ÿ”

  • -H โ€” don't add pattern to search history
  • -n โ€” search next
  • -p โ€” search previous
  • -r โ€” start searching backwards
  • -w โ€” search the word under the cursor

refresh

Triggers a full redraw of the screen. Blink blink โœจ


๐ŸŽ€ Buffer Management Commands ๐ŸŽ€

open [-g|-t] [-e encoding] [filename]...

Opens a file. If filename is omitted, a brand new file gets opened. Fresh start energy ๐Ÿฆ‹

  • -e encoding โ€” set the file encoding. Run iconv -l for the list of supported encodings.
  • -g โ€” perform glob(7) expansion on filename.
  • -t โ€” mark the buffer as "temporary" (always closeable, no warnings about "unsaved changes") ๐Ÿ’€

save [-fp] [-d|-u] [-b|-B] [-e encoding] [filename]

Saves the current buffer. Protect it at all costs ๐Ÿซถ

  • -b โ€” write a byte order mark (BOM)
  • -B โ€” don't write a byte order mark
  • -d โ€” save with DOS/CRLF line-endings
  • -f โ€” force saving a read-only file
  • -u โ€” save with Unix/LF line-endings
  • -p โ€” open a command prompt if there's no specified or existing filename
  • -e encoding โ€” set the file encoding. Run iconv -l for the list of supported encodings.

See also: the newline and utf8-bom global options ๐Ÿ‘‘

close [-qw] [-f|-p]

Closes a file.

  • -f โ€” force close the file, even if it has unsaved changes ๐Ÿ˜ฌ
  • -p โ€” prompt for confirmation if the file has unsaved changes
  • -q โ€” quit if you're closing the last open file
  • -w โ€” close the parent window if you're closing its last contained file

next

Displays the next file.

prev

Displays the previous file.

view N|last

Displays the Nth or last open file.

move-tab N|left|right

Moves the current tab to position N, or 1 position left or right. Rearranging, we love to see it ๐Ÿ’…


๐Ÿฆ‹ Window Management Commands ๐Ÿฆ‹

wsplit [-bghnrt] [filename]...

Splits the current window. More screen real estate, more main character energy ๐Ÿ‘‘

filename arguments get opened in a manner similar to the open command. If there are no arguments, the contents of the new window will be an additional view of the current buffer.

  • -b โ€” add the new window before the current one instead of after
  • -g โ€” perform glob(7) expansion on filename
  • -h โ€” split horizontally instead of vertically
  • -n โ€” create a new, empty buffer
  • -r โ€” split the root instead of the current window
  • -t โ€” mark the buffer as "temporary" (always closeable, no warnings about "unsaved changes")

wclose [-f|-p]

Closes a window.

  • -f โ€” force close the window, even if it contains unsaved files ๐Ÿ˜ญ
  • -p โ€” prompt for confirmation if there are unsaved files in the window

wnext

Next window.

wprev

Previous window.

wresize [-h|-v] [N|+N|-- -N]

If no parameter is given, equalizes window sizes in the current frame. Balance restored ๐Ÿง˜โ€โ™€๏ธ

  • -h โ€” resize horizontally
  • -v โ€” resize vertically
  • N โ€” set the size of the current window to N characters.
  • +N โ€” increase the size of the current window by N characters.
  • -N โ€” decrease the size of the current window by N characters. Use -- to stop the minus symbol from being parsed as an option flag, e.g. wresize -- -5.

wflip

Changes from a vertical layout to a horizontal one, and vice versa. Flip it ๐Ÿ”„

wswap

Swaps the positions of this frame and the next one.


๐Ÿงš Movement Commands ๐Ÿงš

Movement commands are what you use to move the cursor around, bestie.

Several of these commands also have -c and -l flags, which let you create character/line selections. Those 2 flags are noted in the command summaries below, but they only get described once, right here:

  • -c โ€” select characters
  • -l โ€” select whole lines

left [-c]

Moves one column left.

right [-c]

Moves one column right.

up [-c|-l]

Moves one line up.

down [-c|-l]

Moves one line down.

pgup [-c|-l]

Moves one page up.

pgdown [-c|-l]

Moves one page down.

blkup [-c|-l]

Moves one block up.

Note: a "block", in this context, is kind of like a paragraph. Blocks are delimited by one or more blank lines.

blkdown [-c|-l]

Moves one block down.

word-fwd [-cs]

Moves forward one word.

  • -s โ€” skip special characters

word-bwd [-cs]

Moves backward one word.

  • -s โ€” skip special characters

bol [-cs]

Moves to the beginning of the current line.

  • -s โ€” move to the beginning of indented text or the beginning of the line, depending on the current cursor position.

eol [-c]

Moves to the end of the current line.

bof

Moves to the beginning of the file.

eof

Moves to the end of the file.

bolsf

Incrementally moves to the beginning of the line, then the beginning of the screen, then the beginning of the file. Escalating ๐Ÿ˜ค

eolsf

Incrementally moves to the end of the line, then the end of the screen, then the end of the file.

scroll-up

Scrolls the view up one line. Keeps the cursor position unchanged if possible.

scroll-down

Scrolls the view down one line. Keeps the cursor position unchanged if possible.

scroll-pgup

Scrolls one page up. The cursor position relative to the top of the screen is maintained. See also pgup.

scroll-pgdown

Scrolls one page down. The cursor position relative to the top of the screen is maintained. See also pgdown.

center-view

Centers the view on the cursor. Self-care for your eyeballs ๐Ÿ’–

match-bracket

Moves to the bracket character paired with the one under the cursor. The character under the cursor should be one of {}[]()<>.

line number

Goes to the line.

tag [-r] [tag]

Saves the current location and jumps to the location of tag. If no tag argument is specified, the word under the cursor is used instead.

This command needs a tags file generated by ctags(1). tags files are searched for in the current working directory and its parent directories.

  • -r โ€” jump back to the previous location โ†ฉ๏ธ

See also: the msg command.

msg [-n|-p]

Shows the latest, next (-n) or previous (-p) message. If its location is known (a compile error or a tag message) then the file gets opened and the cursor moved to that location.

  • -n โ€” next message
  • -p โ€” previous message

See also: the compile and tag commands.


๐Ÿ’œ Editing Commands ๐Ÿ’œ

cut

Cuts the current line or selection. Snip snip โœ‚๏ธ

copy [-k]

Copies the current line or selection.

  • -k โ€” keep the selection (by default, selections are lost after copying) ๐Ÿ™ˆ

paste [-c]

Pastes text previously copied by the copy or cut commands.

  • -c โ€” Paste at the cursor position, even when the text was copied as a whole-line selection (where the usual default is to paste at the start of the next line). Lowkey clutch when you wanna paste right where you're at, not on the next line. ๐Ÿ’…

undo ๐Ÿ’–

Undo latest change. No cap, it's the ultimate rewind button, bestie. Just hit it and watch your last change vanish. โœจ

redo [choice] ๐Ÿ”

Redo changes done by the undo command. If there are multiple possibilities a message is displayed:

Redoing newest (2) of 2 possible changes.

If the change was not the one you wanted, just run undo and then, for example, redo 1. It's giving time travel, but make it precise.

clear ๐Ÿงผ

Clear current line. Wipe it clean, like it never happened.

join ๐Ÿ”—

Join selection or next line to current. Merge them together, bestie.

new-line โœจ

Insert empty line under current line. Fresh space, who dis?

delete โŒ

Delete character after cursor (or selection). Poof, gone.

erase ๐Ÿงฝ

Delete character before cursor (or selection). Backspace energy, but make it fancy.

delete-eol [-n] ๐Ÿ—‘๏ธ

Delete to end of line.

  • -n โ€” Delete newline if cursor is at end of line

erase-bol โฌ…๏ธ

Erase to beginning of line. Back it up, back it up.

delete-word [-s] โœ‚๏ธ

Delete word after cursor.

  • -s โ€” Be more "aggressive"

erase-word [-s] ๐Ÿงน

Erase word before cursor.

  • -s โ€” Be more "aggressive"

delete-line ๐Ÿšฎ

Delete current line. Bye bye, whole line.

case [-l|-u] ๐Ÿ” 

Change text case. The default is to change lower case to upper case and vice versa. It's giving flip-flop realness.

  • -l โ€” Lower case
  • -u โ€” Upper case

insert [-km] text ๐Ÿ“ฅ

Insert text into the buffer.

  • -k โ€” Insert one character at a time, as if manually typed. Normally text is inserted exactly as specified, but this option allows it to be affected by special input handling like auto-indents, whitespace trimming, line-by-line undo, etc.
  • -m โ€” Move after inserted text

replace [-bcgi] pattern replacement ๐Ÿ”„

Replace all instances of text matching pattern with the replacement text. Glow up your text, bestie.

The pattern argument is a POSIX extended regex(7).

The replacement argument is treated like a template and may contain several, special substitutions:

  • Backslash sequences \1 through \9 are replaced by sub-strings that were "captured" (via parentheses) in the pattern.
  • The special character & is replaced by the full string that was matched by pattern.
  • Literal \ and & characters can be inserted in replacement by escaping them (as \\ and \&).
  • All other characters in replacement represent themselves.
Note: extra care must be taken when using double quotes for the pattern argument, since double quoted arguments have their own (higher precedence) backslash sequences.
  • -b โ€” Use basic instead of extended regex syntax
  • -c โ€” Ask for confirmation before each replacement
  • -g โ€” Replace all matches for each line (instead of just the first)
  • -i โ€” Ignore case

Examples:

replace 'Hello World' '& (Hallo Welt)'
replace "[ \t]+$" ''
replace -cg '([^ ]+) +([^ ]+)' '\2 \1'

shift count ๐Ÿ“

Shift current or selected lines by count indentation levels. Count is usually -1 (decrease indent) or 1 (increase indent).

To specify a negative number, it's necessary to first disable option parsing with --, e.g. shift -- -1.

wrap-paragraph [width] ๐Ÿ“

Format the current selection or paragraph under the cursor. If paragraph width is not given then the text-width option is used.

This command merges the selection into one paragraph. To format multiple paragraphs use the external fmt(1) program with the filter command, e.g. filter fmt -w 60.

select [-bkl] ๐Ÿ–ฑ๏ธ

Enter selection mode. All movement commands while in this mode extend the selected area.

Note: A better way to create selections is to hold the Shift key whilst moving the cursor. The select command exists mostly as a fallback, for terminals with limited key binding support.
  • -b โ€” Select block between opening { and closing } curly braces
  • -k โ€” Keep existing selections
  • -l โ€” Select whole lines

unselect ๐Ÿšซ

Unselect. Deselect, bestie. Let it go.


External Commands ๐ŸŒ

filter [-l] command [parameter]... ๐Ÿงน

Filter selected text or whole file through external command.

Example:

filter sort -r

Note that command is executed directly using execvp(3). To use shell features like pipes or redirection, use a shell interpreter as the command. For example:

filter sh -c 'tr a-z A-Z | sed s/foo/bar/'
  • -l โ€” Operate on current line instead of whole file, if there's no selection

pipe-from [-ms] command [parameter]... ๐Ÿ“ฅ

Run external command and insert its standard output.

  • -m โ€” Move after the inserted text
  • -s โ€” Strip newline from end of output

pipe-to [-l] command [parameter]... ๐Ÿ“ค

Run external command and pipe the selected text (or whole file) to its standard input.

Can be used to e.g. write text to the system clipboard:

pipe-to xsel -b
  • -l โ€” Operate on current line instead of whole file, if there's no selection

run [-ps] command [parameters]... ๐Ÿƒ

Run external command.

  • -p โ€” Display "Press any key to continue" prompt
  • -s โ€” Silent -- both stderr(3) and stdout(3) are redirected to /dev/null

compile [-1ps] errorfmt command [parameters]... ๐Ÿ”จ

Run external command and collect output messages. This can be used to run e.g. compilers, build systems, code search utilities, etc. and then jump to a file/line position for each message.

The errorfmt argument corresponds to a regex capture pattern previously specified by the errorfmt command. After command exits successfully, parsed messages can be navigated using the msg command.

  • -1 โ€” Read error messages from stdout instead of stderr
  • -p โ€” Display "Press any key to continue" prompt
  • -s โ€” Silent. Both stderr(3) and stdout(3) are redirected to /dev/null

See also: errorfmt and msg commands.

eval command [parameter]... ๐Ÿง 

Run external command and execute its standard output text as dterc commands. It's like inception, but for commands.

exec-open [-s] command [parameter]... ๐Ÿ“‚

Run external command and open all filenames listed on its standard output.

  • -s โ€” Don't yield terminal control to the child process

Example uses:

exec-open -s find . -type f -name *.h
exec-open -s git ls-files --modified
exec-open fzf -m --reverse

exec-tag [-s] command [parameter]... ๐Ÿท๏ธ

Run external command and then execute the tag command with its first line of standard output as the argument.

  • -s โ€” Don't yield terminal control to the child process

Example uses:

exec-tag -s echo main
exec-tag sh -c 'readtags -l | cut -f1 | sort | uniq | fzf --reverse'

Other Commands ๐ŸŽ€

repeat count command [parameters]... ๐Ÿ”

Run command count times. Loop it, bestie.

toggle [-gv] option [values]... ๐ŸŽš๏ธ

Toggle option. If list of values is not given then the option must be either boolean or enum.

  • -g โ€” toggle global option instead of local
  • -v โ€” display new value

If option has both local and global values then local is toggled unless -g is used.

show [-c] type [key] ๐Ÿ“Š

Display current values for various configurable types.

The type argument can be one of:

  • alias โ€” Show command aliases
  • bind โ€” Show key bindings
  • color โ€” Show highlight colors
  • command โ€” Show command history
  • env โ€” Show environment variables
  • errorfmt โ€” Show compiler error formats
  • ft โ€” Show filetype associations
  • include โ€” Show built-in configs
  • macro โ€” Show last recorded macro
  • option โ€” Show option values
  • search โ€” Show search history
  • wsplit โ€” Show window dimensions

The key argument is the name of the entry to look up (e.g. the alias name). If this argument is omitted, the full list of entries of the specified type will be displayed in a new buffer.

  • -c โ€” write value to command line (if possible)

macro action ๐ŸŽฅ

Record and replay command macros.

The action argument can be one of:

  • record โ€” Begin recording
  • stop โ€” Stop recording
  • toggle โ€” Toggle recording on/off
  • cancel โ€” Stop recording, without overwriting the previous macro
  • play โ€” Replay the previously recorded macro

Once a macro has been recorded, it can be viewed in text form by running show macro.

โœจ OPTIONS โœจ

okay bestie, options are literally the lil control panel of dte, and you change them with the set command. Enumerated options can also be toggled. Wanna see which ones are enumerated? Type toggle in command mode and press the tab key (yes, keep that space after toggle ๐Ÿ’…). You can also use the option command to set default options for specific file types.

๐ŸŒ Global options

  • case-sensitive-search [true] โ€” controls how search vibes with letter case.
    • false โ€” Search is case-insensitive.
    • true โ€” Search is case-sensitive.
    • auto โ€” If the search string contains an uppercase letter, search is case-sensitive; otherwise it is case-insensitive.
  • display-invisible [false] โ€” Display invisible characters.
  • display-special [false] โ€” Display special characters.
  • esc-timeout [100] 0...2000 โ€” When a single escape is read from the terminal, dte waits some time before treating the escape as a single keypress. The timeout value is in milliseconds.
Too long timeout makes the escape key feel slow, and too small timeout can cause escape sequences of, for example, arrow keys to be split and treated as multiple key presses. ๐Ÿ˜ญ
  • filesize-limit [250] โ€” Refuse to open any file with a size larger than this value (in mebibytes). Useful to prevent accidentally opening very large files, which can take a long time on some systems.
  • lock-files [true] โ€” Keep a record of open files, so that a warning can be shown if the same file is accidentally opened in multiple dte processes.

See also: the FILES section in the dte(1) man page.

  • newline [unix] โ€” Whether to use LF (unix) or CRLF (dos) line-endings in newly created files.

Note: buffers opened from existing files will have their newline type detected automatically.

  • select-cursor-char [true] โ€” Whether to include the character under the cursor in selections.
  • scroll-margin [0] โ€” Minimum number of lines to keep visible before and after cursor.
  • set-window-title [false] โ€” Set the window title to the filename of the current buffer (if the terminal supports it).
  • show-line-numbers [false] โ€” Show line numbers.
  • statusline-left [" %f%s%m%r%s%M"] โ€” Format string for the left aligned part of the status line.
    • %f โ€” Filename.
    • %m โ€” Prints * if file has been modified since last save.
    • %r โ€” Prints RO for read-only buffers or TMP for temporary buffers.
    • %y โ€” Cursor row.
    • %Y โ€” Total rows in file.
    • %x โ€” Cursor display column.
    • %X โ€” Cursor column as characters. If it differs from cursor display column then both are shown (e.g. 2-9).
    • %p โ€” Position in percentage.
    • %E โ€” File encoding.
    • %M โ€” Miscellaneous status information.
    • %n โ€” Line-ending (LF or CRLF).
    • %N โ€” Line-ending (only if CRLF).
    • %s โ€” Separator (a single space, unless the preceding format character expanded to an empty string).
    • %S โ€” Like %s, but 3 spaces instead of 1.
    • %t โ€” File type.
    • %u โ€” Hexadecimal Unicode value of character under cursor.
    • %% โ€” Literal %.
  • statusline-right [" %y,%X %u %E%s%b%s%n %t %p "] โ€” Format string for the right aligned part of the status line.
  • tab-bar [true] โ€” Whether to show the tab-bar at the top of each window.
  • utf8-bom [false] โ€” Whether to write a byte order mark (BOM) in newly created UTF-8 files.

Note: buffers opened from existing UTF-8 files will have their BOM (or lack thereof) preserved as it was, unless overridden by the save command.

๐Ÿ“ Local options

  • brace-indent [false] โ€” Scan for { and } characters when calculating indentation size. Depends on the auto-indent option.
  • filetype [none] โ€” Type of file. Value must be previously registered using the ft command.
  • indent-regex [""] โ€” If this regex(7) pattern matches the current line when enter is pressed and auto-indent is true, then indentation is increased. Set to "" to disable.

๐ŸŒ Local and global options

The global values for these options serve as the default values for local (per-file) options.

  • auto-indent [true] โ€” Automatically insert indentation when pressing enter. Indentation is copied from the previous non-empty line. If also the indent-regex local option is set, then indentation is automatically increased if the regular expression matches the current line.
  • detect-indent [""] โ€” Comma-separated list of indent widths (1-8) to detect automatically when a file is opened. Set to "" to disable. Tab indentation is detected if the value is not "". Adjusts the following options if indentation style is detected: emulate-tab, expand-tab, indent-width.

Example: set detect-indent 2,3,4,8

  • emulate-tab [false] โ€” Make delete, erase and moving left and right inside indentation feel as if there were tabs instead of spaces.
  • expand-tab [false] โ€” Convert tab to spaces on insert.
  • file-history [true] โ€” Save and restore cursor positions for previously opened files.

See also: the FILES section in the dte(1) man page.

  • indent-width [8] โ€” Size of indentation in spaces.
  • syntax [true] โ€” Use syntax highlighting.
  • tab-width [8] โ€” Width of tab. Recommended value is 8. If you use other indentation size than 8 you should use spaces to indent.
  • text-width [72] โ€” Preferred width of text. Used as the default argument for the wrap-paragraph command.
  • ws-error [special] โ€” Comma-separated list of flags that describe which whitespace errors should be highlighted. Set to "" to disable.
    • auto-indent โ€” If the expand-tab option is enabled then this is the same as tab-after-indent,tab-indent. Otherwise it's the same as space-indent.
    • space-align โ€” Highlight spaces used for alignment after tab indents as errors.
    • space-indent โ€” Highlight space indents as errors. Note that this still allows using less than tab-width spaces at the end of indentation for alignment.
    • tab-after-indent โ€” Highlight tabs used anywhere other than indentation as errors.
    • tab-indent โ€” Highlight tabs in indentation as errors. If you set this you most likely want to set "tab-after-indent" too.
    • special โ€” Display all characters that look like regular space as errors. One of these characters is no-break space (U+00A0), which is often accidentally typed (AltGr+space in some keyboard layouts).
    • trailing โ€” Highlight trailing whitespace characters at the end of lines as errors.

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

dte(1), dte-syntax(5)

โœ๏ธ AUTHORS โœ๏ธ

Craig Barnes Timo Hirvonen


and that's the whole vibe, bestie ๐Ÿ’– this page's footer says March 2021 and its page/source tag is DTERC(5) โ€” iconic, official, and now you know it. slay โœจ

๐Ÿ“ฆ where this page comes from