Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
DTERC(5)		       File Formats Manual			DTERC(5)

NAME
     dterc - Command and configuration language used by dte(1)

SYNOPSIS
     Commands:

     Configuration Commands:
	alias name [command]
	bind [-cns] 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 [-Hr] [-n|-p|-w|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 [-bghr] [-n|-t|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 [-c] [-s|-t]
	eol [-c]
	bof [-c|-l]
	eof [-c|-l]
	bolsf [-c|-l]
	eolsf [-c|-l]
	scroll-up
	scroll-down
	scroll-pgup
	scroll-pgdown
	center-view
	match-bracket
	line lineno[,colno]
	bookmark [-r]
	tag [-r|tag]
	msg [-n|-p|number]

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

     External Commands:
	exec [-pstmn] [-ioe action]... command [parameter]...
	compile [-1ps] errorfmt command [parameters]...

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

     Options:

     Global options:
	case-sensitive-search [true]
	display-special [false]
	esc-timeout [100] 0...2000
	filesize-limit [250]
	lock-files [true]
	newline [unix]
	optimize-true-color [true]
	select-cursor-char [true]
	scroll-margin [0]
	set-window-title [false]
	show-line-numbers [false]
	statusline-left [" %f%s%m%s%r%s%M"]
	statusline-right [" %y,%X %u %o %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]
	overwrite [false]
	syntax [true]
	tab-width [8]
	text-width [72]
	ws-error [special]

DESCRIPTION
     dterc  is	the  language used in dte(1) configuration files (~/.dte/rc) and
     also in the command mode of the editor (Alt+x). The syntax of the	language
     is quite similar to shell, but much simpler.

     Commands  are  separated either by a newline or ; character. To make a com-
     mand span multiple lines in an rc file, escape the newline (put  \  at  the
     end of the line).

     Rc files can contain comments at the start of a line. Comments begin with a
     #	character and can be indented, but they can't be put on the same line as
     a command.

     Commands can contain environment variables. Variables always expand into  a
     single argument even if they contain whitespace. Variables inside single or
     double quotes are NOT expanded. This makes it possible to bind keys to com-
     mands  that  contain variables (inside single or double quotes), which will
     be expanded just before the command is executed.

     Example:

	    alias x "run chmod 755 $FILE"

     $FILE is expanded when the alias x is executed. The command works	even  if
     $FILE contains whitespace.

   Special variables
     These  variables  are  always defined and override environment variables of
     the same name.

     $FILE
	    The absolute filename of the current buffer (or an empty  string  if
	    unsaved).

     $RFILE
	    The  relative  filename of the current buffer (or an empty string if
	    unsaved).

     $FILEDIR
	    The directory part of $FILE.

     $FILETYPE
	    The value of the filetype option for the current buffer.

     $LINENO
	    The line number of the cursor in the current buffer.

     $COLNO
	    The column 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.

   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,  be-
	    cause strings are null-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 used to customize certain aspects of the editor,
     for  example  adding key bindings, setting options, etc. These are the only
     commands allowed in user config files.

     alias name [command]
	    Create an alias name for command. If no command is	given  then  any
	    existing alias for name is removed.

	    Aliases can be used in command mode or bound to keys, just as normal
	    commands  can.  When aliases are used in place of commands, they are
	    first recursively expanded (to allow aliases of aliases) and any ad-
	    ditional arguments are then added to the end of  the  expanded  com-
	    mand.

	    For example, if the following alias is created:

		   alias read 'pipe-from cat'

	    this  can then be invoked as read file.txt, which will expand to the
	    command pipe-from cat file.txt and thus cause  file.txt  to  be  in-
	    serted into the current buffer.

     bind [-cns] key [command]
	    Bind  command to key. If no command is given then any existing bind-
	    ing for key is removed.

	    Special keys:

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

	    Modifiers:

	    Ctrl:  C-x (or ^X)

	    Alt:   M-x

	    Shift:
		   S-left

	    Super:
		   s-left

	    Hyper:
		   H-left

	    The key is bound in normal mode by default, unless one  or	more  of
	    the following flags are used:

	    -c	   Add binding for command mode

	    -n	   Add binding for normal mode

	    -s	   Add binding for search mode

	    The  commands  available  in  normal mode are the ones listed in the
	    main sections of this manual.

	    The commands available in command/search modes are as follows:

	    * left
	    * right
	    * word-bwd
	    * word-fwd
	    * bol
	    * eol
	    * delete
	    * delete-word
	    * delete-eol
	    * erase
	    * erase-word
	    * erase-bol
	    * clear
	    * copy [-bip]
	    * paste [-m]
	    * toggle [-g] option [values]...
	    * accept [-eH] - Execute command or perform search
	    * cancel - Return to normal mode
	    * history-next - Find next history item matching current prefix
	    * history-prev - Find previous history item matching current prefix
	    * complete-next - Select next auto-completion in command mode
	    * complete-prev - Select previous auto-completion in command mode
	    * direction - Toggle search direction in search mode

	    Most of these commands behave in a similar	fashion  to  the  normal
	    mode  commands  of	the  same name. The exceptions to this have been
	    given a short description above.

	    Most of the command flags also behave similarly to the  normal  mode
	    equivalents,  except  for  accept -H, which accepts the current text
	    without adding a history entry and	accept	-e  (search  mode  only)
	    which  escapes  all  regex(7) special characters before performing a
	    (plain-text) search.

	    See also:

	    * The "key bindings" section in the dte(1) man page
	    * The show bind command (below)

     set [-gl] option [value] ...
	    Set value for option. Value can be omitted for boolean option to set
	    it true. Multiple options can be set at once but then 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 global option value

	    -l	   Change only local option value of 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) 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 #RRGGBB notation (e.g. #ab90df)
	    * A true color value in #RGB notation (e.g. #1ef)
	    * 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 sup-
	    ported color (unless the -c flag is used; see below).

	    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  at-
	    tribute.

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

	    If hi is run without any arguments, all highlight colors are removed
	    and  a baseline set of defaults is then loaded (as if by running in-
	    clude -b on the built-in color/reset config).

	    -c	   Do nothing at all if  the  terminal	can't  display	fg-color
		   and/or  bg-color with full precision (this can be used to set
		   up tiered color schemes that use the  best  supported  colors
		   automatically)

     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	   Interpret string as a regex(7) pattern and match against  the
		   contents of the first line of the file

	    -f	   Interpret  string as a regex(7) pattern and match against the
		   full (absolute) filename

	    -i	   Interpret string as a  command  interpreter	name  and  match
		   against the Unix shebang line (after removing any path prefix
		   and/or version suffix)

	    Examples:

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

	    See also:

	    * The option command (below)
	    * The filetype option (below)
	    * The dte-syntax(5) man page

     option [-r] filetype option value...
	    Add automatic option for filetype (as previously registered with the
	    ft command). Automatic options are set when files are are opened.

	    -r	   Interpret  filetype argument as a regex(7) pattern instead of
		   a filetype and match against full filenames

     include [-bq] file
	    Read and execute commands from file.

	    -b	   Read built-in file instead of reading from the filesystem

	    -q	   Don't show an error message if file doesn't exist

	    Note: "built-in files" are config files bundled into the program bi-
	    nary.  See the -B and -b flags in the dte(1) man page and  the  show
	    include command for more information.

     errorfmt [-i] compiler [regexp] [file|line|column|message|_]...
	    Register a regex(7) pattern, for later use with the compile command.

	    When  the  compile command is invoked with a specific compiler name,
	    the regexp pattern(s) previously registered with that name are  used
	    to parse messages from it's program output.

	    The  regexp  pattern  should contain as many capture groups as there
	    are extra arguments. These capture groups  are  used  to  parse  the
	    file,  line, message, etc. from the output and, if possible, jump to
	    the corresponding file position. To use parentheses  in  regexp  but
	    ignore the capture, use _ as the extra argument.

	    Running  errorfmt multiple times with the same compiler name appends
	    each regexp to a list. When running  compile,  the	entries  in  the
	    specified  list  are checked for a match in the same order they were
	    added.

	    If only 1 argument (i.e. compiler) is given, all patterns previously
	    added for that compiler name will be removed.

	    For a basic example of usage, see the output of dte -b compiler/go.

	    -i	   Ignore this error

     load-syntax filename|filetype
	    Load a dte-syntax(5) file into the editor. If the argument	contains
	    a / character it's considered a filename.

	    Note:  this command only loads a syntax file ready for later use. To
	    actually apply a syntax highlighter to the current buffer,	use  the
	    set  command to change the filetype of the buffer instead, e.g.  set
	    filetype html.

   Editor Commands
     quit [-f|-p] [exitcode]
	    Quit the editor.

	    The exit status of the process is set to exitcode, which can  be  in
	    the range 0..125, or defaults to 0 if unspecified.

	    -f	   Force quit, even if there are unsaved files

	    -p	   Prompt for confirmation if there are unsaved files

     suspend
	    Suspend the editor (run fg in the shell to resume).

     cd directory
	    Change the working directory and update $PWD and $OLDPWD. Running cd
	    - changes to the previous directory ($OLDPWD).

     command [text]
	    Enter  command mode. If text is given then it is written to the com-
	    mand line (see the default ^L key binding for why this is useful).

     search [-Hr] [-n|-p|-w|pattern]
	    If no flags or just -r and no pattern  given  then	dte  changes  to
	    search mode where you can type a regular expression to search.

	    -H	   Don't add pattern to search history

	    -n	   Search next

	    -p	   Search previous

	    -r	   Start searching backwards

	    -w	   Search word under cursor

     refresh
	    Trigger a full redraw of the screen.

   Buffer Management Commands
     open [-g|-t] [-e encoding] [filename]...
	    Open file. If filename is omitted, a new file is opened.

	    -e encoding
		   Set	file encoding (see iconv -l for list of supported encod-
		   ings)

	    -g	   Perform glob(7) expansion on filename

	    -t	   Mark buffer as "temporary" (always closeable,  without  warn-
		   ings for "unsaved changes")

     save [-fp] [-d|-u] [-b|-B] [-e encoding] [filename]
	    Save current buffer.

	    -b	   Write byte order mark (BOM)

	    -B	   Don't write byte order mark

	    -d	   Save with DOS/CRLF line-endings

	    -f	   Force saving 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 file encoding (see iconv -l for list of supported  encod-
		   ings)

	    See also: newline and utf8-bom global options

     close [-qw] [-f|-p]
	    Close file.

	    -f	   Force close file, even if it has unsaved changes

	    -p	   Prompt for confirmation if the file has unsaved changes

	    -q	   Quit if closing the last open file

	    -w	   Close parent window if closing its last contained file

     next
	    Display next file.

     prev
	    Display previous file.

     view N|last
	    Display Nth or last open file.

     move-tab N|left|right
	    Move current tab to position N or 1 position left or right.

   Window Management Commands
     wsplit [-bghr] [-n|-t|filename...]
	    Split the current window.

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

	    -b	   Add new window before current instead of after

	    -g	   Perform glob(7) expansion on filename

	    -h	   Split horizontally instead of vertically

	    -n	   Create a new, empty buffer

	    -r	   Split root instead of current window

	    -t	   Create a new, empty buffer and mark it as "temporary" (always
		   closeable, without warnings for "unsaved changes")

     wclose [-f|-p]
	    Close window.

	    -f	   Force close 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 given, equalize window sizes in current frame.

	    -h	   Resize horizontally

	    -v	   Resize vertically

	    N	   Set size of current window to N columns/rows

	    +N	   Increase size of current window by N columns/rows

	    -N	   Decrease  size of current window by N columns/rows (use -- to
		   prevent the minus symbol being parsed as an option flag, e.g.
		   wresize -- -5)

     wflip
	    Change from vertical layout to horizontal and vice versa.

     wswap
	    Swap positions of this and next frame.

   Movement Commands
     Movement commands are used to move the cursor position.

     Several of these commands also have -c and -l flags to allow creating char-
     acter/line selections. These 2 flags are noted in the command summaries be-
     low, but are only described once, as follows:

     -c     Select characters

     -l     Select whole lines

     left [-c]
	    Move one column left.

     right [-c]
	    Move one column right.

     up [-c|-l]
	    Move one line up.

     down [-c|-l]
	    Move one line down.

     pgup [-c|-l]
	    Move one page up.

     pgdown [-c|-l]
	    Move one page down.

     blkup [-c|-l]
	    Move one block up.

	    Note: a "block", in this context, is somewhat akin to  a  paragraph.
	    Blocks are delimited by one or more blank lines

     blkdown [-c|-l]
	    Move one block down.

     word-fwd [-cs]
	    Move forward one word.

	    -s	   Skip special characters

     word-bwd [-cs]
	    Move backward one word.

	    -s	   Skip special characters

     bol [-c] [-s|-t]
	    Move to beginning of current line.

	    -s	   Move  to beginning of indented text or beginning of line, de-
		   pending on current cursor position

	    -t	   Like -s, but with the additional behavior of moving back  and
		   forth between the two positions

     eol [-c]
	    Move to end of current line.

     bof [-c|-l]
	    Move to beginning of file.

     eof [-c|-l]
	    Move to end of file.

     bolsf [-c|-l]
	    Incrementally  move  to beginning of line, then beginning of screen,
	    then beginning of file.

     eolsf [-c|-l]
	    Incrementally move to end of line, then end of screen, then  end  of
	    file.

     scroll-up
	    Scroll  view  up one line. Keeps cursor position unchanged if possi-
	    ble.

     scroll-down
	    Scroll view down one line. Keeps cursor position unchanged if possi-
	    ble.

     scroll-pgup
	    Scroll one page up. Cursor position relative to  top  of  screen  is
	    maintained. See also pgup.

     scroll-pgdown
	    Scroll  one  page down. Cursor position relative to top of screen is
	    maintained. See also pgdown.

     center-view
	    Center view to cursor.

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

     line lineno[,colno]
	    Move  the cursor to the line number specified by lineno and (option-
	    ally) the column number specified by colno.  The  delimiter  between
	    the two numbers can either be a comma (,) or a colon (:).

	    Examples:

		   line 19
		   line 20,15
		   line 20:15

     bookmark [-r]
	    Save the current file/cursor location to a stack.

	    -r	   Jump back to the previous location (and pop it off the stack)

     tag [-r|tag]
	    Save the current file/cursor location to a stack and jump to the lo-
	    cation  of tag. If the tag argument is not given, the word under the
	    cursor is used instead (unless -r is used).

	    The location for tag is determined by parsing a tags file  from  the
	    current directory, or any of its parent directories. These files are
	    expected be encoded in ctags(1) format.

	    -r	   Jump back to the previous location (and pop it off the stack)

	    Note:  the saving of the cursor location described above is much the
	    same as running bookmark and tag -r is identical to bookmark -r.

	    See also: msg command.

     msg [-n|-p|number]
	    Display and/or navigate messages, as generated by  the  compile  and
	    tag  commands. If the activated message has an associated file loca-
	    tion, the file will be opened and the cursor moved to the  appropri-
	    ate position.

	    If no -n or -p flag or number argument is given, the current message
	    will be displayed.

	    -n	   Next message

	    -p	   Previous message

   Editing Commands
     cut
	    Cut current line or selection.

     copy [-bikp]
	    Copy current line or selection.

	    -b	   Copy to system clipboard

	    -i	   Copy to internal copy buffer (this is the default, if no -bip
		   flags are used)

	    -k	   Keep  selection  (by default, selections are lost after copy-
		   ing)

	    -p	   Copy to system "primary selection"

	    Note that the -b and -p flags depend upon  the  terminal  supporting
	    "OSC 52" escape sequences. If the terminal lacks this support, these
	    flags will simply do nothing. OSC 52 sends data over the wire, so it
	    can  be  used over SSH and still work as expected, unlike most other
	    methods of copying to the system clipboard.

	    The -i, -b and -p flags can be used together, to  allow  copying  to
	    multiple targets in a single command. For example:

		   copy -ib

     paste [-m] [-a|-c]
	    Insert text previously copied by the copy or cut commands.

	    If	the  text  to be inserted was copied from a whole-line selection
	    (e.g. down -l; copy) or as a  whole,  single  line	(e.g.  unselect;
	    copy)  the	default  behaviour is to insert the text at the start of
	    the line below the cursor.

	    -a	   Paste above the cursor (instead of below), if  pasting  whole
		   lines

	    -c	   Always paste directly at the cursor position, even when past-
		   ing whole lines (instead of below/above the cursor)

	    -m	   Move after the pasted text

     undo
	    Undo latest change.

	    -m	   Move to the change, without undoing it

     redo [choice]
	    Redo  changes done by the undo command. If there are multiple possi-
	    bilities 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.

     clear
	    Clear current line.

	    -i	   Do not auto-indent the line after clearing

     join
	    Join selection or next line to current.

     new-line [-a]
	    Insert empty line below current line.

	    -a	   Insert above current line, instead of below

     delete
	    Delete character after cursor (or selection).

     erase
	    Delete character before cursor (or selection).

     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.

     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.

     case [-l|-u]
	    Change  text case. The default is to change lower case to upper case
	    and vice versa.

	    -l	   Lower case

	    -u	   Upper case

     insert [-k|-m] text
	    Insert text into the buffer.

	    -k	   Insert one character at a time, as if  manually  typed  (nor-
		   mally  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.

	    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  es-
	    caping them (as \\ and \&).
	    * All other characters in replacement represent themselves.

	    Note: extra care must be taken when using double quotes for the pat-
	    tern  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 para-
	    graph width is not given then the text-width option is used.

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

     select [-kl]
	    Enter selection mode. All basic movement commands while in this mode
	    extend the selected area, until either the unselect command is  used
	    (e.g. by pressing Esc) or some other operation (e.g. delete, insert,
	    etc.) clears the selection.

	    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.

	    -k	   Keep existing selections

	    -l	   Select whole lines

     unselect
	    Cancel selection.

   External Commands
     exec [-pstmn] [-ioe action]... command [parameter]...
	    Execute  external command, with custom actions for standard streams.
	    The -i, -o and -e options represent standard input, output and error
	    respectively and each one can be given a  specific	action,  as  de-
	    scribed below.

	    The following action arguments are supported by all -ioe options:

	    * null - redirect to /dev/null
	    * tty - redirect to controlling terminal (default action)

	    Actions for stdin (-i):

	    * buffer - pipe selected text or whole buffer (to command)
	    * line - pipe selected text or current line
	    * word - pipe selected text or current word
	    * command - pipe command history
	    * search - pipe search history
	    * msg - pipe list of numbered messages (see msg command)

	    Actions for stdout (-o):

	    * buffer - insert output (from command) into buffer
	    * eval - execute output as dterc commands
	    *  msg  -  run msg command with numerical argument parsed from first
	    line of output
	    * open - run open command with each line of output as an argument
	    * tag - run tag command with first line of output as an argument

	    Actions for stderr (-e):

	    * errmsg - if command exits non-zero, display first line  of  stderr
	    output as an error message

	    -i action
		   Specify standard input action

	    -o action
		   Specify standard output action

	    -e action
		   Specify standard error action

	    -p	   Display "press any key to continue" prompt

	    -s	   Don't yield terminal control to child processes and transpar-
		   ently  convert  tty actions to null (use this to avoid screen
		   flicker when command doesn't need terminal access)

	    -t	   Cancel the effects of -s (last one wins)

	    -m	   Move cursor after any inserted text

	    -n	   Strip newline from end of inserted text

	    For convenience, there are several built-in aliases to simplify com-
	    mon uses of exec:

		   alias filter 'exec -s -i buffer -o buffer -e errmsg'
		   alias pipe-from 'exec -s -o buffer -e errmsg'
		   alias pipe-to 'exec -s -i buffer -e errmsg'
		   alias run 'exec'
		   alias eval 'exec -o eval'
		   alias exec-open 'exec -o open'
		   alias exec-tag 'exec -o tag'
		   alias exec-msg 'exec -o msg -i msg'

	    Examples:

		   filter sort -r
		   filter sh -c 'tr a-z A-Z | sed s/foo/bar/'
		   pipe-to xsel -b
		   exec-open -s find . -type f -name *.h
		   exec-open -s git ls-files --modified
		   exec-open fzf -m --reverse
		   exec-tag -s echo main
		   exec-tag sh -c 'readtags -l | cut -f1 | sort | uniq | fzf --reverse'

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

     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 previ-
	    ously specified by the errorfmt command. After  command  exits  suc-
	    cessfully, 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.

   Other Commands
     repeat count command [parameters]...
	    Run command count times.

     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 un-
	    less -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

	    hi	   Show highlight colors

	    include
		   Show built-in configs

	    macro  Show last recorded macro

	    msg    Show messages

	    option
		   Show option values and automatic option entries

	    search
		   Show search history

	    set    Show option values

	    setenv
		   Show environment variables, in terms of the setenv command

	    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.

	    Note: the majority of type arguments correspond to a command of  the
	    same name and some type arguments don't take any key argument.

	    -c	   write output to the command line (for most type arguments) or
		   to the current buffer (when type is errorfmt or include)

     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
     Options can be changed using the set command. Enumerated options  can  also
     be  toggled. To see which options are enumerated, type "toggle " in command
     mode and press the tab key. You can also use the option command to set  de-
     fault options for specific file types.

   Global options
     case-sensitive-search [true]

	    false  Search is case-insensitive

	    true   Search is case-sensitive

	    auto   If  search  string  contains  an  uppercase	letter search is
		   case-sensitive, otherwise it is case-insensitive

     display-special [false]
	    Display special characters.

     esc-timeout [100] 0...2000
	    When single escape is read from the terminal dte waits some time be-
	    fore treating the escape as a single keypress. The timeout value  is
	    in milliseconds.

	    Too  long  timeout	makes 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.

     optimize-true-color [true]
	    If	set  to true, this option will cause the hi command to automati-
	    cally replace 24-bit #RRGGBB colors with palette colors 16-255,  but
	    only  if  there's  an  exact color match among the default, extended
	    palette colors.

	    This allows defining color schemes in #RRGGBB notation  while  still
	    sending the shortest possible escape sequence to the terminal.

	    Note: this optimization only works if the terminal has not been con-
	    figured  with  custom  values for colors 16-255. If you have changed
	    these extended palette colors, you should set this option to false.

     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%s%r%s%M"]
	    Format string for the left aligned part of 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 dis-
		   play column then both are shown (e.g. 2-9)

	    %p	   Position in percentage

	    %E	   File encoding

	    %b	   Prints BOM if file has a byte order mark

	    %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  char-
		   acter expanded to an empty string)

	    %S	   Like %s, but 3 spaces instead of 1

	    %t	   File type

	    %u	   Hexadecimal Unicode value value of character under cursor

	    %o	   Prints OVR or INS for overwrite mode on or off respectively

	    %%	   Literal %

     statusline-right [" %y,%X %u %o %E%s%b%s%n %t %p "]
	    Format string for the right aligned part of 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.  De-
	    pends on the auto-indent option.

     filetype [none]
	    Type of file. Value must be previously registered using the ft  com-
	    mand.

     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 previous non-empty line. If also the indent-regex lo-
	    cal option is set then indentation is automatically increased if the
	    regular expression matches 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  de-
	    tected  if the value is not "". Adjusts the following options if in-
	    dentation 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.

     overwrite [false]
	    If set to true, typing will  overwrite  existing  characters  within
	    current line instead of inserting before them.

     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  er-
		   rors.

	    space-indent
		   Highlight  space  indents as errors. Note that this still al-
		   lows using less than tab-width spaces at the end of	indenta-
		   tion for alignment.

	    tab-after-indent
		   Highlight  tabs  used  anywhere other than indentation as er-
		   rors.

	    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 er-
		   rors.  One of these characters is  no-break	space  (U+00A0),
		   which  is  often accidentally typed (AltGr+space in some key-
		   board 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

				  December 2022 			DTERC(5)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=dterc&sektion=5&manpath=FreeBSD+Ports+15.1.quarterly>

home | help