Saving and Quitting a File see also vi commands screen editors 1.. Review of Basic vi Commands filter through command : 7.2.1.. Executing UNIX Commands filter text through : 7.2.1.. The
Trang 1on new line (O, o) : 2.4 More Ways to Insert Text
text (i) : 1 The vi Text Editor
insert mode : 2.1 vi Commands
mapping : 7.3.6 Mapping Keys for Insert Mode
intelligent terminal : 2.3.1 Inserting New Text
A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Copyright © 1998 O'Reilly & Associates, Inc All Rights Reserved
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_i.htm [2/6/2001 10:03:17 PM]
Trang 3A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Index: L
line addresses : 5.2.1 Line Addresses
absolute : 5.2.2 Defining a Range of Lines
redefining current line : 5.2.5 Redefining the Current Line Position
relative : 5.2.3 Line Addressing Symbols
search patterns : 5.2.4 Search Patterns
symbols : 5.2.3 Line Addressing Symbols
Trang 4Index: M
mapping
commands : 7.3.2 Using the map Command
examples : 7.3.4 Complex Mapping Example
editing multiple files : 7.3.5 More Examples of Mapping Keysrepeating long insertion : 7.3.5 More Examples of Mapping Keysreusing a valid command key : 7.3.5 More Examples of Mapping Keyssurrounding word with font codes : 7.3.5 More Examples of Mapping Keystransposing words : 7.3.5 More Examples of Mapping Keys
function keys : 7.3.7 Mapping Function Keys
insert mode : 7.3.6 Mapping Keys for Insert Mode
keys unused in vi : 7.3.2 Using the map Command
quoting special characters : 7.3.3 Protecting Keys from Interpretation by ex
special keys : 7.3.8 Mapping Other Special Keys
mark a place in a file (m) : 4.4 Marking Your Place
matching braces : 7.5.2 A Special Search Command
metacharacters
in replacement strings : 6.3.2 Metacharacters Used in Replacement Strings
in search patterns : 6.3.1 Metacharacters Used in Search Patterns
mode
command
1 The vi Text Editor2.1 vi Commandsinsert
2.1 vi Commands7.3.6 Mapping Keys for Insert Moderead-only : 4.2.2 Read-only Mode
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_m.htm (1 of 2) [2/6/2001 10:03:20 PM]
Trang 5combining with edit command
2.3.3.1 Words4.1 More Command Combinationsrange of lines (:m) : 5.2.2 Defining a Range of Lines
text (delete and put)
2.3.6 Moving Text2.3.7 Copying Text
A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Copyright © 1998 O'Reilly & Associates, Inc All Rights Reserved
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_m.htm (2 of 2) [2/6/2001 10:03:20 PM]
Trang 6Index: N
numeric arguments
with edit commands : 2.3.3.1 Words
with insert commands : 2.4.1 Numeric Arguments for Insert Commandswith movement commands : 2.2.2 Numeric Arguments
A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Copyright © 1998 O'Reilly & Associates, Inc All Rights Reserved
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_n.htm [2/6/2001 10:03:20 PM]
Trang 7A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Index: O
opening a file (vi)
1.1 Opening and Closing Files
Trang 8Index: P
pattern matching : (see search and global replacement)
problem checklist : D Problem Checklist
put text (p)
2.3.5.4 Problems with Deletions
2.3.6 Moving Text
2.3.7 Copying Text
2.6 Review of Basic vi Commands
4.3.2 Yanking to Named Buffers
Trang 91.1.3 Saving and Quitting a File1.2 Quitting Without Saving Edits1.2.1 Problems Saving Files
2.6 Review of Basic vi Commandswithout saving edits (:q!)
1.1.2 Problems Opening Files1.2 Quitting Without Saving Edits2.6 Review of Basic vi Commands5.3 Saving and Exiting Files
A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Copyright © 1998 O'Reilly & Associates, Inc All Rights Reserved
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_q.htm [2/6/2001 10:03:24 PM]
Trang 10Index: R
read-only mode : 4.2.2 Read-only Mode
reading in files : 5.4 Copying a File into Another File
recovering
buffers after a system crash : 4.2.3 Recovering a Buffer
deletions : 4.3 Making Use of Buffers
from numbered buffers
2.3.5.4 Problems with Deletions4.3.1 Recovering Deletionswith u : 2.3.5.4 Problems with Deletionsredrawing the screen : 3.1.3 Redrawing the Screen
regular expressions
in replacement strings : 6.3.2 Metacharacters Used in Replacement Strings
in search patterns : 6.3.1 Metacharacters Used in Search Patterns
renaming buffers : 5.3.1 Renaming the Buffer
repeating last vi command (.)
2.3.8 Repeating or Undoing Your Last Command
2.3.8.1 Repeat
replace
character (r) : 2.3.3.3 Characters other
global : (see global replacement)
overstriking characters (R) : 2.4 More Ways to Insert Text
text : (see global replacement)
A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Copyright © 1998 O'Reilly & Associates, Inc All Rights Reserved
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_r.htm (1 of 2) [2/6/2001 10:03:24 PM]
Trang 11http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_r.htm (2 of 2) [2/6/2001 10:03:24 PM]
Trang 12Index: S
saving files
1.1.3 Saving and Quitting a File
(see also vi commands)
screen editors
1 The vi Text Editor
(see also vi editor)
scripts
7.4 Using ex Scripts
(see also ex commands)
built by diff : 7.4.5 ex Scripts Built by diff
comments in : 7.4.4 Comments in ex Scripts
sort text blocks : 7.4.3 Sorting Text Blocks: A Sample ex Script
scrolling : 3.1 Movement by Screens
with cursor stationary (z) : 3.1.2 Repositioning the Screen with z
search
and replace : 6.2 Context-sensitive Replacement
and replace within text block : 6.4.2 Block Move by Patterns
backward for a pattern (?) : 3.3.1 Repeating Searches
combine opening a file with : 4.2.1 Advancing to a Specific Place
for general class of words : 6.4.1 Search for General Class of Words
global : (see global replacement)
Trang 13matched brackets : 7.5.2 A Special Search Command
metacharacters treated like normal characters : 7.1.4 Some Useful Optionspattern (/e) : 3.3 Movement by Searches
pattern matching
6.3 Pattern-matching Rules(see also global replacement)repeat (n, N)
3.3.1 Repeating Searches6.1 Confirming Substitutionswithin current line : 3.3.2 Current Line Searches
wrapping around file
3.3.1 Repeating Searches7.1.4 Some Useful Optionsset command (ex)
inquire about options : 7.1.1 The :set Command
options
7.1 Customizing vi7.1.1 The :set Commandset line numbers (:set nu) : 2.2.3 Movement Within a Line
set options
allow metacharacters in searches (:set magic) : 7.1.4 Some Useful Optionsalphabetical list of : B Setting Environment Options
assign a value : 7.1.1 The :set Command
autoindent (:set ai) : 7.5.1 Indentation Control
display tabs (:set list) : 7.5.1 Indentation Control
exrc : 7.1.3 Alternate Environments
ignore case (:set ic)
7.1.1 The :set Command7.1.4 Some Useful Optionsnumber lines (:set nu)
3.4 Movement by Line Number3.4.1 The G (Go To) Command if5.2.2 Defining a Range of Linesparagraphs (:set para=) : 3.2 Movement by Text Blocks
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_s.htm (2 of 4) [2/6/2001 10:03:25 PM]
Trang 14window size (:set w=) : 7.1.1 The :set Command
wrapmargin (:set wm=)
2.1 vi Commands2.2.3 Movement Within a Line2.3.8.1 Repeat
7.1.4 Some Useful Optionsmap example : 7.3.5 More Examples of Mapping Keyswrapscan (:set ws)
3.3.1 Repeating Searches7.1.4 Some Useful Optionsshell
substitute
character (s) : 2.4 More Ways to Insert Text
line (S) : 2.4 More Ways to Insert Text
recovering from : 4.2.3 Recovering a Buffer
system crash, recovering from : 4.2.3 Recovering a Buffer
A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_s.htm (3 of 4) [2/6/2001 10:03:25 PM]
Trang 15Copyright © 1998 O'Reilly & Associates, Inc All Rights Reserved.
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_s.htm (4 of 4) [2/6/2001 10:03:25 PM]
Trang 16sorting : 7.4.3 Sorting Text Blocks: A Sample ex Script
switching : 6.4.2 Block Move by Patterns
text editor : (see editor)
text object
2.3.3.1 Words
2.6 Review of Basic vi Commands
filter through command : 7.2.1 Filtering Text Through a Command
transposing
characters (xp) : 2.3.6.1 Transposing Two Letters
words : 7.3.5 More Examples of Mapping Keys
A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Copyright © 1998 O'Reilly & Associates, Inc All Rights Reserved
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_t.htm [2/6/2001 10:03:26 PM]
Trang 17A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Index: U
undoing
all vi commands on a line (U) : 2.3.8.2 Undo
last vi command (u)
2.3.5.4 Problems with Deletions2.3.8 Repeating or Undoing Your Last Command2.3.8.2 Undo
6.1 Confirming SubstitutionsUNIX commands
compare files (diff) : 7.4.5 ex Scripts Built by diff
execute from vi : 7.2 Executing UNIX Commands
filter text through : 7.2.1 Filtering Text Through a Command
A | B | C | D | E | F | G | H | I | J | L | M | N | O | P | Q | R | S | T | U | V | W | Y
Copyright © 1998 O'Reilly & Associates, Inc All Rights Reserved
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_u.htm [2/6/2001 10:03:27 PM]
Trang 18Index: V
vi
entering : (see opening a file or vi commands)
invoking on multiple files : 5.5.1 Invoking vi on Multiple Files one
vi commands
@-functions : 7.3.9 @-Functions
abbreviated words : 7.3.1 Word Abbreviation
append text (a)
2.3 Simple Edits2.3.2 Appending Textappend text to end of line (A) : 2.4 More Ways to Insert Text
case sensitivity of : 1 The vi Text Editor
change character (r) : 2.3.3.3 Characters other
change lines (cc)
2.3.3.2 Lines2.4 More Ways to Insert Textchange text (c)
1 The vi Text Editor2.3 Simple Edits2.3.3 Changing Text2.6 Review of Basic vi Commands4.1 More Command Combinationschange text to end of line (C) : 2.3.3.2 Lines
change words (cw)
2.3.3 Changing Text2.3.3.1 Words
combine edits and movement : 4.1 More Command Combinations
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_v.htm (1 of 6) [2/6/2001 10:03:31 PM]
Trang 19command mode : 2.1 vi Commands
copy (yank and put) text : 4.3.2 Yanking to Named Buffers
copy (yank) text (y)
1 The vi Text Editor
2.3 Simple Edits
2.3.7 Copying Text
2.6 Review of Basic vi Commands
4.1 More Command Combinations
copy text : 2.3 Simple Edits
copy text (yank and put)
2.3.7 Copying Text
4.3.2 Yanking to Named Buffers
delete character (x) : 2.3.5.3 Characters
delete line (dd) : 2.3.5.2 Lines
delete text (d)
2.3 Simple Edits
2.3.5 Deleting Text Chapter
2.3.7 Copying Text
2.6 Review of Basic vi Commands
4.1 More Command Combinations
delete to end of line (D) : 2.3.5.2 Lines
delete up to pattern (d/pattern) : 3.3.2 Current Line Searches
delete word (dw) : 2.3.5.1 Words
display current line number (^G)
3.4 Movement by Line Number
3.4.1 The G (Go To) Command if
filter text through UNIX command : 7.2.1 Filtering Text Through a Commandgeneral form : 2.3.3.1 Words
insert mode : 2.1 vi Commands
insert text (i)
1 The vi Text Editor
2.1 vi Commands
2.3 Simple Edits
2.3.1 Inserting New Text
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_v.htm (2 of 6) [2/6/2001 10:03:31 PM]
Trang 20move cursor by character
2.2.1 Single Movements
2.6 Review of Basic vi Commands
move cursor by line
3.1.5 Movement by Line
3.1.5.1 Movement on the Current Line
move cursor by screen : 3.1 Movement by Screens
move cursor by text block : 3.2 Movement by Text Blocks
move cursor by word
2.2.4 Movement by Text Blocks
2.6 Review of Basic vi Commands
move cursor to line number n (nG)
3.4 Movement by Line Number
3.4.1 The G (Go To) Command if
move cursor within a line
2.2.3 Movement Within a Line
2.6 Review of Basic vi Commands
move cursor within a screen : 3.1.4 Movement Within a Screen
move text : 2.3 Simple Edits
move text (delete and put)
2.3.6 Moving Text
2.3.6.1 Transposing Two Letters
2.3.7 Copying Text
numeric arguments with
edit commands : 2.3.3.1 Words
insert commands : 2.4.1 Numeric Arguments for Insert Commandsmovement commands : 2.2.2 Numeric Arguments
open a file (vi)
1.1 Opening and Closing Files
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_v.htm (3 of 6) [2/6/2001 10:03:31 PM]
Trang 211.1.1 Opening a File
1.1.2 Problems Opening Files
open file : 4.2.1 Advancing to a Specific Place
at a specific place : 4.2.1 Advancing to a Specific Place
in read-only mode : 4.2.2 Read-only Mode
open line for text (O, o) : 2.4 More Ways to Insert Text
2.6 Review of Basic vi Commands
4.3.2 Yanking to Named Buffers
put text before cursor (P)
2.3.6 Moving Text
2.3.7 Copying Text
4.3.2 Yanking to Named Buffers
quick reference to : A Quick Reference
quit and save edits (ZZ)
1.1.3 Saving and Quitting a File
1.2 Quitting Without Saving Edits
1.2.1 Problems Saving Files
2.6 Review of Basic vi Commands
recover buffers after system crash : 4.2.3 Recovering a Buffer
recover deletions with u : 2.3.5.4 Problems with Deletions
recover numbered buffers (deletions)
2.3.5.4 Problems with Deletions
4.3.1 Recovering Deletions
repeat last command (.)
2.3.8 Repeating or Undoing Your Last Command
2.3.8.1 Repeat
6.1 Confirming Substitutions
repeat search (n, N)
http://www.crypto.nc1uw1aoi420d85w1sos.de/documents/oreilly/unix/vi/index/idx_v.htm (4 of 6) [2/6/2001 10:03:31 PM]