Skip to Content
Learning the vi and Vim Editors, 7th Edition
book

Learning the vi and Vim Editors, 7th Edition

by Arnold Robbins, Elbert Hannah, Linda Lamb
July 2008
Beginner
492 pages
16h
English
O'Reilly Media, Inc.
Content preview from Learning the vi and Vim Editors, 7th Edition

Review of vi Buffer and Marking Commands

Table 4-2 summarizes the command-line options common to all versions of vi. Tables 4-3 and 4-4 summarize the buffer and marking commands.

Table 4-2. Command-line options
OptionMeaning
+ n fileOpen file at line number n.
+ fileOpen file at last line.
+/ pattern file

Open file at first occurrence of pattern (traditional version of POSIX -c).

-c command file

Run command after opening file; usually a line number or search (POSIX version of +).

-ROperate in read-only mode (same as using view instead of vi).
-rRecover files after a crash.
Table 4-3. Buffer names
Buffer namesBuffer use
1–9The last nine deletions, from most to least recent.
a–z

Named buffers for you to use as needed. Uppercase letters append to the buffer.

Table 4-4. Buffer and marking commands
CommandMeaning
" b commandDo command with buffer b.
m xMark current position with x.
' xMove cursor to first character of line marked by x.
` xMove cursor to character marked by x.
``Return to exact position of previous mark or context.
''Return to beginning of the line of previous mark or context.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 8th Edition

Learning the vi and Vim Editors, 8th Edition

Arnold Robbins, Elbert Hannah
Vim Masterclass

Vim Masterclass

Jason Cannon
Mastering Vim

Mastering Vim

Ruslan Osipov

Publisher Resources

ISBN: 9780596529833Errata Page