чување 2de6db5d7ef4195f2478d6abb9986eea1e99488f
родитељ d3a1b841e6d6911629932567934c85f49f307b19
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Mon, 29 Apr 2024 18:53:38 +0200
sled.1.in: Convert to mdoc(7)
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
| M | sled.1.in | | | 373 | ++++++++++++++++++++++++++++++++----------------------------------------------- |
измењених датотека: 1, додавања: 149(+), брисања: 224(-)
diff --git a/sled.1.in b/sled.1.in
@@ -1,262 +1,187 @@
-'\" t
-.\" Manpage for sled(1)
-.\" vim: set filetype=groff:
-.
-.mso an-ext.tmac
-.de CDS
-.EX
-.RS \\$1
-.sp 1
-..
-.de CDE
-.sp 1
-.RE
-.EE
-..
-.de RDS
-.RS \\$1
-.sp 1
-..
-.de RDE
-.sp 1
-.RE
-..
-.
-.TH SLED "1" "%DATE%" "sled %VERSION%" "General Commands Manual"
-.SH NAME
-sled \- Simple text editor
-.
-.SH SYNOPSIS
-.
-.SY sled
-.OP "\-h \fR|\fP \-\-help"
-.YS
-.
-.SY sled
-.OP "\-V \fR|\fP \-\-full\-version"
-.YS
-.
-.SY sled
-.OP "\-v \fR|\fP \-\-version"
-.YS
-.
-.SY sled
-.RI [ filename ]
-.YS
-.
-.SH COPYRIGHT
-.
-.LP
-sled Copyright \(co 2022\-2024 Strahinya Radich.
-.br
-This program is licensed under GNU GPL v3 or later.
-See the file
-.I LICENSE
-in the sled repository for details.
-File \fItermbox.h\fR is based on termbox2 TUI library, (c) 2021 termbox
-developers, which is released under the terms of Expat license, see the file
-.IR LICENSE.termbox .
-.
-.SH DESCRIPTION
-.
-.LP
-.B sled
+.\" This program is licensed under the terms of GNU GPL v3 or (at your option)
+.\" any later version. Copyright (C) 2022-2024 Страхиња Радић.
+.\" See the file LICENSE for exact copyright and license details.
+.\" File termbox.h is based on termbox2 TUI library, (c) 2021 termbox
+.\" developers, which is released under the terms of Expat license, see the file
+.\" LICENSE.termbox.
+.Dd %DATE%
+.Dt SLED 1
+.Os
+.Sh NAME
+.Nm sled
+.Nd Simple text editor
+.Sh SYNOPSIS
+.Nm
is a simple text editor with a terminal UI.
-.
-.SH MODES
-.
-.LP
-.B sled
-has four modes of operation. The initial mode which is active on startup is the
-.BR "insert mode" .
-It behaves like one would expect from a \[lq]normal\[rq] text editor: most
-characters are self-inserting, arrow keys and backspace/delete work as expected,
+.Ss Modes
+.Nm
+has four modes of operation.
+.Bl -tag -width Ds
+.It Sy Insert mode
+The initial mode which is active on startup.
+It behaves like one would expect from a
+.Dq normal
+text editor: most
+characters are self-inserting, arrow keys and Backspace/Delete work as expected,
and so on.
-.B Command mode
-behaves more like
-.BR vi (1):
-characters like \fCh\fR, \fCj\fR, \fCk\fR, \fCl\fR no longer insert themselves
-but execute commands (in this case movement commands).
-.B Overwrite mode
-is the same as insert mode, except that newly inserted characters replace the
-existing ones instead of being inserted among them. Last, in
-.BR "selection mode" ,
-moving around the file extends the selection, and most commands that alter text
-instead delete the selection and exit selection mode.
-.
-.SH "KEY BINDINGS"
-.
-.B Global key bindings
-are active in all modes, and are as follows:
-.
+.It Sy "Command mode"
+Command mode behaves more like
+.Xr vi 1 :
+characters like \f[CR]h\fR, \f[CR]j\fR, \f[CR]k\fR, \f[CR]l\fR no longer insert
+themselves but execute commands (in this case movement commands).
+.It Sy "Overwrite mode"
+This is the same as insert mode, except that newly inserted characters replace
+the existing ones instead of being inserted among them.
+.It Sy "Selection mode"
+In this mode, moving around the file extends the selection, and most commands
+that alter text instead delete the selection and exit selection mode.
+.El
+.
+.Ss "Global key bindings"
+These are active in all modes, and are as follows:
.TS
box tab(@);
l l.
\fBKey\fR@\fBAction\fR
_
-\fCEsc\fR@Close dialog, clear error, cancel selection
-\fCF1\fR@Show help dialog
-\fCF3\fR@Go to next found match
-\fCS-F3\fR@Go to previous found match
-\fCF4\fR@Show search, then replace dialog
-\fCF7\fR@Show only search dialog
-\fCHome\fR or \fCC-A\fR@Go to start of line
-\fCPgUp\fR or \fCC-B\fR@Go to previous page
-\fCBackspace\fR@Erase character before cursor
-\fCC-\\\fR@Toggle command mode
-\fCC-C\fR@Yank to paste buffer
-\fCDelete\fR or \fCC-D\fR@Erase character under cursor
-\fCEnd\fR or \fCC-E\fR@Go to end of line
-\fCInsert\fR@Toggle overwrite
-\fCPgDown\fR or \fCC-F\fR@Go to next page
-\fCC-K\fR@Erase to end of line
-\fCC-L\fR@Show Go to line dialog
-\fCC-N\fR@Go to next found match
-\fCC-O\fR@Reread (reopen) file
-\fCC-P\fR@Go to previous found match
-\fCC-Q\fR@Quit
-\fCC-R\fR@Go to previous word
-\fCC-S\fR@Write (save) file
-\fCC-Space\fR@Toggle selection mode
-\fCC-T\fR@Go to next word
-\fCC-U\fR@Erase to start of line
-\fCC-V\fR@Paste from paste buffer
-\fCC-X\fR@Cut to paste buffer
-\fCC-Y\fR@Erase the entire current line
-\fCC-Z\fR@Suspend
-\fCC-W\fR@Erase previous word
+\f[CR]Esc\fR@Close dialog, clear error, cancel selection
+\f[CR]F1\fR@Show help dialog
+\f[CR]F3\fR@Go to next found match
+\f[CR]S-F3\fR@Go to previous found match
+\f[CR]F4\fR@Show search, then replace dialog
+\f[CR]F7\fR@Show only search dialog
+\f[CR]Home\fR or \f[CR]C-A\fR@Go to start of line
+\f[CR]PgUp\fR or \f[CR]C-B\fR@Go to previous page
+\f[CR]Backspace\fR@Erase character before cursor
+\f[CR]C-\\\fR@Toggle command mode
+\f[CR]C-C\fR@Yank to paste buffer
+\f[CR]Delete\fR or \f[CR]C-D\fR@Erase character under cursor
+\f[CR]End\fR or \f[CR]C-E\fR@Go to end of line
+\f[CR]Insert\fR@Toggle overwrite
+\f[CR]PgDown\fR or \f[CR]C-F\fR@Go to next page
+\f[CR]C-K\fR@Erase to end of line
+\f[CR]C-L\fR@Show Go to line dialog
+\f[CR]C-N\fR@Go to next found match
+\f[CR]C-O\fR@Reread (reopen) file
+\f[CR]C-P\fR@Go to previous found match
+\f[CR]C-Q\fR@Quit
+\f[CR]C-R\fR@Go to previous word
+\f[CR]C-S\fR@Write (save) file
+\f[CR]C-Space\fR@Toggle selection mode
+\f[CR]C-T\fR@Go to next word
+\f[CR]C-U\fR@Erase to start of line
+\f[CR]C-V\fR@Paste from paste buffer
+\f[CR]C-X\fR@Cut to paste buffer
+\f[CR]C-Y\fR@Erase the entire current line
+\f[CR]C-Z\fR@Suspend
+\f[CR]C-W\fR@Erase previous word
.TE
.
-.sp 1
-.
-.LP
+.Ss "Insert and overwrite mode key bindings"
In
-.B insert mode
+.Sy insert mode
and
-.BR "overwrite mode" ,
-characters are self-inserting, and \fCEnter\fR inserts new line. All the global
-keys apply to insert mode as well. Entering overwrite mode switches back to
-insert mode when the overwrite mode is toggled off, even when the overwrite mode
-was entered from the command mode.
+.Sy overwrite mode ,
+characters are self\-inserting, and \f[CR]Enter\fR inserts new line.
+All the global keys apply to insert mode as well.
+Entering overwrite mode switches back to insert mode when the overwrite mode is
+toggled off, even when the overwrite mode was entered from the command mode.
.
-.LP
+.Ss "Command mode key bindings"
In
-.BR "command mode" ,
+.Sy "command mode" ,
the following
-.BR vi -like
+.Sy vi Ns \-like
keys are in effect:
-.
.TS
box tab(@);
l l.
\fBKey\fR@\fBAction\fR
_
-\fC/\fR@Show only search dialog
-\fC\\\fR@Show search, then replace dialog
-\fC:\fR@Show Go to line dialog
-\fC0\fR@Go to start of line
-\fC$\fR@Go to end of line
-\fCd\fR@Erase the entire current line
-\fCG\fR@Go to last line in the file
-\fCg\fR@Go to first line in the file
-\fCH\fR@Go to first line on the screen
-\fCh\fR@Go to previous character
-\fCJ\fR@Join lines in selection/line and next line
-\fCj\fR@Go to next line
-\fCk\fR@Go to previous line
-\fCL\fR@Go to last line on the screen
-\fCl\fR@Go to next character
-\fCM\fR@Go to middle line on the screen
-\fCN\fR@Go to previous found match
-\fCn\fR@Go to next found match
-\fCP\fR@Paste from paste buffer
-\fCq\fR@Quit
-\fCR\fR@Toggle overwrite mode
-\fCr\fR@Reread (reopen) file
-\fCv\fR@Toggle selection mode
-\fCW\fR@Go to previous word
-\fCw\fR@Go to next word
-\fCX\fR@Cut to paste buffer
-\fCx\fR@Erase character under cursor
-\fCy\fR@Yank to paste buffer
-\fCZ\fR@Write (save) file
+\f[CR]/\fR@Show only search dialog
+\f[CR]\\\fR@Show search, then replace dialog
+\f[CR]:\fR@Show Go to line dialog
+\f[CR]0\fR@Go to start of line
+\f[CR]$\fR@Go to end of line
+\f[CR]d\fR@Erase the entire current line
+\f[CR]G\fR@Go to last line in the file
+\f[CR]g\fR@Go to first line in the file
+\f[CR]H\fR@Go to first line on the screen
+\f[CR]h\fR@Go to previous character
+\f[CR]J\fR@Join lines in selection/line and next line
+\f[CR]j\fR@Go to next line
+\f[CR]k\fR@Go to previous line
+\f[CR]L\fR@Go to last line on the screen
+\f[CR]l\fR@Go to next character
+\f[CR]M\fR@Go to middle line on the screen
+\f[CR]N\fR@Go to previous found match
+\f[CR]n\fR@Go to next found match
+\f[CR]P\fR@Paste from paste buffer
+\f[CR]q\fR@Quit
+\f[CR]R\fR@Toggle overwrite mode
+\f[CR]r\fR@Reread (reopen) file
+\f[CR]v\fR@Toggle selection mode
+\f[CR]W\fR@Go to previous word
+\f[CR]w\fR@Go to next word
+\f[CR]X\fR@Cut to paste buffer
+\f[CR]x\fR@Erase character under cursor
+\f[CR]y\fR@Yank to paste buffer
+\f[CR]Z\fR@Write (save) file
.TE
.
-.sp 1
-.
-.LP
+.Ss "Selection mode key bindings"
If
-.B selection mode
+.Sy selection mode
was entered from insert mode (or insert mode is activated during selection
-mode), typing any self-inserting character or activating key bindings which
-modify text, like \fCDelete\fR or \fCC-K\fR, will erase the selected text
-instead, and in the case of self-inserting characters, insert the character in
+mode), typing any self\-inserting character or activating key bindings which
+modify text, like \f[CR]Delete\fR or \f[CR]C-K\fR, will erase the selected text
+instead, and in the case of self\-inserting characters, insert the character in
question, exiting the selection mode.
-.
-.PP
+.Pp
Similar holds true when the selection mode is entered from the command mode or
-the command mode is activated during the selection mode, except that
-.BR vi -like
+the command mode is activated during the selection mode, except that
+.Sy vi Ns \-like
key bindings which modify text will have the effect on the selection.
.
-.sp 1
-.
-.
-.SH "STATUS LINE"
-.
-.LP
+.Ss "Status line"
Status line is comprised of a number of segments, by default four.
-.
-.IP \(bu 4
-The leftmost segment displays the current filename, with an asterisk (\fC*\fR)
-if there are any unsaved changes.
-.
-.IP \(bu
+.Bl -bullet -width 1m
+.It
+The leftmost segment displays the current filename, with an asterisk
+(\f[CR]*\fR) if there are any unsaved changes.
+.It
Second segment displays the current mode.
-.
-.IP \(bu
+.It
Third segment displays the current position within the file, in the form
-.
-.CDS 8
-[column]:[row] ([percentage of total lines]%)
-.CDE
-.
-.IP \(bu 4
+.Dl [column]:[row] ([percentage of total lines]%)
+.It
Fourth segment shows quick help.
+.El
.
-.SH AUTHOR
-.
-Strahinya Radich,
-.UR https://\:strahinja.org
-.UE
+.Sh AUTHORS
+.An "Strahinya Radich" Aq contact@strahinja.org ,
+2022\-2024
.
-.SH "KNOWN LIMITATIONS"
+.Sh BUGS
+Bugs can be reported using the ticket tracker at:
+.Lk https://\:todo.sr.ht/\:~strahinja/\:sled
.
-.IP \(bu 4
+.Ss "Known limitations"
+.Bl -bullet -width 1m
+.It
UTF-8 character set is assumed.
-.
-.IP \(bu
-CJK characters are unsupported/problematic. This is a limitation of termbox
-library. See
-.
-.IP "" 4
-.UR https://\:github.com/\:nsf/\:termbox
-.UE
-.
-.IP
+.It
+CJK characters are unsupported/problematic.
+This is a limitation of termbox library.
+See
+.Lk https://\:github.com/\:nsf/\:termbox
for more details.
-.
-.IP \(bu
+.It
Only one file can be edited at a time, and no additional files can be loaded at
-runtime. This is a design decision.
-.
-.IP \(bu
-If backup creation is enabled (\fCCREATE_BACKUPS\fR in \fIconfig.h\fR), the
-directory of the edited file must be writable by the user to open the file.
-.
-.SH BUGS
-.
-.LP
-Bugs can be reported using the ticket tracker at:
-.UR https://\:todo.sr.ht/\:~strahinja/\:sled
-.UE
+runtime.
+This is a design decision.
+.It
+If backup creation is enabled
+.Pq Dv CREATE_BACKUPS No in Pa config.h ,
+the directory of the edited file must be writable by the user to open the file.
+.El