DTE(1)
π DTE(1) π
okay bestie, gather round, because today we're talking about dte β a small, configurable text editor. yes. small. configurable. text editor. she's giving tiny-but-mighty, she's giving main character energy, and honestly? we're obsessed. π
β¨ NAME β¨
dte β a small, configurable text editor π¦
β¨ SYNOPSIS β¨
dte [-HR] [-c command] [-t ctag] [-r rcfile] [[+line] file]...
dte [-h|-B|-K|-V|-b rcname|-s file]
β¨ OPTIONS β¨
okay so here's the whole flag menu, no skips, no skips at all, we're listing every single one:
-ccommand β runs command β but like, after the rc file gets read and after any file arguments get opened. (the order matters, bestie, don't come for me.) peepdterc(5)for the commands you can use here.-tctag β jumps straight to the source location of ctag. heads up: this needs a tags file that was generated byctags(1).-rrcfile β reads config from rcfile instead of~/.dte/rc. your usual file? ghosted. π-sfile β loads file as adte-syntax(5)file and then exits. any errors it hits get printed tostderr(3)and the exit status gets set accordingly.-brcname β dumps the contents of the built-in rc or syntax file named rcname, then dips. bye.-Bβ prints a whole list of every built-in config name you could use with the-boption, then exits.-Hβ don't load history files at startup and don't save them on exit (scroll down to the FILES section for the deets). history stuff still works exactly like normal, it's just in-memory only and never persisted to the filesystem. so it's likeβ¦ a memory. gone the second you leave. π-Rβ don't read the rc file at all. rebellious. love that for her.-Kβ starts in a special mode that just continuously reads input and prints the symbolic name of every key you press. it's a keypress x-ray basically. π₯-hβ shows the help summary and exits.-Vβ shows the version number and exits.-brcname β (yes we're doing it again, it's literally listed twice up there in the options block, keep both, that's the vibe) dumps the built-in rc or syntax file named rcname and exits.
wait, okay, one sec β the original options section lists -b rcname twice, once near the top and once at the bottom of the list. so we keep both. consistency queen. π
β¨ KEY BINDINGS β¨
so there are 3 editor modes and each one has its own set of key bindings. the Normal mode bindings can be customized with the bind command (check dterc(5)) or you can just look at them with the show bind command.
the bindings below are written in the exact same format the bind command accepts. and specifically, key combos look like this:
M-xis Alt+xC-V(or^V) is Ctrl+vS-leftis Shift+leftC-M-S-leftis Ctrl+Alt+Shift+left
π¦ Normal Mode
Normal mode is where the editor starts. pressing the basic keys (like, the ones with no modifiers) just inserts text into the buffer. plain and simple. but there are also a bunch of key combos bound by default:
S-up,S-down,S-left,S-rightβ move the cursor and select charactersC-S-left,C-S-rightβ move the cursor and select whole wordsC-S-up,C-S-downβ move the cursor and select whole lines^Cβ copy the current line or the selection^Xβ cut the current line or the selection^Vβ paste^Zβ undo^Yβ redoM-xβ enter command mode^Fβ enter search modeF3β search nextF4β search previous^Tβ open a new bufferM-1,M-2...M-9β switch to buffer 1 (or 2, 3, 4, etc.)^Wβ close the current buffer^Sβ save^Qβ quit
πΈ Command Mode
Command mode is where you run all kinds of editor commands, using a language that's similar to a Unix shell. the next and prev commands switch to the next/previous file. the open, save and quit commands are pretty self-explanatory honestly, you got this. for the full list of available commands, go read dterc(5).
the key bindings for command mode are:
up,downβ browse the previous command historytabβ auto-complete the current command or argument^A,homeβ go to the beginning of the command line^B,leftβ move left^C,^G,Escβ exit command mode^D,deleteβ delete^E,endβ go to the end of the command line^F,rightβ move right^K,M-deleteβ delete to the end of the command line^Uβ delete to the beginning of the command line^W,M-C-?(Alt+Backspace) β erase word
π§ Search Mode
Search mode lets you type in a regular expression to search the current buffer.
the key bindings for search mode are mostly the same as command mode, plus these extra keys:
M-cβ toggle the case sensitive search option.M-rβ reverse the search direction.Enterβ perform the regex search.M-Enterβ perform a plain-text search (it escapes the regex for you π«Ά).
β¨ ENVIRONMENT β¨
these environment variables get inspected at startup:
DTE_HOMEβ the user configuration directory. defaults to$HOME/.dteif it's not set.HOMEβ the user home directory. used when expanding~/in filenames, and also used to figure out the default value forDTE_HOME.XDG_RUNTIME_DIRβ the directory used to store lock files. defaults to$DTE_HOMEif it's not set.TERMβ the terminal identifier. used to determine which terminal capabilities are supported.COLORTERMβ enables support for 24-bit terminal colors, if it's set totruecolor. π
β¨ FILES β¨
$DTE_HOME/rcβ the user configuration file. seedterc(5)for a full list of available commands and options, or rundte -b rcto see the built-in, default config.$DTE_HOME/syntax/*β user syntax files. these override the syntax files that come with the program. seedte-syntax(5)for more info, or rundte -b syntax/dtefor a basic example.$DTE_HOME/file-historyβ history of edited files and cursor positions. only used if thefile-historyoption is enabled.$DTE_HOME/command-historyβ history ofdterc(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 thelock-filesoption is enabled).
β¨ EXIT STATUS β¨
0β program exited normally. slay. π64β command-line usage error (see "synopsis" above).65β input data error (e.g. data specified by the-soption).71β operating system error.74β input/output error.
Note: those exit codes above are set by the editor itself, with values that are in accordance withsysexits(3). the exit code can also be set to values in the range0..125by thequitcommand. so yeah, don't assume it's always one of the five above. π
β¨ EXAMPLES β¨
open /etc/passwd with the cursor sitting on line 3:
dte +3 /etc/passwd
run a few 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
β¨ NOTES β¨
bestie. listen. it is 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 then both dte(1) and less will try to control the terminal at the same time, clobbering the input/output of both of them. it's giving chaos, it's giving π, it's giving absolutely not. do not.
β¨ SEE ALSO β¨
β¨ AUTHORS β¨
- Craig Barnes
- Timo Hirvonen
and that's the whole page, bestie!! this one's from February 2021, and it's the DTE(1) manual β from the General Commands Manual, iykyk. go forth and edit text, you absolute icon. ππβ¨
π¦ where this page comes from
- debian bookworm: dte 1.10-1 Β· GPL-2.0-only
- debian trixie: dte 1.10-1 Β· GPL-2.0-only
- ubuntu jammy: dte 1.10-1 Β· GPL-2.0-only
- ubuntu noble: dte 1.10-1 Β· GPL-2.0-only
- ubuntu resolute: dte 1.10-1build1 Β· GPL-2.0-only
- ubuntu stonking: dte 1.10-1build1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms