summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJason McIntyre <jmc@cvs.openbsd.org>2004-02-20 19:56:54 +0000
committerJason McIntyre <jmc@cvs.openbsd.org>2004-02-20 19:56:54 +0000
commitddd7a668afa8ef97564a89c566115a4abe12033c (patch)
treeb2d82d8bd1455f1b52be0cb05421e8a57d4c0ce6 /usr.bin
parentd259b9d232efc31e4e02054545c42bce17f79211 (diff)
add section on helpful ex options;
suggested by and ok millert@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/vi/docs/USD.doc/edit/edittut.ms82
1 files changed, 81 insertions, 1 deletions
diff --git a/usr.bin/vi/docs/USD.doc/edit/edittut.ms b/usr.bin/vi/docs/USD.doc/edit/edittut.ms
index 6a1835769e5..2ec9bf143a6 100644
--- a/usr.bin/vi/docs/USD.doc/edit/edittut.ms
+++ b/usr.bin/vi/docs/USD.doc/edit/edittut.ms
@@ -1,4 +1,4 @@
-.\" $OpenBSD: edittut.ms,v 1.6 2004/02/09 21:09:10 jmc Exp $
+.\" $OpenBSD: edittut.ms,v 1.7 2004/02/20 19:56:53 jmc Exp $
.\"
.\" Copyright (c) 1980, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -147,6 +147,7 @@ Reading additional files (r)\ \ \ 21
Writing parts of the buffer\ \ \ 21
Recovering files\ \ \ 21
Other recovery techniques\ \ \ 21
+Options, set, and editor startup files\ \ \ 22
Further reading and other information\ \ \ 22
.in -.5i
.sp
@@ -2215,6 +2216,84 @@ command.
After fixing the damaged buffer, you can again write the file
to disk.
.SH
+Options, set, and editor startup files
+.PP
+The editor has a set of options, some of which have been mentioned above.
+The most useful options are given in the following table.
+.PP
+The options are of three kinds: numeric options, string options, and
+toggle options. You can set numeric and string options by a statement
+of the form
+.DS
+\fBset\fR \fIopt\fR\fB=\fR\fIval\fR
+.DE
+and toggle options can be set or unset by statements of one of the forms
+.DS
+\fBset\fR \fIopt\fR
+\fBset\fR \fBno\fR\fIopt\fR
+.DE
+.KF
+.TS
+lb lb lb lb
+l l l a.
+Name Default Description
+_
+autoindent noai Supply indentation automatically
+autowrite noaw Automatic write before \fB:n\fR, \fB:ta\fR, \fB^^\fR, \fB!\fR
+ignorecase noic Ignore case in searching
+.\" lisp nolisp \fB( { ) }\fR commands deal with S-expressions
+list nolist Tabs print as ^I; end of lines marked $
+magic magic . [ and * are special in scans
+number nonu Lines prefixed with line numbers
+report report=5 Number of line which editor reports after changes.
+shiftwidth sw=8 Shift distance for <, > and \fB^D\fP and \fB^T\fR
+term $TERM The kind of terminal you are using.
+.TE
+.KE
+These statements can be placed in your EXINIT in your environment,
+or given while you are running
+.I ex
+by typing them at the \fB:\fR prompt and following them with a \s-2CR\s0.
+.PP
+You can get a list of all options which you have changed by the
+command \fB:set\fR\s-2CR\s0, or the value of a single option by the
+command \fB:set\fR \fIopt\fR\fB?\fR\s-2CR\s0.
+A list of all possible options and their values is generated by
+\fB:set all\fP\s-2CR\s0.
+Set can be abbreviated \fBse\fP.
+Multiple options can be placed on one line, e.g.
+\fB:se ai aw nu\fP\s-2CR\s0.
+.PP
+Options set by the \fBset\fP command only last
+while you stay in the editor.
+It is common to want to have certain options set whenever you
+use the editor.
+This can be accomplished by creating a list of commands
+which are to be run every time you start up \fIex\fP.
+For example:
+.DS
+\fBset\fP ai ic report=1
+.DE
+sets the options \fIautoindent\fP, \fIignorecase\fP, and \fIreport\fP
+(to the value of 1).
+This string should be placed in the variable EXINIT in your environment.
+If you use the shell \fIcsh\fP,
+put this line in the file
+.I .login
+in your home directory:
+.DS I
+setenv EXINIT 'set ai ic report=1'
+.DE
+If you use the standard shell \fIsh\fP,
+put these lines in the file
+.I .profile
+in your home directory:
+.DS
+export EXINIT='set ai ic report=1'
+.DE
+Of course, the particulars of the line would depend on which options
+you wanted to set.
+.SH
Further reading and other information
.PP
These lessons are intended to introduce you to the editor
@@ -2330,6 +2409,7 @@ non-printing characters, 10
``Not an editor command'' (message), 6
``Not that many lines in buffer'' (message), 18
number (nu) command, 11
+options, 22
password, 5
period (\|.\|), 11, 17
plus (+), 17