.TH DTERC 5 "March 2021" .nh .ad l . .SH NAME dterc \- Command and configuration language used by \fBdte\fR(1) .SH SYNOPSIS .P Commands: .br .P Configuration Commands: .br \fBalias\fR \fIname\fR \fIcommand\fR .br \fBbind\fR \fIkey\fR [\fIcommand\fR] .br \fBset\fR [\fB\-gl\fR] \fIoption\fR [\fIvalue\fR] ... .br \fBsetenv\fR \fIname\fR [\fIvalue\fR] .br \fBhi\fR [\fB\-c\fR] \fIname\fR [\fIfg\-color\fR [\fIbg\-color\fR]] [\fIattribute\fR]... .br \fBft\fR [\fB\-b\fR|\fB\-c\fR|\fB\-f\fR|\fB\-i\fR] \fIfiletype\fR \fIstring\fR... .br \fBoption\fR [\fB\-r\fR] \fIfiletype\fR \fIoption\fR \fIvalue\fR... .br \fBinclude\fR [\fB\-bq\fR] \fIfile\fR .br \fBerrorfmt\fR [\fB\-i\fR] \fIcompiler\fR \fIregexp\fR [file|line|column|message|_]... .br \fBload\-syntax\fR \fIfilename\fR|\fIfiletype\fR .br .P Editor Commands: .br \fBquit\fR [\fB\-f\fR|\fB\-p\fR] [\fIexitcode\fR] .br \fBsuspend\fR .br \fBcd\fR \fIdirectory\fR .br \fBcommand\fR [\fItext\fR] .br \fBsearch\fR [\fB\-Hnprw\fR] [\fIpattern\fR] .br \fBrefresh\fR .br .P Buffer Management Commands: .br \fBopen\fR [\fB\-g\fR|\fB\-t\fR] [\fB\-e\fR \fIencoding\fR] [\fIfilename\fR]... .br \fBsave\fR [\fB\-fp\fR] [\fB\-d\fR|\fB\-u\fR] [\fB\-b\fR|\fB\-B\fR] [\fB\-e\fR \fIencoding\fR] [\fIfilename\fR] .br \fBclose\fR [\fB\-qw\fR] [\fB\-f\fR|\fB\-p\fR] .br \fBnext\fR .br \fBprev\fR .br \fBview\fR \fIN\fR|\fBlast\fR .br \fBmove\-tab\fR \fIN\fR|\fBleft\fR|\fBright\fR .br .P Window Management Commands: .br \fBwsplit\fR [\fB\-bghnrt\fR] [\fIfilename\fR]... .br \fBwclose\fR [\fB\-f\fR|\fB\-p\fR] .br \fBwnext\fR .br \fBwprev\fR .br \fBwresize\fR [\fB\-h\fR|\fB\-v\fR] [\fIN\fR|+\fIN\fR|\-\- \-\fIN\fR] .br \fBwflip\fR .br \fBwswap\fR .br .P Movement Commands: .br \fBleft\fR [\fB\-c\fR] .br \fBright\fR [\fB\-c\fR] .br \fBup\fR [\fB\-c\fR|\fB\-l\fR] .br \fBdown\fR [\fB\-c\fR|\fB\-l\fR] .br \fBpgup\fR [\fB\-c\fR|\fB\-l\fR] .br \fBpgdown\fR [\fB\-c\fR|\fB\-l\fR] .br \fBblkup\fR [\fB\-c\fR|\fB\-l\fR] .br \fBblkdown\fR [\fB\-c\fR|\fB\-l\fR] .br \fBword\-fwd\fR [\fB\-cs\fR] .br \fBword\-bwd\fR [\fB\-cs\fR] .br \fBbol\fR [\fB\-cs\fR] .br \fBeol\fR [\fB\-c\fR] .br \fBbof\fR .br \fBeof\fR .br \fBbolsf\fR .br \fBeolsf\fR .br \fBscroll\-up\fR .br \fBscroll\-down\fR .br \fBscroll\-pgup\fR .br \fBscroll\-pgdown\fR .br \fBcenter\-view\fR .br \fBmatch\-bracket\fR .br \fBline\fR \fInumber\fR .br \fBtag\fR [\fB\-r\fR] [\fItag\fR] .br \fBmsg\fR [\fB\-n\fR|\fB\-p\fR] .br .P Editing Commands: .br \fBcut\fR .br \fBcopy\fR [\fB\-k\fR] .br \fBpaste\fR [\fB\-c\fR] .br \fBundo\fR .br \fBredo\fR [\fIchoice\fR] .br \fBclear\fR .br \fBjoin\fR .br \fBnew\-line\fR .br \fBdelete\fR .br \fBerase\fR .br \fBdelete\-eol\fR [\fB\-n\fR] .br \fBerase\-bol\fR .br \fBdelete\-word\fR [\fB\-s\fR] .br \fBerase\-word\fR [\fB\-s\fR] .br \fBdelete\-line\fR .br \fBcase\fR [\fB\-l\fR|\fB\-u\fR] .br \fBinsert\fR [\fB\-km\fR] \fItext\fR .br \fBreplace\fR [\fB\-bcgi\fR] \fIpattern\fR \fIreplacement\fR .br \fBshift\fR \fIcount\fR .br \fBwrap\-paragraph\fR [\fIwidth\fR] .br \fBselect\fR [\fB\-bkl\fR] .br \fBunselect\fR .br .P External Commands: .br \fBfilter\fR [\fB\-l\fR] \fIcommand\fR [\fIparameter\fR]... .br \fBpipe\-from\fR [\fB\-ms\fR] \fIcommand\fR [\fIparameter\fR]... .br \fBpipe\-to\fR [\fB\-l\fR] \fIcommand\fR [\fIparameter\fR]... .br \fBrun\fR [\fB\-ps\fR] \fIcommand\fR [\fIparameters\fR]... .br \fBcompile\fR [\fB\-1ps\fR] \fIerrorfmt\fR \fIcommand\fR [\fIparameters\fR]... .br \fBeval\fR \fIcommand\fR [\fIparameter\fR]... .br \fBexec\-open\fR [\fB\-s\fR] \fIcommand\fR [\fIparameter\fR]... .br \fBexec\-tag\fR [\fB\-s\fR] \fIcommand\fR [\fIparameter\fR]... .br .P Other Commands: .br \fBrepeat\fR \fIcount\fR \fIcommand\fR [\fIparameters\fR]... .br \fBtoggle\fR [\fB\-gv\fR] \fIoption\fR [\fIvalues\fR]... .br \fBshow\fR [\fB\-c\fR] \fItype\fR [\fIkey\fR] .br \fBmacro\fR \fIaction\fR .br .P Options: .br .P Global options: .br \fBcase\-sensitive\-search\fR [true] .br \fBdisplay\-invisible\fR [false] .br \fBdisplay\-special\fR [false] .br \fBesc\-timeout\fR [100] 0...2000 .br \fBfilesize\-limit\fR [250] .br \fBlock\-files\fR [true] .br \fBnewline\fR [unix] .br \fBselect\-cursor\-char\fR [true] .br \fBscroll\-margin\fR [0] .br \fBset\-window\-title\fR [false] .br \fBshow\-line\-numbers\fR [false] .br \fBstatusline\-left\fR [" %f%s%m%r%s%M"] .br \fBstatusline\-right\fR [" %y,%X %u %E%s%b%s%n %t %p "] .br \fBtab\-bar\fR [true] .br \fButf8\-bom\fR [false] .br .P Local options: .br \fBbrace\-indent\fR [false] .br \fBfiletype\fR [none] .br \fBindent\-regex\fR [""] .br .P Local and global options: .br \fBauto\-indent\fR [true] .br \fBdetect\-indent\fR [""] .br \fBemulate\-tab\fR [false] .br \fBexpand\-tab\fR [false] .br \fBfile\-history\fR [true] .br \fBindent\-width\fR [8] .br \fBsyntax\fR [true] .br \fBtab\-width\fR [8] .br \fBtext\-width\fR [72] .br \fBws\-error\fR [special] .br .SH DESCRIPTION dterc is the language used in \fBdte\fR(1) configuration files (\fB~/.dte/rc\fR) and also in the command mode of the editor (Alt+x). The syntax of the language is quite similar to shell, but much simpler. .P Commands are separated either by a newline or \fB;\fR character. To make a command span multiple lines in an rc file, escape the newline (put \fB\\\fR at the end of the line). .P Rc files can contain comments at the start of a line. Comments begin with a \fB#\fR character and can be indented, but they can't be put on the same line as a command. .P 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 commands that contain variables (inside single or double quotes), which will be expanded just before the command is executed. .P Example: .P .IP .nf \f[C] alias\ x\ "run\ chmod\ 755\ $FILE" \f[] .fi .PP \fB$FILE\fR is expanded when the alias \fIx\fR is executed. The command works even if \fB$FILE\fR contains whitespace. .P .SS Special variables These variables are always defined and override environment variables of the same name. .P \fB$FILE\fR .RS The filename of the current buffer (or an empty string if unsaved). .P .RE \fB$FILETYPE\fR .RS The value of the \fBfiletype\fR option for the current buffer. .P .RE \fB$LINENO\fR .RS The line number of the cursor in the current buffer. .P .RE \fB$WORD\fR .RS The selected text or the word under the cursor. .P .RE \fB$DTE_HOME\fR .RS The user configuration directory. This is either the value of \fB$DTE_HOME\fR when the editor first started, or the default value (\fB$HOME/.dte\fR). .P .RE .SS Single quoted strings Single quoted strings can't contain single quotes or escaped characters. .P .SS Double quoted strings Double quoted strings may contain the following escapes: .P .TP \fB\\a\fR, \fB\\b\fR, \fB\\t\fR, \fB\\n\fR, \fB\\v\fR, \fB\\f\fR, \fB\\r\fR Control characters (same as in C) .PP .TP \fB\\e\fR Escape character .PP .TP \fB\\\\\fR Backslash .PP .TP \fB\\"\fR Double quote .PP .TP \fB\\x0a\fR Hexadecimal byte value 0x0a. Note that \fB\\x00\fR is not supported because strings are NUL\-terminated. .PP .TP \fB\\u20ac\fR Four hex digit Unicode code point U+20AC. .PP .TP \fB\\U000020ac\fR Eight hex digit Unicode code point U+20AC. .PP .SH COMMANDS .SS 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. .P \fBalias\fR \fIname\fR \fIcommand\fR .RS Create an alias \fIname\fR for \fIcommand\fR. .P Example: .P .IP .nf \f[C] alias\ read\ 'pipe\-from\ cat' \f[] .fi .PP Now you can run \fBread file.txt\fR to insert \fBfile.txt\fR into the current buffer. .P .RE \fBbind\fR \fIkey\fR [\fIcommand\fR] .RS Bind \fIcommand\fR to \fIkey\fR. If no \fIcommand\fR is given then any existing binding for \fIkey\fR is removed. .P Special keys: .P \(bu \fBleft\fR .br \(bu \fBright\fR .br \(bu \fBup\fR .br \(bu \fBdown\fR .br \(bu \fBinsert\fR .br \(bu \fBdelete\fR .br \(bu \fBhome\fR .br \(bu \fBend\fR .br \(bu \fBpgup\fR .br \(bu \fBpgdown\fR .br \(bu \fBbegin\fR (keypad "5" with Num Lock off) .br \(bu \fBenter\fR .br \(bu \fBtab\fR .br \(bu \fBspace\fR .br \(bu \fBF1\fR..\fBF12\fR .br .P Modifiers: .P .TP Ctrl: \fBC\-X\fR or \fB^X\fR .PP .TP Alt: \fBM\-X\fR .PP .TP Shift: \fBS\-left\fR .PP .RE \fBset\fR [\fB\-gl\fR] \fIoption\fR [\fIvalue\fR] ... .RS Set \fIvalue\fR for \fIoption\fR. Value can be omitted for boolean option to set it true. Multiple options can be set at once but then \fIvalue\fR must be given for every option. .P There are three kinds of options. .P 1. Global options. .P . .br 2. Local options. These are file specific options. Each open file has its own copies of the option values. .P . .br 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. .P . .br .P By default \fBset\fR changes both global and local values. .P .TP \fB\-g\fR Change only global option value .PP .TP \fB\-l\fR Change only local option value of current file .PP In configuration files only global options can be set (no need to specify the \fB\-g\fR flag). .P See also: \fBtoggle\fR and \fBoption\fR commands. .P .RE \fBsetenv\fR \fIname\fR [\fIvalue\fR] .RS Set (or unset) environment variable. .P .RE \fBhi\fR [\fB\-c\fR] \fIname\fR [\fIfg\-color\fR [\fIbg\-color\fR]] [\fIattribute\fR]... .RS Set highlight color. .P The \fIname\fR argument can be a token name defined by a \fBdte\-syntax\fR(5) file or one of the following, built\-in highlight names: .P \(bu \fBdefault\fR .br \(bu \fBnontext\fR .br \(bu \fBnoline\fR .br \(bu \fBwserror\fR .br \(bu \fBselection\fR .br \(bu \fBcurrentline\fR .br \(bu \fBlinenumber\fR .br \(bu \fBstatusline\fR .br \(bu \fBcommandline\fR .br \(bu \fBerrormsg\fR .br \(bu \fBinfomsg\fR .br \(bu \fBtabbar\fR .br \(bu \fBactivetab\fR .br \(bu \fBinactivetab\fR .br \(bu \fBdialog\fR .br .P The \fIfg\-color\fR and \fIbg\-color\fR arguments can be one of the following: .P \(bu No value (equivalent to \fBdefault\fR) .br \(bu A numeric value between \fB\-2\fR and \fB255\fR .br \(bu A 256\-color palette value in R/G/B notation (e.g. \fB0/3/5\fR) .br \(bu A true color value in CSS\-style #RRGGBB notation (e.g. \fB#ab90df\fR) .br \(bu \fBkeep\fR (\fB\-2\fR) .br \(bu \fBdefault\fR (\fB\-1\fR) .br \(bu \fBblack\fR (\fB0\fR) .br \(bu \fBred\fR (\fB1\fR) .br \(bu \fBgreen\fR (\fB2\fR) .br \(bu \fByellow\fR (\fB3\fR) .br \(bu \fBblue\fR (\fB4\fR) .br \(bu \fBmagenta\fR (\fB5\fR) .br \(bu \fBcyan\fR (\fB6\fR) .br \(bu \fBgray\fR (\fB7\fR) .br \(bu \fBdarkgray\fR (\fB8\fR) .br \(bu \fBlightred\fR (\fB9\fR) .br \(bu \fBlightgreen\fR (\fB10\fR) .br \(bu \fBlightyellow\fR (\fB11\fR) .br \(bu \fBlightblue\fR (\fB12\fR) .br \(bu \fBlightmagenta\fR (\fB13\fR) .br \(bu \fBlightcyan\fR (\fB14\fR) .br \(bu \fBwhite\fR (\fB15\fR) .br .P Colors \fB16\fR to \fB231\fR correspond to R/G/B colors. Colors \fB232\fR to \fB255\fR are grayscale values. .P If the terminal has limited support for rendering colors, the \fIfg\-color\fR and \fIbg\-color\fR arguments will fall back to the nearest supported color (unless the \fB\-c\fR flag is used). .P The \fIattribute\fR argument(s) can be any combination of the following: .P \(bu \fBbold\fR .br \(bu \fBdim\fR .br \(bu \fBitalic\fR .br \(bu \fBunderline\fR .br \(bu \fBstrikethrough\fR .br \(bu \fBblink\fR .br \(bu \fBreverse\fR .br \(bu \fBinvisible\fR .br \(bu \fBkeep\fR .br .P The color and attribute value \fBkeep\fR is useful in selected text to keep \fIfg\-color\fR and attributes and change only \fIbg\-color\fR. .P NOTE: Because \fBkeep\fR is both a color and an attribute you need to specify both \fIfg\-color\fR and \fIbg\-color\fR if you want to set the \fBkeep\fR \fIattribute\fR. .P Unset fg/bg colors are inherited from highlight color \fBdefault\fR. If you don't set fg/bg for the highlight color \fBdefault\fR then terminal's default fg/bg is used. .P .TP \fB\-c\fR Do nothing at all if the terminal can't display \fIfg\-color\fR and/or \fIbg\-color\fR with full precision .PP .RE \fBft\fR [\fB\-b\fR|\fB\-c\fR|\fB\-f\fR|\fB\-i\fR] \fIfiletype\fR \fIstring\fR... .RS Add a filetype association. Filetypes are used to determine which syntax highlighter and local options to use when opening files. .P By default \fIstring\fR is interpreted as one or more filename extensions. .P .TP \fB\-b\fR Interpret \fIstring\fR as a file basename .PP .TP \fB\-c\fR Interpret \fIstring\fR as a \fBregex\fR(7) pattern and match against the contents of the first line of the file .PP .TP \fB\-f\fR Interpret \fIstring\fR as a \fBregex\fR(7) pattern and match against the full (absolute) filename .PP .TP \fB\-i\fR Interpret \fIstring\fR as a command interpreter name and match against the Unix shebang line (after removing any path prefix and/or version suffix) .PP Examples: .P .IP .nf \f[C] ft\ c\ c\ h ft\ \-b\ make\ Makefile\ GNUmakefile ft\ \-c\ xml\ '<\\?xml' ft\ \-f\ mail\ '/tmpmsg\-.*\\.txt$' ft\ \-i\ lua\ lua\ luajit \f[] .fi .PP See also: .P \(bu The \fBoption\fR command (below) .br \(bu The \fBfiletype\fR option (below) .br \(bu The \fBdte\-syntax\fR(5) man page .br .P .RE \fBoption\fR [\fB\-r\fR] \fIfiletype\fR \fIoption\fR \fIvalue\fR... .RS Add automatic \fIoption\fR for \fIfiletype\fR (as previously registered with the \fBft\fR command). Automatic options are set when files are are opened. .P .TP \fB\-r\fR Interpret \fIfiletype\fR argument as a \fBregex\fR(7) pattern instead of a filetype and match against full filenames .PP .RE \fBinclude\fR [\fB\-bq\fR] \fIfile\fR .RS Read and execute commands from \fIfile\fR. .P .TP \fB\-b\fR Read built\-in \fIfile\fR instead of reading from the filesystem .PP .TP \fB\-q\fR Don't show an error message if \fIfile\fR doesn't exist .PP Note: "built\-in files" are config files bundled into the program binary. See the \fB\-B\fR and \fB\-b\fR flags in the \fBdte\fR(1) man page for more information. .P .RE \fBerrorfmt\fR [\fB\-i\fR] \fIcompiler\fR \fIregexp\fR [file|line|column|message|_]... .RS Register a \fBregex\fR(7) pattern, for later use with the \fBcompile\fR command. .P When the \fBcompile\fR command is invoked with a specific \fIcompiler\fR name, the \fIregexp\fR pattern(s) previously registered with that name are used to parse messages from it's program output. .P The \fIregexp\fR 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 \fIregexp\fR but ignore the capture, use \fB_\fR as the extra argument. .P Running \fBerrorfmt\fR multiple times with the same \fIcompiler\fR name appends each \fIregexp\fR to a list. When running \fBcompile\fR, the entries in the specified list are checked for a match in the same order they were added. .P For a basic example of usage, see the output of \fBdte \-b compiler/go\fR. .P .TP \fB\-i\fR Ignore this error .PP .RE \fBload\-syntax\fR \fIfilename\fR|\fIfiletype\fR .RS Load a \fBdte\-syntax\fR(5) file into the editor. If the argument contains a \fB/\fR character it's considered a filename. .P Note: this command only loads a syntax file ready for later use. To actually apply a syntax highlighter to the current buffer, use the \fBset\fR command to change the \fBfiletype\fR of the buffer instead, e.g. \fBset filetype html\fR. .P .RE .SS Editor Commands \fBquit\fR [\fB\-f\fR|\fB\-p\fR] [\fIexitcode\fR] .RS Quit the editor. .P The exit status of the process is set to \fIexitcode\fR, which can be in the range \fB0\fR..\fB125\fR, or defaults to \fB0\fR if unspecified. .P .TP \fB\-f\fR Force quit, even if there are unsaved files .PP .TP \fB\-p\fR Prompt for confirmation if there are unsaved files .PP .RE \fBsuspend\fR .RS Suspend the editor (run \fBfg\fR in the shell to resume). .P .RE \fBcd\fR \fIdirectory\fR .RS Change the working directory and update \fB$PWD\fR and \fB$OLDPWD\fR. Running \fBcd \-\fR changes to the previous directory (\fB$OLDPWD\fR). .P .RE \fBcommand\fR [\fItext\fR] .RS Enter command mode. If \fItext\fR is given then it is written to the command line (see the default \fB^L\fR key binding for why this is useful). .P .RE \fBsearch\fR [\fB\-Hnprw\fR] [\fIpattern\fR] .RS If no flags or just \fB\-r\fR and no \fIpattern\fR given then dte changes to search mode where you can type a regular expression to search. .P .TP \fB\-H\fR Don't add \fIpattern\fR to search history .PP .TP \fB\-n\fR Search next .PP .TP \fB\-p\fR Search previous .PP .TP \fB\-r\fR Start searching backwards .PP .TP \fB\-w\fR Search word under cursor .PP .RE \fBrefresh\fR .RS Trigger a full redraw of the screen. .P .RE .SS Buffer Management Commands \fBopen\fR [\fB\-g\fR|\fB\-t\fR] [\fB\-e\fR \fIencoding\fR] [\fIfilename\fR]... .RS Open file. If \fIfilename\fR is omitted, a new file is opened. .P .TP \fB\-e\fR \fIencoding\fR Set file \fIencoding\fR. See \fBiconv \-l\fR for list of supported encodings. .PP .TP \fB\-g\fR Perform \fBglob\fR(7) expansion on \fIfilename\fR. .PP .TP \fB\-t\fR Mark buffer as "temporary" (always closeable, without warnings for "unsaved changes") .PP .RE \fBsave\fR [\fB\-fp\fR] [\fB\-d\fR|\fB\-u\fR] [\fB\-b\fR|\fB\-B\fR] [\fB\-e\fR \fIencoding\fR] [\fIfilename\fR] .RS Save current buffer. .P .TP \fB\-b\fR Write byte order mark (BOM) .PP .TP \fB\-B\fR Don't write byte order mark .PP .TP \fB\-d\fR Save with DOS/CRLF line\-endings .PP .TP \fB\-f\fR Force saving read\-only file .PP .TP \fB\-u\fR Save with Unix/LF line\-endings .PP .TP \fB\-p\fR Open a command prompt if there's no specified or existing \fIfilename\fR .PP .TP \fB\-e\fR \fIencoding\fR Set file \fIencoding\fR. See \fBiconv \-l\fR for list of supported encodings. .PP See also: \fBnewline\fR and \fButf8\-bom\fR global options .P .RE \fBclose\fR [\fB\-qw\fR] [\fB\-f\fR|\fB\-p\fR] .RS Close file. .P .TP \fB\-f\fR Force close file, even if it has unsaved changes .PP .TP \fB\-p\fR Prompt for confirmation if the file has unsaved changes .PP .TP \fB\-q\fR Quit if closing the last open file .PP .TP \fB\-w\fR Close parent window if closing its last contained file .PP .RE \fBnext\fR .RS Display next file. .P .RE \fBprev\fR .RS Display previous file. .P .RE \fBview\fR \fIN\fR|\fBlast\fR .RS Display \fIN\fRth or last open file. .P .RE \fBmove\-tab\fR \fIN\fR|\fBleft\fR|\fBright\fR .RS Move current tab to position \fIN\fR or 1 position left or right. .P .RE .SS Window Management Commands \fBwsplit\fR [\fB\-bghnrt\fR] [\fIfilename\fR]... .RS Split the current window. .P \fIfilename\fR arguments will be opened in a manner similar to the \fBopen\fR command. If there are no arguments, the contents of the new window will be an additional view of the current buffer. .P .TP \fB\-b\fR Add new window before current instead of after. .PP .TP \fB\-g\fR Perform \fBglob\fR(7) expansion on \fIfilename\fR. .PP .TP \fB\-h\fR Split horizontally instead of vertically. .PP .TP \fB\-n\fR Create a new, empty buffer. .PP .TP \fB\-r\fR Split root instead of current window. .PP .TP \fB\-t\fR Mark buffer as "temporary" (always closeable, without warnings for "unsaved changes") .PP .RE \fBwclose\fR [\fB\-f\fR|\fB\-p\fR] .RS Close window. .P .TP \fB\-f\fR Force close window, even if it contains unsaved files .PP .TP \fB\-p\fR Prompt for confirmation if there are unsaved files in the window .PP .RE \fBwnext\fR .RS Next window. .P .RE \fBwprev\fR .RS Previous window. .P .RE \fBwresize\fR [\fB\-h\fR|\fB\-v\fR] [\fIN\fR|+\fIN\fR|\-\- \-\fIN\fR] .RS If no parameter given, equalize window sizes in current frame. .P .TP \fB\-h\fR Resize horizontally .PP .TP \fB\-v\fR Resize vertically .PP .TP \fIN\fR Set size of current window to \fIN\fR characters. .PP .TP \fB+\fR\fIN\fR Increase size of current window by \fIN\fR characters. .PP .TP \fB\-\fR\fIN\fR Decrease size of current window by \fIN\fR characters. Use \fB\-\-\fR to prevent the minus symbol being parsed as an option flag, e.g. \fBwresize \-\- \-5\fR. .PP .RE \fBwflip\fR .RS Change from vertical layout to horizontal and vice versa. .P .RE \fBwswap\fR .RS Swap positions of this and next frame. .P .RE .SS Movement Commands Movement commands are used to move the cursor position. .P Several of these commands also have \fB\-c\fR and \fB\-l\fR flags to allow creating character/line selections. These 2 flags are noted in the command summaries below, but are only described once, as follows: .P .TP \fB\-c\fR Select characters .PP .TP \fB\-l\fR Select whole lines .PP \fBleft\fR [\fB\-c\fR] .RS Move one column left. .P .RE \fBright\fR [\fB\-c\fR] .RS Move one column right. .P .RE \fBup\fR [\fB\-c\fR|\fB\-l\fR] .RS Move one line up. .P .RE \fBdown\fR [\fB\-c\fR|\fB\-l\fR] .RS Move one line down. .P .RE \fBpgup\fR [\fB\-c\fR|\fB\-l\fR] .RS Move one page up. .P .RE \fBpgdown\fR [\fB\-c\fR|\fB\-l\fR] .RS Move one page down. .P .RE \fBblkup\fR [\fB\-c\fR|\fB\-l\fR] .RS Move one block up. .P Note: a "block", in this context, is somewhat akin to a paragraph. Blocks are delimited by one or more blank lines .P .RE \fBblkdown\fR [\fB\-c\fR|\fB\-l\fR] .RS Move one block down. .P .RE \fBword\-fwd\fR [\fB\-cs\fR] .RS Move forward one word. .P .TP \fB\-s\fR Skip special characters .PP .RE \fBword\-bwd\fR [\fB\-cs\fR] .RS Move backward one word. .P .TP \fB\-s\fR Skip special characters .PP .RE \fBbol\fR [\fB\-cs\fR] .RS Move to beginning of current line. .P .TP \fB\-s\fR Move to beginning of indented text or beginning of line, depending on current cursor position. .PP .RE \fBeol\fR [\fB\-c\fR] .RS Move to end of current line. .P .RE \fBbof\fR .RS Move to beginning of file. .P .RE \fBeof\fR .RS Move to end of file. .P .RE \fBbolsf\fR .RS Incrementally move to beginning of line, then beginning of screen, then beginning of file. .P .RE \fBeolsf\fR .RS Incrementally move to end of line, then end of screen, then end of file. .P .RE \fBscroll\-up\fR .RS Scroll view up one line. Keeps cursor position unchanged if possible. .P .RE \fBscroll\-down\fR .RS Scroll view down one line. Keeps cursor position unchanged if possible. .P .RE \fBscroll\-pgup\fR .RS Scroll one page up. Cursor position relative to top of screen is maintained. See also \fBpgup\fR. .P .RE \fBscroll\-pgdown\fR .RS Scroll one page down. Cursor position relative to top of screen is maintained. See also \fBpgdown\fR. .P .RE \fBcenter\-view\fR .RS Center view to cursor. .P .RE \fBmatch\-bracket\fR .RS Move to the bracket character paired with the one under the cursor. The character under the cursor should be one of \fB{}[]()<>\fR. .P .RE \fBline\fR \fInumber\fR .RS Go to line. .P .RE \fBtag\fR [\fB\-r\fR] [\fItag\fR] .RS Save the current location and jump to the location of \fItag\fR. If no \fItag\fR argument is specified then the word under the cursor is used instead. .P This command requires a \fBtags\fR file generated by \fBctags\fR(1). \fBtags\fR files are searched for in the current working directory and its parent directories. .P .TP \fB\-r\fR jump back to the previous location .PP See also: \fBmsg\fR command. .P .RE \fBmsg\fR [\fB\-n\fR|\fB\-p\fR] .RS Show latest, next (\fB\-n\fR) or previous (\fB\-p\fR) message. If its location is known (compile error or tag message) then the file will be opened and cursor moved to the location. .P .TP \fB\-n\fR Next message .PP .TP \fB\-p\fR Previous message .PP See also: \fBcompile\fR and \fBtag\fR commands. .P .RE .SS Editing Commands \fBcut\fR .RS Cut current line or selection. .P .RE \fBcopy\fR [\fB\-k\fR] .RS Copy current line or selection. .P .TP \fB\-k\fR Keep selection (by default, selections are lost after copying) .PP .RE \fBpaste\fR [\fB\-c\fR] .RS Paste text previously copied by the \fBcopy\fR or \fBcut\fR commands. .P .TP \fB\-c\fR 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) .PP .RE \fBundo\fR .RS Undo latest change. .P .RE \fBredo\fR [\fIchoice\fR] .RS Redo changes done by the \fBundo\fR command. If there are multiple possibilities a message is displayed: .P .IP .nf \f[C] Redoing\ newest\ (2)\ of\ 2\ possible\ changes. \f[] .fi .PP If the change was not the one you wanted, just run \fBundo\fR and then, for example, \fBredo 1\fR. .P .RE \fBclear\fR .RS Clear current line. .P .RE \fBjoin\fR .RS Join selection or next line to current. .P .RE \fBnew\-line\fR .RS Insert empty line under current line. .P .RE \fBdelete\fR .RS Delete character after cursor (or selection). .P .RE \fBerase\fR .RS Delete character before cursor (or selection). .P .RE \fBdelete\-eol\fR [\fB\-n\fR] .RS Delete to end of line. .P .TP \fB\-n\fR Delete newline if cursor is at end of line .PP .RE \fBerase\-bol\fR .RS Erase to beginning of line. .P .RE \fBdelete\-word\fR [\fB\-s\fR] .RS Delete word after cursor. .P .TP \fB\-s\fR Be more "aggressive" .PP .RE \fBerase\-word\fR [\fB\-s\fR] .RS Erase word before cursor. .P .TP \fB\-s\fR Be more "aggressive" .PP .RE \fBdelete\-line\fR .RS Delete current line. .P .RE \fBcase\fR [\fB\-l\fR|\fB\-u\fR] .RS Change text case. The default is to change lower case to upper case and vice versa. .P .TP \fB\-l\fR Lower case .PP .TP \fB\-u\fR Upper case .PP .RE \fBinsert\fR [\fB\-km\fR] \fItext\fR .RS Insert \fItext\fR into the buffer. .P .TP \fB\-k\fR Insert one character at a time, as if manually typed. Normally \fItext\fR 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. .PP .TP \fB\-m\fR Move after inserted text .PP .RE \fBreplace\fR [\fB\-bcgi\fR] \fIpattern\fR \fIreplacement\fR .RS Replace all instances of text matching \fIpattern\fR with the \fIreplacement\fR text. .P The \fIpattern\fR argument is a POSIX extended \fBregex\fR(7). .P The \fIreplacement\fR argument is treated like a template and may contain several, special substitutions: .P \(bu Backslash sequences \fB\\1\fR through \fB\\9\fR are replaced by sub\-strings that were "captured" (via parentheses) in the \fIpattern\fR. .br \(bu The special character \fB&\fR is replaced by the full string that was matched by \fIpattern\fR. .br \(bu Literal \fB\\\fR and \fB&\fR characters can be inserted in \fIreplacement\fR by escaping them (as \fB\\\\\fR and \fB\\&\fR). .br \(bu All other characters in \fIreplacement\fR represent themselves. .br .P Note: extra care must be taken when using double quotes for the \fIpattern\fR argument, since double quoted arguments have their own (higher precedence) backslash sequences. .P .TP \fB\-b\fR Use basic instead of extended regex syntax .PP .TP \fB\-c\fR Ask for confirmation before each replacement .PP .TP \fB\-g\fR Replace all matches for each line (instead of just the first) .PP .TP \fB\-i\fR Ignore case .PP Examples: .P .IP .nf \f[C] replace\ 'Hello\ World'\ '&\ (Hallo\ Welt)' replace\ "[\ \\t]+$"\ '' replace\ \-cg\ '([^\ ]+)\ +([^\ ]+)'\ '\\2\ \\1' \f[] .fi .PP .RE \fBshift\fR \fIcount\fR .RS Shift current or selected lines by \fIcount\fR indentation levels. Count is usually \fB\-1\fR (decrease indent) or \fB1\fR (increase indent). .P To specify a negative number, it's necessary to first disable option parsing with \fB\-\-\fR, e.g. \fBshift \-\- \-1\fR. .P .RE \fBwrap\-paragraph\fR [\fIwidth\fR] .RS Format the current selection or paragraph under the cursor. If paragraph \fIwidth\fR is not given then the \fBtext\-width\fR option is used. .P This command merges the selection into one paragraph. To format multiple paragraphs use the external \fBfmt\fR(1) program with the \fBfilter\fR command, e.g. \fBfilter fmt \-w 60\fR. .P .RE \fBselect\fR [\fB\-bkl\fR] .RS Enter selection mode. All movement commands while in this mode extend the selected area. .P Note: A better way to create selections is to hold the Shift key whilst moving the cursor. The \fBselect\fR command exists mostly as a fallback, for terminals with limited key binding support. .P .TP \fB\-b\fR Select block between opening \fB{\fR and closing \fB}\fR curly braces .PP .TP \fB\-k\fR Keep existing selections .PP .TP \fB\-l\fR Select whole lines .PP .RE \fBunselect\fR .RS Unselect. .P .RE .SS External Commands \fBfilter\fR [\fB\-l\fR] \fIcommand\fR [\fIparameter\fR]... .RS Filter selected text or whole file through external \fIcommand\fR. .P Example: .P .IP .nf \f[C] filter\ sort\ \-r \f[] .fi .PP Note that \fIcommand\fR is executed directly using \fBexecvp\fR(3). To use shell features like pipes or redirection, use a shell interpreter as the \fIcommand\fR. For example: .P .IP .nf \f[C] filter\ sh\ \-c\ 'tr\ a\-z\ A\-Z\ |\ sed\ s/foo/bar/' \f[] .fi .PP .TP \fB\-l\fR Operate on current line instead of whole file, if there's no selection .PP .RE \fBpipe\-from\fR [\fB\-ms\fR] \fIcommand\fR [\fIparameter\fR]... .RS Run external \fIcommand\fR and insert its standard output. .P .TP \fB\-m\fR Move after the inserted text .PP .TP \fB\-s\fR Strip newline from end of output .PP .RE \fBpipe\-to\fR [\fB\-l\fR] \fIcommand\fR [\fIparameter\fR]... .RS Run external \fIcommand\fR and pipe the selected text (or whole file) to its standard input. .P Can be used to e.g. write text to the system clipboard: .P .IP .nf \f[C] pipe\-to\ xsel\ \-b \f[] .fi .PP .TP \fB\-l\fR Operate on current line instead of whole file, if there's no selection .PP .RE \fBrun\fR [\fB\-ps\fR] \fIcommand\fR [\fIparameters\fR]... .RS Run external \fIcommand\fR. .P .TP \fB\-p\fR Display "Press any key to continue" prompt .PP .TP \fB\-s\fR Silent \-\- both \fBstderr\fR(3) and \fBstdout\fR(3) are redirected to \fB/dev/null\fR .PP .RE \fBcompile\fR [\fB\-1ps\fR] \fIerrorfmt\fR \fIcommand\fR [\fIparameters\fR]... .RS Run external \fIcommand\fR 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. .P The \fIerrorfmt\fR argument corresponds to a regex capture pattern previously specified by the \fBerrorfmt\fR command. After \fIcommand\fR exits successfully, parsed messages can be navigated using the \fBmsg\fR command. .P .TP \fB\-1\fR Read error messages from stdout instead of stderr .PP .TP \fB\-p\fR Display "Press any key to continue" prompt .PP .TP \fB\-s\fR Silent. Both \fBstderr\fR(3) and \fBstdout\fR(3) are redirected to \fB/dev/null\fR .PP See also: \fBerrorfmt\fR and \fBmsg\fR commands. .P .RE \fBeval\fR \fIcommand\fR [\fIparameter\fR]... .RS Run external \fIcommand\fR and execute its standard output text as dterc commands. .P .RE \fBexec\-open\fR [\fB\-s\fR] \fIcommand\fR [\fIparameter\fR]... .RS Run external \fIcommand\fR and open all filenames listed on its standard output. .P .TP \fB\-s\fR Don't yield terminal control to the child process .PP Example uses: .P .IP .nf \f[C] exec\-open\ \-s\ find\ .\ \-type\ f\ \-name\ *.h exec\-open\ \-s\ git\ ls\-files\ \-\-modified exec\-open\ fzf\ \-m\ \-\-reverse \f[] .fi .PP .RE \fBexec\-tag\fR [\fB\-s\fR] \fIcommand\fR [\fIparameter\fR]... .RS Run external \fIcommand\fR and then execute the \fBtag\fR command with its first line of standard output as the argument. .P .TP \fB\-s\fR Don't yield terminal control to the child process .PP Example uses: .P .IP .nf \f[C] exec\-tag\ \-s\ echo\ main exec\-tag\ sh\ \-c\ 'readtags\ \-l\ |\ cut\ \-f1\ |\ sort\ |\ uniq\ |\ fzf\ \-\-reverse' \f[] .fi .PP .RE .SS Other Commands \fBrepeat\fR \fIcount\fR \fIcommand\fR [\fIparameters\fR]... .RS Run \fIcommand\fR \fIcount\fR times. .P .RE \fBtoggle\fR [\fB\-gv\fR] \fIoption\fR [\fIvalues\fR]... .RS Toggle \fIoption\fR. If list of \fIvalues\fR is not given then the option must be either boolean or enum. .P .TP \fB\-g\fR toggle global option instead of local .PP .TP \fB\-v\fR display new value .PP If \fIoption\fR has both local and global values then local is toggled unless \fB\-g\fR is used. .P .RE \fBshow\fR [\fB\-c\fR] \fItype\fR [\fIkey\fR] .RS Display current values for various configurable types. .P The \fItype\fR argument can be one of: .P .TP \fBalias\fR Show command aliases .PP .TP \fBbind\fR Show key bindings .PP .TP \fBcolor\fR Show highlight colors .PP .TP \fBcommand\fR Show command history .PP .TP \fBenv\fR Show environment variables .PP .TP \fBerrorfmt\fR Show compiler error formats .PP .TP \fBft\fR Show filetype associations .PP .TP \fBinclude\fR Show built\-in configs .PP .TP \fBmacro\fR Show last recorded macro .PP .TP \fBoption\fR Show option values .PP .TP \fBsearch\fR Show search history .PP .TP \fBwsplit\fR Show window dimensions .PP The \fIkey\fR 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 \fItype\fR will be displayed in a new buffer. .P .TP \fB\-c\fR write value to command line (if possible) .PP .RE \fBmacro\fR \fIaction\fR .RS Record and replay command macros. .P The \fIaction\fR argument can be one of: .P .TP \fBrecord\fR Begin recording .PP .TP \fBstop\fR Stop recording .PP .TP \fBtoggle\fR Toggle recording on/off .PP .TP \fBcancel\fR Stop recording, without overwriting the previous macro .PP .TP \fBplay\fR Replay the previously recorded macro .PP Once a macro has been recorded, it can be viewed in text form by running \fBshow macro\fR. .P .RE .SH OPTIONS Options can be changed using the \fBset\fR command. Enumerated options can also be \fBtoggle\fRd. To see which options are enumerated, type "toggle " in command mode and press the tab key. You can also use the \fBoption\fR command to set default options for specific file types. .P .SS Global options \fBcase\-sensitive\-search\fR [true] .RS .TP \fBfalse\fR Search is case\-insensitive. .PP .TP \fBtrue\fR Search is case\-sensitive. .PP .TP \fBauto\fR If search string contains an uppercase letter search is case\-sensitive, otherwise it is case\-insensitive. .PP .RE \fBdisplay\-invisible\fR [false] .RS Display invisible characters. .P .RE \fBdisplay\-special\fR [false] .RS Display special characters. .P .RE \fBesc\-timeout\fR [100] 0...2000 .RS When 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. .P 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. .P .RE \fBfilesize\-limit\fR [250] .RS 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. .P .RE \fBlock\-files\fR [true] .RS Keep a record of open files, so that a warning can be shown if the same file is accidentally opened in multiple dte processes. .P See also: the \fBFILES\fR section in the \fBdte\fR(1) man page. .P .RE \fBnewline\fR [unix] .RS Whether to use LF (\fBunix\fR) or CRLF (\fBdos\fR) line\-endings in newly created files. .P Note: buffers opened from existing files will have their newline type detected automatically. .P .RE \fBselect\-cursor\-char\fR [true] .RS Whether to include the character under the cursor in selections. .P .RE \fBscroll\-margin\fR [0] .RS Minimum number of lines to keep visible before and after cursor. .P .RE \fBset\-window\-title\fR [false] .RS Set the window title to the filename of the current buffer (if the terminal supports it). .P .RE \fBshow\-line\-numbers\fR [false] .RS Show line numbers. .P .RE \fBstatusline\-left\fR [" %f%s%m%r%s%M"] .RS Format string for the left aligned part of status line. .P .TP \fB%f\fR Filename. .PP .TP \fB%m\fR Prints \fB*\fR if file is has been modified since last save. .PP .TP \fB%r\fR Prints \fBRO\fR for read\-only buffers or \fBTMP\fR for temporary buffers. .PP .TP \fB%y\fR Cursor row. .PP .TP \fB%Y\fR Total rows in file. .PP .TP \fB%x\fR Cursor display column. .PP .TP \fB%X\fR Cursor column as characters. If it differs from cursor display column then both are shown (e.g. \fB2\-9\fR). .PP .TP \fB%p\fR Position in percentage. .PP .TP \fB%E\fR File encoding. .PP .TP \fB%M\fR Miscellaneous status information. .PP .TP \fB%n\fR Line\-ending (\fBLF\fR or \fBCRLF\fR). .PP .TP \fB%N\fR Line\-ending (only if \fBCRLF\fR). .PP .TP \fB%s\fR Separator (a single space, unless the preceding format character expanded to an empty string). .PP .TP \fB%S\fR Like \fB%s\fR, but 3 spaces instead of 1. .PP .TP \fB%t\fR File type. .PP .TP \fB%u\fR Hexadecimal Unicode value value of character under cursor. .PP .TP \fB%%\fR Literal \fB%\fR. .PP .RE \fBstatusline\-right\fR [" %y,%X %u %E%s%b%s%n %t %p "] .RS Format string for the right aligned part of status line. .P .RE \fBtab\-bar\fR [true] .RS Whether to show the tab\-bar at the top of each window. .P .RE \fButf8\-bom\fR [false] .RS Whether to write a byte order mark (BOM) in newly created UTF\-8 files. .P Note: buffers opened from existing UTF\-8 files will have their BOM (or lack thereof) preserved as it was, unless overridden by the \fBsave\fR command. .P .RE .SS Local options \fBbrace\-indent\fR [false] .RS Scan for \fB{\fR and \fB}\fR characters when calculating indentation size. Depends on the \fBauto\-indent\fR option. .P .RE \fBfiletype\fR [none] .RS Type of file. Value must be previously registered using the \fBft\fR command. .P .RE \fBindent\-regex\fR [""] .RS If this \fBregex\fR(7) pattern matches the current line when enter is pressed and \fBauto\-indent\fR is true then indentation is increased. Set to \fB""\fR to disable. .P .RE .SS Local and global options The global values for these options serve as the default values for local (per\-file) options. .P \fBauto\-indent\fR [true] .RS Automatically insert indentation when pressing enter. Indentation is copied from previous non\-empty line. If also the \fBindent\-regex\fR local option is set then indentation is automatically increased if the regular expression matches current line. .P .RE \fBdetect\-indent\fR [""] .RS Comma\-separated list of indent widths (\fB1\fR\-\fB8\fR) to detect automatically when a file is opened. Set to \fB""\fR to disable. Tab indentation is detected if the value is not \fB""\fR. Adjusts the following options if indentation style is detected: \fBemulate\-tab\fR, \fBexpand\-tab\fR, \fBindent\-width\fR. .P Example: .P .IP .nf \f[C] set\ detect\-indent\ 2,3,4,8 \f[] .fi .PP .RE \fBemulate\-tab\fR [false] .RS Make \fBdelete\fR, \fBerase\fR and moving \fBleft\fR and \fBright\fR inside indentation feel as if there were tabs instead of spaces. .P .RE \fBexpand\-tab\fR [false] .RS Convert tab to spaces on insert. .P .RE \fBfile\-history\fR [true] .RS Save and restore cursor positions for previously opened files. .P See also: the \fBFILES\fR section in the \fBdte\fR(1) man page. .P .RE \fBindent\-width\fR [8] .RS Size of indentation in spaces. .P .RE \fBsyntax\fR [true] .RS Use syntax highlighting. .P .RE \fBtab\-width\fR [8] .RS Width of tab. Recommended value is \fB8\fR. If you use other indentation size than \fB8\fR you should use spaces to indent. .P .RE \fBtext\-width\fR [72] .RS Preferred width of text. Used as the default argument for the \fBwrap\-paragraph\fR command. .P .RE \fBws\-error\fR [special] .RS Comma\-separated list of flags that describe which whitespace errors should be highlighted. Set to \fB""\fR to disable. .P .TP \fBauto\-indent\fR If the \fBexpand\-tab\fR option is enabled then this is the same as \fBtab\-after\-indent,tab\-indent\fR. Otherwise it's the same as \fBspace\-indent\fR. .PP .TP \fBspace\-align\fR Highlight spaces used for alignment after tab indents as errors. .PP .TP \fBspace\-indent\fR Highlight space indents as errors. Note that this still allows using less than \fBtab\-width\fR spaces at the end of indentation for alignment. .PP .TP \fBtab\-after\-indent\fR Highlight tabs used anywhere other than indentation as errors. .PP .TP \fBtab\-indent\fR Highlight tabs in indentation as errors. If you set this you most likely want to set "tab\-after\-indent" too. .PP .TP \fBspecial\fR 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). .PP .TP \fBtrailing\fR Highlight trailing whitespace characters at the end of lines as errors. .PP . .SH SEE ALSO \fBdte\fR(1), \fBdte\-syntax\fR(5) .SH AUTHORS Craig Barnes .br Timo Hirvonen