GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DTE(1) FreeBSD General Commands Manual DTE(1)

dte - A small, configurable text editor

dte [-HR] [-c command] [-t ctag] [-r rcfile] [[+line[,column]] file]...
dte [-h|-B|-K|-V|-b rcname|-s file]

Run command, after reading the rc file and opening any file arguments. See dterc(5) for available commands.
Jump to source location of ctag. Requires tags file generated by ctags(1).
Read configuration from rcfile instead of ~/.dte/rc.
Load file as a dte-syntax(5) file and exit. Any errors encountered are printed to stderr(3) and the exit status is set appropriately.
Dump the contents of the built-in rc or syntax file named rcname and exit.
Print a list of all built-in config names that can be used with the -b option and exit.
Don't load history files at startup or save history files on exit (see FILES section below). History features will work as usual but will be in-memory only and not persisted to the filesystem.
Don't read the rc file.
Start in a special mode that continuously reads input and prints the symbolic name of each pressed key.
Display the help summary and exit.
Display the version number and exit.

+line,column arguments can be used to specify the initial cursor position of the next file argument. These can also be specified in the format +line:column.

There are 3 editor modes, each having a different set of key bindings. Bindings can be customized using the bind command (see dterc(5)) or displayed using the show bind command.

The key bindings listed below are in the same format as accepted by the bind command. In particular, key combinations are represented as follows:

M-x is Alt+x
C-v (or ^V) is Ctrl+v
S-left is Shift+left
C-M-S-left is Ctrl+Alt+Shift+left

Normal mode is the mode the editor starts in. Pressing basic keys (i.e. without modifiers) simply inserts text into the buffer. There are also various key combinations bound by default:

Move cursor and select characters
Move cursor and select whole words
Move cursor and select whole lines
Copy current line or selection
Cut current line or selection
Paste
Undo
Redo
Enter command mode
Enter search mode
Search next
Search previous
Open new buffer
Switch to buffer 1 (or 2, 3, 4, etc.)
Close current buffer
Save
Quit

Command mode allows running various editor commands using a language similar to Unix shell. The next and prev commands switch to the next/previous file. The open, save and quit commands should be self-explanatory. For a full list of available commands, see dterc(5).

The key bindings for command mode are:

Browse previous command history.
Auto-complete current command or argument
Go to beginning of command line
Move left
Exit command mode
Delete
Go to end of command line
Move right
Delete to end of command line
Delete to beginning of command line
Erase word

Search mode allows entering a regular expression to search in the current buffer.

The key bindings for search mode are mostly the same as in command mode, plus these additional keys:

Toggle case sensitive search option.
Reverse search direction.
Perform regex search.
Perform plain-text search (escapes the regex).

The following environment variables are inspected at startup:

User configuration directory. Defaults to $HOME/.dte if not set.
User home directory. Used when expanding ~/ in filenames and also to determine the default value for DTE_HOME.
Directory used to store lock files. Defaults to $DTE_HOME if not set.
Terminal identifier. Used to determine which terminal capabilities are supported.
Enables support for 24-bit terminal colors, if set to truecolor or 24bit.

The following environment variables affect various library routines used by dte and are inspected on every use:

Colon-delimited list of directory prefixes, used by execvp(3) to find executables.

The following environment variables are set by dte:

Editor version string. This is set at startup to the same version string as shown by dte -V.
Absolute path of the current working directory; set when changing directory with the cd command.
Absolute path of the previous working directory; set when changing directory with the cd command and also used to determine which directory cd - switches to.

$DTE_HOME/rc
User configuration file. See dterc(5) for a full list of available commands and options or run "dte -b rc" to see the built-in, default config.
$DTE_HOME/syntax/*
User syntax files. These override the syntax files that come with the program. See dte-syntax(5) for more information or run "dte -b syntax/dte" for a basic example.
$DTE_HOME/file-history
History of edited files and cursor positions. Used only if the file-history option is enabled.
$DTE_HOME/command-history
History of dterc(5) commands used while in command mode.
$DTE_HOME/search-history
History of search patterns used while in search mode.
$XDG_RUNTIME_DIR/dte-locks
List of files currently open in a dte process (if the lock-files option is enabled).

0
Program exited normally.
64
Command-line usage error (see "synopsis" above).
65
Input data error (e.g. data specified by the -s option).
71
Operating system error.
74
Input/output error.
78
Configuration error.

Note: the above exit codes are set by the editor itself, with values in accordance with sysexits(3). The exit code may also be set to values in the range 0..125 by the quit command.

Open /etc/passwd with cursor on line 3, column 8:

dte +3:8 /etc/passwd

Run several commands at startup:

dte -c 'set filetype sh; insert -m "#!/bin/sh\n"'

Read a buffer from standard input:

echo 'Hello, World!' | dte

Interactively filter a shell pipeline:

echo 'A B C D E F' | tr ' ' '\n' | dte | tac

It's advised to NOT run shell pipelines with multiple interactive programs that try to control the terminal. For example:

echo "Don't run this example!!" | dte | less

A shell will run these processes in parallel and both dte(1) and less will then try to control the terminal at the same time; clobbering the input/output of both.

dterc(5), dte-syntax(5)

Craig Barnes
Timo Hirvonen

October 2022

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.