免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: projl
打印 上一主题 下一主题

《Learning the vi editor》 [复制链接]

论坛徽章:
0
281 [报告]
发表于 2008-06-11 16:34 |只看该作者
insert began.
backup-style off
Controls how backup files are created
when writing a file. Possible values are
off for no backups, .bak for DOS style
backups, and tilde for emacs style
hello.c~ backups under UNIX.
bcolor Sets the background color on systems
that support it.
check-modtime nocheck-modtime
Issues a file newer than buffer warning
if the file has changed since last read or
written, and prompts for confirmation.
cmode off A built-in major mode for C code.
comment-prefix ^\s*\(\s*[#*>]\)\+
Describes the leading part of a line that
should be left alone when reformatting
comments. The default value is good for
Makefile, shell and C comments, and
email.
comments ^\s*/\?\(\s*[#*>]
\)\+/\?\s*$
A regular expression defining
commented paragraph delimiters. Its
purpose is to preserve paragraphs
inside comments when reformatting.
dirc nodirc
vile checks each name when scanning
directories for filename completion. This
allows you to distinguish between
directory names and filenames in the
prompt.
dos nodos
Strips out the CR from CR-LF pairs
when reading files, and puts them back
when writing. New buffers for nonexistent
files inherit the line-style of the
operating system, whatever the value
of dos.
fcolor Sets the foreground color on systems
that support it.
fence-begin /\* Regular expressions for the start and
end of simple, non-nestable fences,
such as C comments. fence-end \*/
fence-if ^\s*#\s*if Regular expression marking the start,
"else if," "else," and end of line-
oriented, nested fences, such as C-
preprocessor control lines.
fence-elif ^\s*#\s*elif\>
fence-else ^\s*#\s*else\>
fence-fi ^\s*#\s*endif\>
fence-pairs { }( )[ ] Each pair of characters denotes a set of
"fences" that should be matched with %.
glob !echo %s
Controls how wildcard characters (e.g.,
* and ?) are treated in prompts for
filenames. A value of off disables
expansion, and on uses the internal
globber, which can handle normal shell
wildcards and ~ notation. The default
value for UNIX guarantees compatibility
with your shell.
history (hi) history Logs commands from the colon

论坛徽章:
0
282 [报告]
发表于 2008-06-11 16:35 |只看该作者
command line in the [History] buffer.
horizscroll
(hs) horizscroll
Moving off the end of a long line shifts
the whole screen sideways. If not set,
only the current line shifts.
linewrap (lw) nolinewrap Wraps long logical lines onto multiple
screen lines.
maplonger nomaplonger
The map facility matches against the
longest possible mapped sequence, not
the shortest.
meta-insertbindings
(mib) nomib
Controls behavior of 8-bit characters
during insert. Normally, key-bindings
are only operational when in command
mode: when in insert mode, all
characters are self-inserting. If this
mode is on, and a meta-character (i.e.,
a character with the eighth bit set) is
typed which is bound to a function, then
that function binding will be honored
and executed from within insert mode.
Any unbound meta-characters will
remain self-inserting.
mini-edit ^G The character that toggles the editing
mode in the minibuffer.
mini-hilite
(mh) reverse
Defines the highlight attribute to use
when the user toggles the editing mode
in the minibuffer.
popup-choices(pc) delayed
Controls the use of a pop-up window for
help in doing completion. The value is
one of off for no window, immediate
for an immediate pop-up, and delayed
to wait for a second TAB key.
preamble (pre)
A regular expression describing the first
line of filenames for which the
corresponding major mode will be set.
resolve-links noresolve-links
If set, vile fully resolves filenames in
cases where some path components are
symbolic links. This helps avoid multiple
unintentional edits of the same physical
file via different pathnames.
ruler noruler
Shows the current line and column in
the status line, as well as what
percentage of the current buffer's lines
lie in front of the cursor.
showmode (smd) noshowmode Display an indicator on the modeline for
insert and replace modes.
sideways 0
Prompts for a new value for the
sideways scroll offset, which controls by
how many characters the screen scrolls
to the left or right. The value of 0
moves the screen by one third.
suffixes (suf)
A regular expression describing
filenames for which the corresponding
major mode will be set. Used as part of

论坛徽章:
0
283 [报告]
发表于 2008-06-11 16:35 |只看该作者
the major mode facility, not by itself.
tabinsert (ti) tabinsert
Allow the physical insertion of tab
characters into the buffer. If turned off
(notabinsert), vile will never insert a
TAB into a buffer; instead it will always
insert the appropriate number of
spaces.
tagignorecase(tc) notagignorecase Makes tag searches ignore case.
taglength (tl) 0
Defines number of characters that are
significant for tags. Default (zero)
means that all characters are
significant. This does not effect tags
picked up from the cursor, they are
always matched exactly. (This is
different from the other editors.)
tagrelative(tr) tagrelative
When using a tags file in another
directory, filenames in that tags file are
considered to be relative to the
directory where the tags file is.
tags tags
A space separated list of files in which
to look up tag references.
tagword (tw) notagword
Uses the whole word under the cursor
for the tag lookup, not just the sub-
word starting at the current cursor
position.
undolimit (ul) 10
Limits how many changes may be
undone. The value zero means "no
limit."
unprintable-asoctal
(uo)
nounprintable-asoctal
Displays non-printing characters with
the eighth bit set in octal. Otherwise,
uses hexadecimal. Non-printing
characters whose eighth bit is not set
are always displayed in control
character notation.
visual-matches none
Controls highlighting of all matching
occurrences of a search pattern. The
possible values are none for no
highlighting, or underline, bold, and
reverse for those kinds of highlighting.
Colors may also be used on systems
that support it.
xterm-mouse noxterm-mouse Allows use of the mouse from inside an
xterm. See the online help for details.

论坛徽章:
0
284 [报告]
发表于 2008-06-11 16:36 |只看该作者
Appendix D. Problem Checklists

This appendix consolidates the problem checklists that are provided
throughout the text. Here they are presented in one place for ease
of reference.

D.1 Problems Opening Files

论坛徽章:
0
285 [报告]
发表于 2008-06-11 16:36 |只看该作者

论坛徽章:
0
286 [报告]
发表于 2008-06-11 16:37 |只看该作者
The disk with vi's temporary files is filled up. Type :!ls /tmp to see
whether there are any files you can remove to gain some disk space.[A] If
there are, create a temporary UNIX shell from which you can remove files
or issue other UNIX commands. You can create a shell by typing :sh; type
CTRL-D or exit to terminate the shell and return to vi. (On most UNIX
systems, when using a job-control shell, you can simply type CTRL-Z to
suspend vi and return to the UNIX prompt; type fg to return to vi.) Once
you've freed up some space, write your file with :w!.

[A] Your vi may keep its temporary files in /usr/tmp, /var/tmp, or your current directory; you may
need to poke around a bit to figure out where exactly you've run out of room.

论坛徽章:
0
287 [报告]
发表于 2008-06-11 16:37 |只看该作者
other hand, a U will restore the line to its pristine state; the way it was
before any changes were applied to it.

You can still recover a recent deletion, however, by using the p command,
since vi saves the last nine deletions in nine numbered deletion buffers. If
you know, for example, that the third deletion back is the one you want to
restore, type:

"3p

to "put" the contents of buffer number 3 on the line below the cursor. This
works only for a deleted line. Words, or a portion of a line, are not saved
in a buffer. If you want to restore a deleted word or line fragment, and u
won't work, use the p command by itself. This restores whatever you've
last deleted.

论坛徽章:
0
288 [报告]
发表于 2008-06-11 16:38 |只看该作者
Appendix E. vi and the Internet

Sure, vi is friendly. It's just particular about who it makes friends
with.

Being the "standard" UNIX screen editor since at least 1980 has
enshrined vi firmly in UNIX culture.

vi helped build UNIX, and UNIX in turn built the foundation for
today's Internet. Thus, it was inevitable that there be at least one
Internet web site devoted to vi. This appendix describes some of
the vi resources that are available for the vi connoisseur.

Where to start: There is surely no activity with more built-in
obsolescence than publishing World Wide Web sites in a printed
book. We have tried to publish URLs that we hope will have a
reasonable lifetime.

In the meantime, the "Tips" section of the elvis documentation lists
interesting vi-related web sites (that's where we started), and the
USENET comp.editors newsgroup is also a good place to look.

E.1 vi Web Sites
There are two primary vi-related web sites, the vi Lover's Home Page, by Thomer

M. Gil, and the Vi Pages, by Sven Guckes. Each contains a large number of links
to interesting vi-related items.
E.1.1 The vi Lover's Home Page
The vi Lover's Home Page can be found at
http://www.thorner.com/thorner/vi/vi.html. This site contains the following
items:

论坛徽章:
0
289 [报告]
发表于 2008-06-11 16:39 |只看该作者

论坛徽章:
0
290 [报告]
发表于 2008-06-11 16:39 |只看该作者
E.1.4 vi for Java Lovers
Despite the title, this subsection is about the java you drink, not the Java you
program in.[A]

[A] Although it's fitting, somehow, that Java came from Sun Microsystems, where Bill Joy, vi's original author,
is a founder and vice president.
Our hypothetical Real Programmer, while using vi to write her C++ code, her troff
documentation, and her web page, undoubtedly will want a cup of coffee now and
then. She can now drink her coffee from a mug with a vi command reference
printed on it!

The URL is http://www.vireference.com/vimug.htm. The mugs come in sets of
four, with a concise vi command summary printed on the mug. The web site has
pricing and shipping information; you might want to split a set of four with one or
more friends.

E.1.5 Online vi Tutorial
The two home pages have a large number of links to documentation on vi. Of
special note, though, is a nine-part online tutorial from Unix World magazine, by
Walter Zintz. The starting off point is
http://www.wcmh.com/uworld/archives/95/tutorial/009/009.html. (You're
probably better off just following the link from one of two vi home pages.) The
tutorial covers the following topics:

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP