sortix-mirror/editor/editor.1
Juhani Krekelä 5e666dce8a Change go to line keybind in editor(1) from ^I to ^G
Since this is a console program, ctrl + letter gets mapped to a
control character in the range 1 to 26. Most of these control
characters are no longer in use and can safely be assumed to be
result of ctrl + letter, but ^I maps to the tab character.

I chose ^G since the keybind is memorable, and a user is unlikely
to try to type the BEL character.
2021-05-02 22:42:37 +02:00

81 lines
1.6 KiB
Groff

.Dd January 8, 2016
.Dt EDITOR 1
.Os
.Sh NAME
.Nm editor
.Nd text editor
.Sh SYNOPSIS
.Nm editor
.Op Ar file
.Sh DESCRIPTION
.Nm
is a text editor with basic editing functionality.
It generally behaves like a GUI editor as opposed to common terminal editors.
The file named by the
.Ar file
argument is loaded if specified.
It quits when
.Sy Ctrl-Q
is typed.
.Pp
Text can be selected by holding the
.Sy Shift
key and moving the cursor.
.Pp
It supports these keyboard shortcuts:
.Bl -tag -width "12345768"
.It Sy Ctrl-C
Copy.
.It Sy Ctrl-G
Go to line.
.It Sy Ctrl-K
Cut.
.It Sy Ctrl-O
Open file.
.It Sy Ctrl-Q
Quit.
.It Sy Ctrl-S
Save file.
.It Sy Ctrl-V
Paste.
.El
.Pp
These commands than can be entered after pressing
.Sy ESC
and a colon:
.Bl -tag -width "12345768"
.It Sy language Oo Sy none "|" Sy c "|" Sy c++ "|" Sy diff Oc
Select syntax highlighting.
.It Sy line-numbering Oo Sy on "|" Sy off Oc
Line numbering.
.It Sy margin Ar column-index
Display right margin at
.Ar column-index .
.It Sy popen Ar shell-command
Open new file containing output of running
.Ar shell-command .
.It Sy tabsize Ar tab-size
Select tab size.
.El
.Pp
A subset of these commands can be stored in the
.Xr editor 5
configuration file loaded on
.Nm
startup.
.Sh FILES
.Bl -tag -width "$HOME/.editor" -compact
.It Pa /etc/editor
Global configuration.
.It Pa ~/.editor
User configuration.
.El
.Sh SEE ALSO
.Xr pager 1 ,
.Xr editor 5
.Sh BUGS
.Nm
lacks a number of crucial features, such as undo and redo, ability to open
multiple files at once, and so on.
The syntax highlighting can occasionally be inconsistent.