annotate doc/misc/vip.texi @ 97949:e763543ca817

(calc-dispatch-map): Fix handling of upcased and control-prefixed keys. (Bug #835)
author Martin Rudalics <rudalics@gmx.at>
date Tue, 02 Sep 2008 08:49:01 +0000
parents 6f0fce2c3559
children 6de181810d0f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
84322
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1 \input texinfo
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2
84329
3d431f1997d8 (setfilename): Go up one more level to ../../info.
Glenn Morris <rgm@gnu.org>
parents: 84322
diff changeset
3 @setfilename ../../info/vip
84322
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
4 @settitle VIP
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
5
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
6 @copying
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
7 Copyright @copyright{} 1987, 2001, 2002, 2003, 2004,
87903
5d58981e6690 Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 84329
diff changeset
8 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
84322
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
9
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
10 @quotation
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
11 Permission is granted to copy, distribute and/or modify this document
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
12 under the terms of the GNU Free Documentation License, Version 1.2 or
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
13 any later version published by the Free Software Foundation; with no
95937
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
14 Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
15 and with the Back-Cover Texts as in (a) below. A copy of the license
6f0fce2c3559 Remove references to external license, since doclicense is included.
Glenn Morris <rgm@gnu.org>
parents: 95874
diff changeset
16 is included in the section entitled ``GNU Free Documentation License''.
84322
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
17
95874
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 87903
diff changeset
18 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 87903
diff changeset
19 modify this GNU manual. Buying copies from the FSF supports it in
eafbd7a5c9be Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents: 87903
diff changeset
20 developing GNU and promoting software freedom.''
84322
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
21 @end quotation
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
22 @end copying
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
23
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
24 @titlepage
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
25 @sp 10
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
26 @center @titlefont{VIP}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
27 @sp 1
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
28 @center A Vi Package for GNU Emacs
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
29 @center (Version 3.5, September 15, 1987)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
30 @sp 2
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
31 @center Masahiko Sato
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
32 @page
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
33 @vskip 0pt plus1filll
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
34 @insertcopying
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
35 @end titlepage
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
36
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
37 @dircategory Emacs
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
38 @direntry
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
39 * VIP: (vip). An older VI-emulation for Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
40 @end direntry
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
41
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
42 @finalout
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
43
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
44 @ifnottex
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
45 @node Top, Survey,, (DIR)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
46 @top VIP
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
47
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
48 VIP is a Vi emulating package written in Emacs Lisp. VIP implements most
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
49 Vi commands including Ex commands. It is therefore hoped that this package
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
50 will enable you to do Vi style editing under the powerful GNU Emacs
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
51 environment. This info file describes the usage of VIP assuming that you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
52 are fairly accustomed to Vi but not so much with Emacs. Also we will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
53 concentrate mainly on differences from Vi, especially features unique to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
54 VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
55
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
56 It is recommended that you read nodes on survey and on customization before
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
57 you start using VIP. Other nodes may be visited as needed.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
58
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
59 Comments and bug reports are welcome. Please send messages to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
60 @code{ms@@Sail.Stanford.Edu} if you are outside of Japan and to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
61 @code{masahiko@@sato.riec.tohoku.junet} if you are in Japan.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
62
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
63 @end ifnottex
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
64
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
65 @menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
66 * Survey:: A survey of VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
67 * Vi Commands:: Details of Vi commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
68 * Ex Commands:: Details of Ex commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
69 * Customization:: How to customize VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
70 * GNU Free Documentation License:: The license for this documentation.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
71
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
72 @end menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
73 @iftex
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
74 @unnumbered Introduction
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
75
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
76 VIP is a Vi emulating package written in Emacs Lisp. VIP implements most
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
77 Vi commands including Ex commands. It is therefore hoped that this package
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
78 will enable you to do Vi style editing under the powerful GNU Emacs
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
79 environment. This manual describes the usage of VIP assuming that you are
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
80 fairly accustomed to Vi but not so much with Emacs. Also we will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
81 concentrate mainly on differences from Vi, especially features unique to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
82 VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
83
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
84 It is recommended that you read chapters on survey and on customization
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
85 before you start using VIP. Other chapters may be used as future
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
86 references.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
87
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
88 Comments and bug reports are welcome. Please send messages to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
89 @code{ms@@Sail.Stanford.Edu} if you are outside of Japan and to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
90 @code{masahiko@@unsun.riec.tohoku.junet} if you are in Japan.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
91 @end iftex
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
92
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
93 @node Survey, Basic Concepts, Top, Top
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
94 @chapter A Survey of VIP
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
95
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
96 In this chapter we describe basics of VIP with emphasis on the features not
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
97 found in Vi and on how to use VIP under GNU Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
98
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
99 @menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
100 * Basic Concepts:: Basic concepts in Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
101 * Loading VIP:: How to load VIP automatically.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
102 * Modes in VIP:: VIP has three modes, which are orthogonal to modes
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
103 in Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
104 * Differences from Vi:: Differences of VIP from Vi is explained.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
105 @end menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
106
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
107 @node Basic Concepts, Loading VIP, Survey, Survey
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
108 @section Basic Concepts
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
109
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
110 We begin by explaining some basic concepts of Emacs. These concepts are
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
111 explained in more detail in the GNU Emacs Manual.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
112
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
113 @cindex buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
114 @cindex point
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
115 @cindex mark
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
116 @cindex text
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
117 @cindex looking at
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
118 @cindex end (of buffer)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
119 @cindex region
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
120
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
121 Conceptually, a @dfn{buffer} is just a string of @acronym{ASCII} characters and two
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
122 special characters @key{PNT} (@dfn{point}) and @key{MRK} (@dfn{mark}) such
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
123 that the character @key{PNT} occurs exactly once and @key{MRK} occurs at
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
124 most once. The @dfn{text} of a buffer is obtained by deleting the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
125 occurrences of @key{PNT} and @key{MRK}. If, in a buffer, there is a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
126 character following @key{PNT} then we say that point is @dfn{looking at}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
127 the character; otherwise we say that point is @dfn{at the end of buffer}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
128 @key{PNT} and @key{MRK} are used
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
129 to indicate positions in a buffer and they are not part of the text of the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
130 buffer. If a buffer contains a @key{MRK} then the text between @key{MRK}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
131 and @key{PNT} is called the @dfn{region} of the buffer.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
132
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
133 @cindex window
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
134
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
135 Emacs provides (multiple) @dfn{windows} on the screen, and you can see the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
136 content of a buffer through the window associated with the buffer. The
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
137 cursor of the screen is always positioned on the character after @key{PNT}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
138 @refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
139
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
140 @cindex mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
141 @cindex keymap
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
142 @cindex local keymap
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
143 @cindex global keymap
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
144
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
145 A @dfn{keymap} is a table that records the bindings between characters and
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
146 command functions. There is the @dfn{global keymap} common to all the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
147 buffers. Each buffer has its @dfn{local keymap} that determines the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
148 @dfn{mode} of the buffer. Local keymap overrides global keymap, so that if
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
149 a function is bound to some key in the local keymap then that function will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
150 be executed when you type the key. If no function is bound to a key in the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
151 local map, however, the function bound to the key in the global map becomes
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
152 in effect.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
153
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
154 @node Loading VIP, Modes in VIP, Basic Concepts, Survey
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
155 @section Loading VIP
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
156
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
157 The recommended way to load VIP automatically is to include the line:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
158 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
159 (load "vip")
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
160 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
161 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
162 in your @file{.emacs} file. The @file{.emacs} file is placed in your home
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
163 directory and it will be executed every time you invoke Emacs. If you wish
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
164 to be in vi mode whenever Emacs starts up, you can include the following
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
165 line in your @file{.emacs} file instead of the above line:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
166 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
167 (setq term-setup-hook 'vip-mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
168 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
169 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
170 (@xref{Vi Mode}, for the explanation of vi mode.)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
171
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
172 Even if your @file{.emacs} file does not contain any of the above lines,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
173 you can load VIP and enter vi mode by typing the following from within
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
174 Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
175 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
176 M-x vip-mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
177 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
178 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
179
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
180 @node Modes in VIP, Emacs Mode, Loading VIP, Survey
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
181 @section Modes in VIP
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
182
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
183 @kindex 032 @kbd{C-z} (@code{vip-change-mode-to-vi})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
184 @kindex 0301 @kbd{C-x C-z} (@code{suspend-emacs})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
185
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
186 Loading VIP has the effect of globally binding @kbd{C-z} (@kbd{Control-z})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
187 to the function @code{vip-change-mode-to-vi}. The default binding of @kbd{C-z}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
188 in GNU Emacs is @code{suspend-emacs}, but, you can also call
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
189 @code{suspend-emacs} by typing @kbd{C-x C-z}. Other than this, all the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
190 key bindings of Emacs remain the same after loading VIP.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
191
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
192 @cindex vi mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
193
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
194 Now, if you hit @kbd{C-z}, the function @code{vip-change-mode-to-vi} will be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
195 called and you will be in @dfn{vi mode}. (Some major modes may locally bind
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
196 @kbd{C-z} to some special functions. In such cases, you can call
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
197 @code{vip-change-mode-to-vi} by @code{execute-extended-command} which is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
198 invoked by @kbd{M-x}. Here @kbd{M-x} means @kbd{Meta-x}, and if your
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
199 terminal does not have a @key{META} key you can enter it by typing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
200 @kbd{@key{ESC} x}. The same effect can also be achieve by typing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
201 @kbd{M-x vip-mode}.)@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
202
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
203 @cindex mode line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
204
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
205 You can observe the change of mode by looking at the @dfn{mode line}. For
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
206 instance, if the mode line is:@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
207 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
208 -----Emacs: *scratch* (Lisp Interaction)----All------------
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
209 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
210 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
211 then it will change to:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
212 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
213 -----Vi: *scratch* (Lisp Interaction)----All------------
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
214 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
215 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
216 Thus the word @samp{Emacs} in the mode line will change to @samp{Vi}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
217
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
218 @cindex insert mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
219 @cindex emacs mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
220
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
221 You can go back to the original @dfn{emacs mode} by typing @kbd{C-z} in
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
222 vi mode. Thus @kbd{C-z} toggles between these two modes.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
223
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
224 Note that modes in VIP exist orthogonally to modes in Emacs. This means
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
225 that you can be in vi mode and at the same time, say, shell mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
226
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
227 Vi mode corresponds to Vi's command mode. From vi mode you can enter
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
228 @dfn{insert mode} (which corresponds to Vi's insert mode) by usual Vi command
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
229 keys like @kbd{i}, @kbd{a}, @kbd{o} @dots{} etc.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
230
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
231 In insert mode, the mode line will look like this:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
232 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
233 -----Insert *scratch* (Lisp Interaction)----All------------
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
234 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
235 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
236 You can exit from insert mode by hitting @key{ESC} key as you do in Vi.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
237
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
238 That VIP has three modes may seem very complicated, but in fact it is not
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
239 so. VIP is implemented so that you can do most editing remaining only
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
240 in the two modes for Vi (that is vi mode and insert mode).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
241
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
242 @ifinfo
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
243 The figure below shows the transition of three modes in VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
244 @display
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
245
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
246
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
247 === C-z ==> == i,o ... ==>
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
248 emacs mode vi mode insert mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
249 <== X-z === <=== ESC ====
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
250 @end display
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
251 @end ifinfo
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
252
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
253 @menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
254 * Emacs Mode:: This is the mode you should know better.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
255 * Vi Mode:: Vi commands are executed in this mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
256 * Insert Mode:: You can enter text, and also can do editing if you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
257 know enough Emacs commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
258 @end menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
259
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
260 @node Emacs Mode, Vi Mode, Modes in VIP, Modes in VIP
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
261 @subsection Emacs Mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
262
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
263 @kindex 032 @kbd{C-z} (@code{vip-change-mode-to-vi})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
264
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
265 You will be in this mode just after you loaded VIP. You can do all
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
266 normal Emacs editing in this mode. Note that the key @kbd{C-z} is globally
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
267 bound to @code{vip-change-mode-to-vi}. So, if you type @kbd{C-z} in this mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
268 then you will be in vi mode.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
269
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
270 @node Vi Mode, Insert Mode, Emacs Mode, Modes in VIP
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
271 @subsection Vi Mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
272
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
273 This mode corresponds to Vi's command mode. Most Vi commands work as they
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
274 do in Vi. You can go back to emacs mode by typing @kbd{C-z}. You can
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
275 enter insert mode, just as in Vi, by typing @kbd{i}, @kbd{a} etc.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
276
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
277 @node Insert Mode, Differences from Vi, Vi Mode, Modes in VIP
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
278 @subsection Insert Mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
279
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
280 The key bindings in this mode is the same as in the emacs mode except for
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
281 the following 4 keys. So, you can move around in the buffer and change
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
282 its content while you are in insert mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
283
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
284 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
285 @item @key{ESC}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
286 @kindex 033 @kbd{ESC} (@code{vip-change-mode-to-vi}) (insert mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
287 This key will take you back to vi mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
288 @item C-h
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
289 @kindex 010 @kbd{C-h} (@code{vip-delete-backward-char}) (insert mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
290 Delete previous character.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
291 @item C-w
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
292 @kindex 027 @kbd{C-w} (@code{vip-delete-backward-word}) (insert mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
293 Delete previous word.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
294 @item C-z
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
295 @kindex 032 @kbd{C-z} (@code{vip-ESC}) (insert mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
296 Typing this key has the same effect as typing @key{ESC} in emacs mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
297 Thus typing @kbd{C-z x} in insert mode will have the same effect as typing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
298 @kbd{ESC x} in emacs mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
299 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
300
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
301 @node Differences from Vi, Undoing, Insert Mode, Survey
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
302 @section Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
303
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
304 The major differences from Vi are explained below.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
305
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
306 @menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
307 * Undoing:: You can undo more in VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
308 * Changing:: Commands for changing the text.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
309 * Searching:: Search commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
310 * z Command:: You can now use zH, zM and zL as well as z- etc.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
311 * Counts:: Some Vi commands which do not accept a count now
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
312 accept one.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
313 * Marking:: You can now mark the current point, beginning of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
314 the buffer etc.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
315 * Region Commands:: You can now give a region as an argument for delete
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
316 commands etc.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
317 * New Commands:: Some new commands not available in Vi are added.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
318 * New Bindings:: Bindings of some keys are changed for the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
319 convenience of editing under Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
320 * Window Commands:: Commands for moving among windows etc.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
321 * Buffer Commands:: Commands for selecting buffers etc.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
322 * File Commands:: Commands for visiting files etc.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
323 * Misc Commands:: Other useful commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
324 @end menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
325
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
326 @node Undoing, Changing, Differences from Vi, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
327 @subsection Undoing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
328
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
329 @kindex 165 @kbd{u} (@code{vip-undo})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
330 @kindex 056 @kbd{.} (@code{vip-repeat})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
331
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
332 You can repeat undoing by the @kbd{.} key. So, @kbd{u} will undo
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
333 a single change, while @kbd{u .@: .@: .@:}, for instance, will undo 4 previous
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
334 changes. Undo is undoable as in Vi. So the content of the buffer will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
335 be the same before and after @kbd{u u}.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
336
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
337 @node Changing, Searching, Undoing, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
338 @subsection Changing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
339
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
340 Some commands which change a small number of characters are executed
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
341 slightly differently. Thus, if point is at the beginning of a word
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
342 @samp{foo} and you wished to change it to @samp{bar} by typing @w{@kbd{c w}},
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
343 then VIP will prompt you for a new word in the minibuffer by the prompt
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
344 @samp{foo => }. You can then enter @samp{bar} followed by @key{RET} or
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
345 @key{ESC} to complete the command. Before you enter @key{RET} or
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
346 @key{ESC} you can abort the command by typing @kbd{C-g}. In general,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
347 @kindex 007 @kbd{C-g} (@code{vip-keyboard-quit})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
348 you can abort a partially formed command by typing @kbd{C-g}.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
349
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
350 @node Searching, z Command, Changing, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
351 @subsection Searching
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
352
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
353 @kindex 057 @kbd{/} (@code{vip-search-forward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
354 @kindex 077 @kbd{?} (@code{vip-search-backward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
355
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
356 As in Vi, searching is done by @kbd{/} and @kbd{?}. The string will be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
357 searched literally by default. To invoke a regular expression search,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
358 first execute the search command @kbd{/} (or @kbd{?}) with empty search
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
359 string. (I.e, type @kbd{/} followed by @key{RET}.)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
360 A search for empty string will toggle the search mode between vanilla
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
361 search and regular expression search. You cannot give an offset to the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
362 search string. (It is a limitation.) By default, search will wrap around
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
363 the buffer as in Vi. You can change this by rebinding the variable
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
364 @code{vip-search-wrap-around}. @xref{Customization}, for how to do this.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
365
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
366 @node z Command, Counts, Searching, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
367 @subsection z Command
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
368
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
369 @kindex 1723 @kbd{z H} (@code{vip-line-to-top})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
370 @kindex 1721 @kbd{z RET} (@code{vip-line-to-top})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
371 @kindex 1723 @kbd{z M} (@code{vip-line-to-middle})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
372 @kindex 1722 @kbd{z .} (@code{vip-line-to-middle})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
373 @kindex 1723 @kbd{z L} (@code{vip-line-to-bottom})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
374 @kindex 1722 @kbd{z -} (@code{vip-line-to-bottom})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
375
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
376 For those of you who cannot remember which of @kbd{z} followed by @key{RET},
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
377 @kbd{.}@: and @kbd{-} do what. You can also use @kbd{z} followed by @kbd{H},
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
378 @kbd{M} and @kbd{L} to place the current line in the Home (Middle, and
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
379 Last) line of the window.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
380
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
381 @node Counts, Marking, z Command, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
382 @subsection Counts
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
383
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
384 Some Vi commands which do not accept a count now accept one
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
385
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
386 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
387 @item p
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
388 @itemx P
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
389 @kindex 160 @kbd{p} (@code{vip-put-back})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
390 @kindex 120 @kbd{P} (@code{vip-Put-back})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
391 Given counts, text will be yanked (in Vi's sense) that many times. Thus
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
392 @kbd{3 p} is the same as @kbd{p p p}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
393 @item o
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
394 @itemx O
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
395 @kindex 157 @kbd{o} (@code{vip-open-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
396 @kindex 117 @kbd{O} (@code{vip-Open-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
397 Given counts, that many copies of text will be inserted. Thus
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
398 @kbd{o a b c @key{ESC}} will insert 3 lines of @samp{abc} below the current
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
399 line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
400 @item /
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
401 @itemx ?
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
402 @kindex 057 @kbd{/} (@code{vip-search-forward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
403 @kindex 077 @kbd{?} (@code{vip-search-backward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
404 Given a count @var{n}, @var{n}-th occurrence will be searched.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
405 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
406
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
407 @node Marking, Region Commands, Counts, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
408 @subsection Marking
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
409
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
410 Typing an @kbd{m} followed by a lower-case character @var{ch} marks the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
411 point to the register named @var{ch} as in Vi. In addition to these, we
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
412 have following key bindings for marking.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
413
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
414 @kindex 155 @kbd{m} (@code{vip-mark-point})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
415
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
416 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
417 @item m <
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
418 Set mark at the beginning of buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
419 @item m >
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
420 Set mark at the end of buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
421 @item m .
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
422 Set mark at point (and push old mark on mark ring).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
423 @item m ,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
424 Jump to mark (and pop mark off the mark ring).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
425 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
426
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
427 @node Region Commands, New Commands, Marking, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
428 @subsection Region Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
429
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
430 @cindex region
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
431
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
432 Vi operators like @kbd{d}, @kbd{c} etc. are usually used in combination
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
433 with motion commands. It is now possible to use current region as the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
434 argument to these operators. (A @dfn{region} is a part of buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
435 delimited by point and mark.) The key @kbd{r} is used for this purpose.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
436 Thus @kbd{d r} will delete the current region. If @kbd{R} is used instead
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
437 of @kbd{r} the region will first be enlarged so that it will become the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
438 smallest region containing the original region and consisting of whole
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
439 lines. Thus @kbd{m .@: d R} will have the same effect as @kbd{d d}.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
440
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
441 @node New Commands, New Bindings, Region Commands, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
442 @subsection Some New Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
443
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
444 Note that the keys below (except for @kbd{R}) are not used in Vi.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
445
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
446 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
447 @item C-a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
448 @kindex 001 @kbd{C-a} (@code{vip-beginning-of-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
449 Move point to the beginning of line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
450 @item C-n
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
451 @kindex 016 @kbd{C-n} (@code{vip-next-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
452 If you have two or more windows in the screen, this key will move point to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
453 the next window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
454 @item C-o
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
455 @kindex 017 @kbd{C-o} (@code{vip-open-line-at-point})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
456 Insert a newline and leave point before it, and then enter insert mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
457 @item C-r
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
458 @kindex 022 @kbd{C-r} (@code{isearch-backward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
459 Backward incremental search.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
460 @item C-s
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
461 @kindex 023 @kbd{C-s} (@code{isearch-forward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
462 Forward incremental search.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
463 @item C-c
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
464 @itemx C-x
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
465 @itemx @key{ESC}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
466 @kindex 003 @kbd{C-c} (@code{vip-ctl-c})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
467 @kindex 0300 @kbd{C-x} (@code{vip-ctl-x})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
468 @kindex 033 @kbd{ESC} (@code{vip-ESC})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
469 These keys will exit from vi mode and return to emacs mode temporarily. If
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
470 you hit one of these keys, Emacs will be in emacs mode and will believe
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
471 that you hit that key in emacs mode. For example, if you hit @kbd{C-x}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
472 followed by @kbd{2}, then the current window will be split into 2 and you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
473 will be in vi mode again.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
474 @item \
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
475 @kindex 134 @kbd{\} (@code{vip-escape-to-emacs})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
476 Escape to emacs mode. Hitting @kbd{\} will take you to emacs mode, and you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
477 can execute a single Emacs command. After executing the Emacs command you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
478 will be in vi mode again. You can give a count before typing @kbd{\}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
479 Thus @kbd{5 \ *}, as well as @kbd{\ C-u 5 *}, will insert @samp{*****}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
480 before point. Similarly @kbd{1 0 \ C-p} will move the point 10 lines above
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
481 the current line.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
482 @item K
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
483 @kindex 113 @kbd{K} (@code{vip-kill-buffer})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
484 Kill current buffer if it is not modified. Useful when you selected a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
485 buffer which you did not want.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
486 @item Q
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
487 @itemx R
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
488 @kindex 121 @kbd{Q} (@code{vip-query-replace})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
489 @kindex 122 @kbd{R} (@code{vip-replace-string})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
490 @kbd{Q} is for query replace and @kbd{R} is for replace. By default,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
491 string to be replaced are treated literally. If you wish to do a regular
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
492 expression replace, first do replace with empty string as the string to be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
493 replaced. In this way, you can toggle between vanilla and regular
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
494 expression replacement.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
495 @item v
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
496 @itemx V
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
497 @kindex 166 @kbd{v} (@code{vip-find-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
498 @kindex 126 @kbd{V} (@code{vip-find-file-other-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
499 These keys are used to Visit files. @kbd{v} will switch to a buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
500 visiting file whose name can be entered in the minibuffer. @kbd{V} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
501 similar, but will use window different from the current window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
502 @item #
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
503 @kindex 0430 @kbd{#} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
504 If followed by a certain character @var{ch}, it becomes an operator whose
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
505 argument is the region determined by the motion command that follows.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
506 Currently, @var{ch} can be one of @kbd{c}, @kbd{C}, @kbd{g}, @kbd{q} and
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
507 @kbd{s}.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
508 @item # c
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
509 @kindex 0432 @kbd{# c} (@code{downcase-region})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
510 Change upper-case characters in the region to lower case
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
511 (@code{downcase-region}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
512 @item # C
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
513 @kindex 0431 @kbd{# C} (@code{upcase-region})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
514 Change lower-case characters in the region to upper case. For instance,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
515 @kbd{# C 3 w} will capitalize 3 words from the current point
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
516 (@code{upcase-region}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
517 @item # g
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
518 @kindex 0432 @kbd{# g} (@code{vip-global-execute})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
519 Execute last keyboard macro for each line in the region
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
520 (@code{vip-global-execute}).@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
521 @item # q
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
522 @kindex 0432 @kbd{# q} (@code{vip-quote-region})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
523 Insert specified string at the beginning of each line in the region
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
524 (@code{vip-quote-region}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
525 @item # s
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
526 @kindex 0432 @kbd{# s} (@code{spell-region})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
527 Check spelling of words in the region (@code{spell-region}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
528 @item *
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
529 @kindex 052 @kbd{*} (@code{vip-call-last-kbd-macro})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
530 Call last keyboard macro.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
531 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
532
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
533 @node New Bindings, Window Commands, New Commands, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
534 @subsection New Key Bindings
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
535
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
536 In VIP the meanings of some keys are entirely different from Vi. These key
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
537 bindings are done deliberately in the hope that editing under Emacs will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
538 become easier. It is however possible to rebind these keys to functions
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
539 which behave similarly as in Vi. @xref{Customizing Key Bindings}, for
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
540 details.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
541
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
542 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
543 @item C-g
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
544 @itemx g
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
545 @kindex 007 @kbd{C-g} (@code{vip-keyboard-quit})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
546 @kindex 147 @kbd{g} (@code{vip-info-on-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
547 In Vi, @kbd{C-g} is used to get information about the file associated to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
548 the current buffer. Here, @kbd{g} will do that, and @kbd{C-g} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
549 used to abort a command (this is for compatibility with emacs mode.)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
550 @item SPC
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
551 @itemx @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
552 @kindex 040 @kbd{SPC} (@code{vip-scroll})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
553 @kindex 015 @kbd{RET} (@code{vip-scroll-back})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
554 Now these keys will scroll up and down the text of current window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
555 Convenient for viewing the text.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
556 @item s
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
557 @itemx S
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
558 @kindex 163 @kbd{s} (@code{vip-switch-to-buffer})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
559 @kindex 123 @kbd{S} (@code{vip-switch-to-buffer-other-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
560 They are used to switch to a specified buffer. Useful for switching to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
561 already existing buffer since buffer name completion is provided. Also
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
562 a default buffer will be given as part of the prompt, to which you can
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
563 switch by just typing @key{RET} key. @kbd{s} is used to select buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
564 in the current window, while @kbd{S} selects buffer in another window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
565 @item C
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
566 @itemx X
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
567 @kindex 103 @kbd{C} (@code{vip-ctl-c-equivalent})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
568 @kindex 1300 @kbd{X} (@code{vip-ctl-x-equivalent})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
569 These keys will exit from vi mode and return to emacs mode temporarily.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
570 If you type @kbd{C} (@kbd{X}), Emacs will be in emacs mode and will believe
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
571 that you have typed @kbd{C-c} (@kbd{C-x}, resp.) in emacs mode. Moreover,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
572 if the following character you type is an upper-case letter, then Emacs
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
573 will believe that you have typed the corresponding control character.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
574 You will be in vi mode again after the command is executed. For example,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
575 typing @kbd{X S} in vi mode is the same as typing @kbd{C-x C-s} in emacs
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
576 mode. You get the same effect by typing @kbd{C-x C-s} in vi mode, but
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
577 the idea here is that you can execute useful Emacs commands without typing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
578 control characters. For example, if you hit @kbd{X} (or @kbd{C-x}) followed
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
579 by @kbd{2}, then the current window will be split into 2 and you will be in
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
580 vi mode again.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
581 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
582
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
583 In addition to these, @code{ctl-x-map} is slightly modified:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
584
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
585 @kindex 1301 @kbd{X 3} (@code{vip-buffer-in-two-windows})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
586
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
587 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
588 @item X 3
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
589 @itemx C-x 3
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
590 This is equivalent to @kbd{C-x 1 C-x 2} (1 + 2 = 3).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
591 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
592
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
593 @node Window Commands, Buffer Commands, New Bindings, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
594 @subsection Window Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
595
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
596 In this and following subsections, we give a summary of key bindings for
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
597 basic functions related to windows, buffers and files.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
598
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
599 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
600 @item C-n
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
601 @kindex 016 @kbd{C-n} (@code{vip-next-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
602 Switch to next window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
603 @item X 1
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
604 @itemx C-x 1
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
605 @kindex 1301 @kbd{X 1} (@code{delete-other-windows})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
606 Delete other windows.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
607 @item X 2
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
608 @itemx C-x 2
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
609 @kindex 1301 @kbd{X 2} (@code{split-window-vertically})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
610 Split current window into two windows.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
611 @item X 3
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
612 @itemx C-x 3
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
613 @kindex 1301 @kbd{X 3} (@code{vip-buffer-in-two-windows})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
614 Show current buffer in two windows.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
615 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
616
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
617 @node Buffer Commands, File Commands, Window Commands, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
618 @subsection Buffer Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
619
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
620 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
621 @item s
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
622 @kindex 163 @kbd{s} (@code{vip-switch-to-buffer})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
623 Switch to the specified buffer in the current window
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
624 (@code{vip-switch-to-buffer}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
625 @item S
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
626 @kindex 123 @kbd{S} (@code{vip-switch-to-buffer-other-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
627 Switch to the specified buffer in another window
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
628 (@code{vip-switch-to-buffer-other-window}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
629 @item K
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
630 @kindex 113 @kbd{K} (@code{vip-kill-buffer})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
631 Kill the current buffer if it is not modified.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
632 @item X S
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
633 @itemx C-x C-s
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
634 @kindex 1302 @kbd{X S} (@code{save-buffer})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
635 Save the current buffer in the file associated to the buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
636 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
637
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
638 @node File Commands, Misc Commands, Buffer Commands, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
639 @subsection File Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
640
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
641 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
642 @item v
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
643 @kindex 166 @kbd{v} (@code{vip-find-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
644 Visit specified file in the current window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
645 @item V
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
646 @kindex 126 @kbd{V} (@code{vip-find-file-other-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
647 Visit specified file in another window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
648 @item X W
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
649 @itemx C-x C-w
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
650 @kindex 1302 @kbd{X W} (@code{write-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
651 Write current buffer into the specified file.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
652 @item X I
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
653 @itemx C-x C-i
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
654 @kindex 1302 @kbd{X I} (@code{insert-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
655
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
656 Insert specified file at point.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
657 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
658
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
659 @node Misc Commands, Vi Commands, File Commands, Differences from Vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
660 @subsection Miscellaneous Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
661
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
662 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
663 @item X (
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
664 @itemx C-x (
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
665 @kindex 1301 @kbd{X (} (@code{start-kbd-macro})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
666 Start remembering keyboard macro.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
667 @item X )
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
668 @itemx C-x )
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
669 @kindex 1301 @kbd{X )} (@code{end-kbd-macro})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
670 Finish remembering keyboard macro.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
671 @item *
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
672 @kindex 052 @kbd{*} (@code{vip-call-last-kbd-macro})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
673 Call last remembered keyboard macro.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
674 @item X Z
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
675 @itemx C-x C-z
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
676 @kindex 1302 @kbd{X Z} (@code{suspend-emacs})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
677 Suspend Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
678 @item Z Z
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
679 Exit Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
680 @itemx Q
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
681 Query replace.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
682 @itemx R
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
683 Replace.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
684 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
685
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
686 @node Vi Commands, Numeric Arguments, Misc Commands, Top
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
687 @chapter Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
688
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
689 This chapter describes Vi commands other than Ex commands implemented in
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
690 VIP. Except for the last section which discusses insert mode, all the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
691 commands described in this chapter are to be used in vi mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
692
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
693 @menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
694 * Numeric Arguments:: Many commands accept numeric arguments
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
695 * Important Keys:: Some very important keys.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
696 * Buffers and Windows:: Commands for handling buffers and windows.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
697 * Files:: Commands for handling files.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
698 * Viewing the Buffer:: How you can view the current buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
699 * Mark Commands:: Marking positions in a buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
700 * Motion Commands:: Commands for moving point.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
701 * Searching and Replacing:: Commands for searching and replacing.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
702 * Modifying Commands:: Commands for modifying the buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
703 * Other Vi Commands:: Miscellaneous Commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
704 * Commands in Insert Mode:: Commands for entering insert mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
705 @end menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
706
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
707 @node Numeric Arguments, Important Keys, Vi Commands, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
708 @section Numeric Arguments
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
709
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
710 @cindex numeric arguments
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
711 @cindex count
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
712 @kindex 061 @kbd{1} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
713 @kindex 062 @kbd{2} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
714 @kindex 063 @kbd{3} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
715 @kindex 064 @kbd{4} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
716 @kindex 065 @kbd{5} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
717 @kindex 066 @kbd{6} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
718 @kindex 067 @kbd{7} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
719 @kindex 068 @kbd{8} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
720 @kindex 069 @kbd{9} (numeric argument)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
721
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
722 Most Vi commands accept a @dfn{numeric argument} which can be supplied as
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
723 a prefix to the commands. A numeric argument is also called a @dfn{count}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
724 In many cases, if a count is given, the command is executed that many times.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
725 For instance, @kbd{5 d d} deletes 5 lines while simple @kbd{d d} deletes a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
726 line. In this manual the metavariable @var{n} will denote a count.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
727
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
728 @node Important Keys, Buffers and Windows, Numeric Arguments, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
729 @section Important Keys
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
730
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
731 The keys @kbd{C-g} and @kbd{C-l} are unique in that their associated
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
732 functions are the same in any of emacs, vi and insert mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
733
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
734 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
735 @item C-g
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
736 @kindex 007 @kbd{C-g} (@code{vip-keyboard-quit})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
737 Quit. Cancel running or partially typed command (@code{keyboard-quit}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
738 @item C-l
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
739 @kindex 014 @kbd{C-l} (@code{recenter})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
740 Clear the screen and reprint everything (@code{recenter}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
741 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
742
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
743 In Emacs many commands are bound to the key strokes that start with
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
744 @kbd{C-x}, @kbd{C-c} and @key{ESC}. These commands can be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
745 accessed from vi mode as easily as from emacs mode.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
746
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
747 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
748 @item C-x
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
749 @itemx C-c
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
750 @itemx @key{ESC}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
751 @kindex 003 @kbd{C-c} (@code{vip-ctl-c})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
752 @kindex 0300 @kbd{C-x} (@code{vip-ctl-x})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
753 @kindex 033 @kbd{ESC} (@code{vip-ESC})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
754 Typing one of these keys have the same effect as typing it in emacs mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
755 Appropriate command will be executed according as the keys you type after
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
756 it. You will be in vi mode again after the execution of the command.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
757 For instance, if you type @kbd{@key{ESC} <} (in vi mode) then the cursor will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
758 move to the beginning of the buffer and you will still be in vi mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
759 @item C
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
760 @itemx X
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
761 @kindex 103 @kbd{C} (@code{vip-ctl-c-equivalent})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
762 @kindex 1300 @kbd{X} (@code{vip-ctl-x-equivalent})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
763 Typing one of these keys have the effect of typing the corresponding
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
764 control character in emacs mode. Moreover, if you type an upper-case
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
765 character following it, that character will also be translated to the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
766 corresponding control character. Thus typing @kbd{X W} in vi mode is the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
767 same as typing @kbd{C-x C-w} in emacs mode. You will be in vi mode again
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
768 after the execution of a command.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
769 @item \
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
770 @kindex 134 @kbd{\} (@code{vip-escape-to-emacs})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
771 Escape to emacs mode. Hitting the @kbd{\} key will take you to emacs mode,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
772 and you can execute a single Emacs command. After executing the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
773 Emacs command you will be in vi mode again. You can give a count before
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
774 typing @kbd{\}. Thus @kbd{5 \ +}, as well as @kbd{\ C-u 5 +}, will insert
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
775 @samp{+++++} before point.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
776 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
777
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
778 @node Buffers and Windows, Files, Important Keys, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
779 @section Buffers and Windows
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
780
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
781 @cindex buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
782 @cindex selected buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
783 @cindex current buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
784
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
785 In Emacs the text you edit is stored in a @dfn{buffer}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
786 See GNU Emacs Manual, for details. There is always one @dfn{current}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
787 buffer, also called the @dfn{selected buffer}.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
788
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
789 @cindex window
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
790 @cindex modified (buffer)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
791
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
792 You can see the contents of buffers through @dfn{windows} created by Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
793 When you have multiple windows on the screen only one of them is selected.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
794 Each buffer has a unique name, and each window has a mode line which shows
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
795 the name of the buffer associated with the window and other information
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
796 about the status of the buffer. You can change the format of the mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
797 line, but normally if you see @samp{**} at the beginning of a mode line it
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
798 means that the buffer is @dfn{modified}. If you write out the content of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
799 the buffer to a file, then the buffer will become not modified. Also if
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
800 you see @samp{%%} at the beginning of the mode line, it means that the file
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
801 associated with the buffer is write protected.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
802
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
803 We have the following commands related to windows and buffers.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
804
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
805 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
806 @item C-n
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
807 @kindex 016 @kbd{C-n} (@code{vip-next-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
808 Move cursor to the next-window (@code{vip-next-window}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
809 @item X 1
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
810 @kindex 1301 @kbd{X 1} (@code{delete-other-windows})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
811 Delete other windows and make the selected window fill the screen
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
812 @*(@code{delete-other-windows}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
813 @item X 2
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
814 @kindex 1301 @kbd{X 2} (@code{split-window-vertically})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
815 Split current window into two windows (@code{split-window-vertically}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
816 @item X 3
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
817 @kindex 1301 @kbd{X 3} (@code{vip-buffer-in-two-windows})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
818 Show current buffer in two windows.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
819 @item s @var{buffer} @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
820 @kindex 163 @kbd{s} (@code{vip-switch-to-buffer})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
821 Select or create a buffer named @var{buffer} (@code{vip-switch-to-buffer}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
822 @item S @var{buffer} @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
823 @kindex 123 @kbd{S} (@code{vip-switch-to-buffer-other-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
824 Similar but select a buffer named @var{buffer} in another window
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
825 @*(@code{vip-switch-to-buffer-other-window}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
826 @item K
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
827 @kindex 113 @kbd{K} (@code{vip-kill-buffer})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
828 Kill the current buffer if it is not modified or if it is not associated
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
829 with a file @*(@code{vip-kill-buffer}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
830 @item X B
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
831 @kindex 1302 @kbd{X B} (@code{list-buffers})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
832 List the existing buffers (@code{list-buffers}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
833 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
834
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
835 @cindex buffer name completion
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
836
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
837 As @dfn{buffer name completion} is provided, you have only to type in
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
838 initial substring of the buffer name which is sufficient to identify it
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
839 among names of existing buffers. After that, if you hit @key{TAB} the rest
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
840 of the buffer name will be supplied by the system, and you can confirm it
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
841 by @key{RET}. The default buffer name to switch to will also be prompted,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
842 and you can select it by giving a simple @key{RET}. See GNU Emacs Manual
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
843 for details of completion.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
844
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
845 @node Files, Viewing the Buffer, Buffers and Windows, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
846 @section Files
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
847
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
848 We have the following commands related to files. They are used to visit,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
849 save and insert files.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
850
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
851 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
852 @item v @var{file} @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
853 @kindex 166 @kbd{v} (@code{vip-find-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
854 Visit specified file in the current window (@code{vip-find-file}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
855 @item V @var{file} @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
856 @kindex 126 @kbd{V} (@code{vip-find-file-other-window})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
857 Visit specified file in another window (@code{vip-find-file-other-window}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
858 @item X S
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
859 @kindex 1302 @kbd{X S} (@code{save-buffer})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
860 Save current buffer to the file associated with the buffer. If no file is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
861 associated with the buffer, the name of the file to write out the content
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
862 of the buffer will be asked in the minibuffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
863 @item X W @var{file} @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
864 @kindex 1302 @kbd{X W} (@code{write-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
865 Write current buffer into a specified file.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
866 @item X I @var{file} @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
867 @kindex 1302 @kbd{X I} (@code{insert-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
868 Insert a specified file at point.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
869 @item g
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
870 @kindex 147 @kbd{g} (@code{vip-info-on-file})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
871 Give information on the file associated with the current buffer. Tell you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
872 the name of the file associated with the buffer, the line number of the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
873 current point and total line numbers in the buffer. If no file is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
874 associated with the buffer, this fact will be indicated by the null file
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
875 name @samp{""}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
876 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
877
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
878 @cindex visiting (a file)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
879 @cindex default directory
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
880
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
881 In Emacs, you can edit a file by @dfn{visiting} it. If you wish to visit a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
882 file in the current window, you can just type @kbd{v}. Emacs maintains the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
883 @dfn{default directory} which is specific to each buffer. Suppose, for
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
884 instance, that the default directory of the current buffer is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
885 @file{/usr/masahiko/lisp/}. Then you will get the following prompt in the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
886 minibuffer.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
887 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
888 visit file: /usr/masahiko/lisp/
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
889 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
890 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
891 @cindex file name completion
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
892 If you wish to visit, say, @file{vip.el} in this directory, then you can
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
893 just type @samp{vip.el} followed by @key{RET}. If the file @file{vip.el}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
894 already exists in the directory, Emacs will visit that file, and if not,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
895 the file will be created. Emacs will use the file name (@file{vip.el}, in
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
896 this case) as the name of the buffer visiting the file. In order to make
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
897 the buffer name unique, Emacs may append @samp{<2>}, @samp{<3>} etc., to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
898 the buffer name. As the @dfn{file name completion} is provided here, you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
899 can sometime save typing. For instance, suppose there is only one file in the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
900 default directory whose name starts with @samp{v}, that is @samp{vip.el}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
901 Then if you just type @kbd{v @key{TAB}} then it will be completed to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
902 @samp{vip.el}. Thus, in this case, you just have to type @kbd{v v @key{TAB}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
903 @key{RET}} to visit @file{/usr/masahiko/lisp/vip.el}. Continuing the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
904 example, let us now suppose that you wished to visit the file
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
905 @file{/usr/masahiko/man/vip.texinfo}. Then to the same prompt which you get
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
906 after you typed @kbd{v}, you can enter @samp{/usr/masahiko/man/vip.texinfo} or
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
907 @samp{../man/vip.texinfo} followed by @key{RET}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
908
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
909 Use @kbd{V} instead of @kbd{v}, if you wish to visit a file in another
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
910 window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
911
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
912 You can verify which file you are editing by typing @kbd{g}. (You can also
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
913 type @kbd{X B} to get information on other buffers too.) If you type
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
914 @kbd{g} you will get an information like below in the echo area:@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
915 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
916 "/usr/masahiko/man/vip.texinfo" line 921 of 1949
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
917 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
918
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
919 After you edited the buffer (@samp{vip.texinfo}, in our example) for a while,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
920 you may wish to save it in a file. If you wish to save it in the file
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
921 associated with the buffer (@file{/usr/masahiko/man/vip.texinfo}, in this
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
922 case), you can just say @kbd{X S}. If you wish to save it in another file,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
923 you can type @kbd{X W}. You will then get a similar prompt as you get for
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
924 @kbd{v}, to which you can enter the file name.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
925
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
926 @node Viewing the Buffer, Mark Commands, Files, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
927 @section Viewing the Buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
928
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
929 In this and next section we discuss commands for moving around in the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
930 buffer. These command do not change the content of the buffer. The
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
931 following commands are useful for viewing the content of the current
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
932 buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
933
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
934 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
935 @item @key{SPC}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
936 @itemx C-f
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
937 @kindex 040 @kbd{SPC} (@code{vip-scroll})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
938 @kindex 006 @kbd{C-f} (@code{vip-scroll-back})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
939 Scroll text of current window upward almost full screen. You can go
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
940 @i{forward} in the buffer by this command (@code{vip-scroll}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
941 @item @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
942 @itemx C-b
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
943 @kindex 015 @kbd{RET} (@code{vip-scroll-back})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
944 @kindex 002 @kbd{C-b} (@code{vip-scroll-back})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
945 Scroll text of current window downward almost full screen. You can go
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
946 @i{backward} in the buffer by this command (@code{vip-scroll-back}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
947 @itemx C-d
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
948 @kindex 004 @kbd{C-d} (@code{vip-scroll-up})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
949 Scroll text of current window upward half screen. You can go
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
950 @i{down} in the buffer by this command (@code{vip-scroll-down}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
951 @itemx C-u
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
952 @kindex 025 @kbd{C-u} (@code{vip-scroll-down})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
953 Scroll text of current window downward half screen. You can go
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
954 @i{up} in the buffer by this command (@code{vip-scroll-up}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
955 @item C-y
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
956 @kindex 031 @kbd{C-y} (@code{vip-scroll-down-one})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
957 Scroll text of current window upward by one line (@code{vip-scroll-down-one}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
958 @item C-e
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
959 @kindex 005 @kbd{C-e} (@code{vip-scroll-up-one})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
960 Scroll text of current window downward by one line (@code{vip-scroll-up-one}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
961 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
962 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
963 You can repeat these commands by giving a count. Thus, @kbd{2 @key{SPC}}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
964 has the same effect as @kbd{@key{SPC} @key{SPC}}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
965
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
966 The following commands reposition point in the window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
967
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
968 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
969 @item z H
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
970 @itemx z @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
971 @kindex 1723 @kbd{z H} (@code{vip-line-to-top})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
972 @kindex 1721 @kbd{z RET} (@code{vip-line-to-top})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
973 Put point on the top (@i{home}) line in the window. So the current line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
974 becomes the top line in the window. Given a count @var{n}, point will be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
975 placed in the @var{n}-th line from top (@code{vip-line-to-top}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
976 @item z M
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
977 @itemx z .
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
978 @kindex 1723 @kbd{z M} (@code{vip-line-to-middle})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
979 @kindex 1722 @kbd{z .} (@code{vip-line-to-middle})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
980 Put point on the @i{middle} line in the window. Given a count @var{n},
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
981 point will be placed in the @var{n}-th line from the middle line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
982 (@code{vip-line-to-middle}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
983 @item z L
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
984 @itemx z -
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
985 @kindex 1723 @kbd{z L} (@code{vip-line-to-bottom})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
986 @kindex 1722 @kbd{z -} (@code{vip-line-to-bottom})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
987 Put point on the @i{bottom} line in the window. Given a count @var{n},
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
988 point will be placed in the @var{n}-th line from bottom
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
989 (@code{vip-line-to-bottom}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
990 @item C-l
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
991 Center point in window and redisplay screen (@code{recenter}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
992 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
993
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
994 @node Mark Commands, Motion Commands, Viewing the Buffer, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
995 @section Mark Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
996
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
997 The following commands are used to mark positions in the buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
998
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
999 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1000 @item m @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1001 @kindex 155 @kbd{m} (@code{vip-mark-point})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1002 Store current point in the register @var{ch}. @var{ch} must be a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1003 lower-case @acronym{ASCII} letter.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1004 @item m <
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1005 Set mark at the beginning of current buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1006 @item m >
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1007 Set mark at the end of current buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1008 @item m .
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1009 Set mark at point.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1010 @item m ,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1011 Jump to mark (and pop mark off the mark ring).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1012 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1013
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1014 @cindex mark ring
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1015
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1016 Emacs uses the @dfn{mark ring} to store marked positions. The commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1017 @kbd{m <}, @kbd{m >} and @kbd{m .}@: not only set mark but also add it as the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1018 latest element of the mark ring (replacing the oldest one). By repeating
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1019 the command `@kbd{m ,}' you can visit older and older marked positions. You
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1020 will eventually be in a loop as the mark ring is a ring.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1021
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1022 @node Motion Commands, Searching and Replacing, Mark Commands, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1023 @section Motion Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1024
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1025 Commands for moving around in the current buffer are collected here. These
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1026 commands are used as an `argument' for the delete, change and yank commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1027 to be described in the next section.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1028
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1029 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1030 @item h
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1031 @kindex 150 @kbd{h} (@code{vip-backward-char})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1032 Move point backward by one character. Signal error if point is at the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1033 beginning of buffer, but (unlike Vi) do not complain otherwise
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1034 (@code{vip-backward-char}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1035 @item l
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1036 @kindex 154 @kbd{l} (@code{vip-forward-char})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1037 Move point backward by one character. Signal error if point is at the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1038 end of buffer, but (unlike Vi) do not complain otherwise
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1039 (@code{vip-forward-char}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1040 @item j
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1041 @kindex 152 @kbd{j} (@code{vip-next-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1042 Move point to the next line keeping the current column. If point is on the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1043 last line of the buffer, a new line will be created and point will move to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1044 that line (@code{vip-next-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1045 @item k
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1046 @kindex 153 @kbd{k} (@code{vip-previous-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1047 Move point to the previous line keeping the current column
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1048 (@code{vip-next-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1049 @item +
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1050 @kindex 053 @kbd{+} (@code{vip-next-line-at-bol})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1051 Move point to the next line at the first non-white character. If point is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1052 on the last line of the buffer, a new line will be created and point will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1053 move to the beginning of that line (@code{vip-next-line-at-bol}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1054 @item -
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1055 @kindex 055 @kbd{-} (@code{vip-previous-line-at-bol})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1056 Move point to the previous line at the first non-white character
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1057 (@code{vip-previous-line-at-bol}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1058 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1059 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1060 If a count is given to these commands, the commands will be repeated that
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1061 many times.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1062
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1063 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1064 @item 0
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1065 @kindex 060 @kbd{0} (@code{vip-beginning-of-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1066 Move point to the beginning of line (@code{vip-beginning-of-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1067 @item ^
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1068 @kindex 136 @kbd{^} (@code{vip-bol-and-skip-white})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1069 Move point to the first non-white character on the line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1070 (@code{vip-bol-and-skip-white}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1071 @item $
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1072 @kindex 044 @kbd{$} (@code{vip-goto-eol})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1073 Move point to the end of line (@code{vip-goto-eol}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1074 @item @var{n} |
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1075 @kindex 174 @kbd{|} (@code{vip-goto-col})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1076 Move point to the @var{n}-th column on the line (@code{vip-goto-col}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1077 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1078 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1079 Except for the @kbd{|} command, these commands neglect a count.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1080
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1081 @cindex word
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1082
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1083 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1084 @item w
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1085 @kindex 167 @kbd{w} (@code{vip-forward-word})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1086 Move point forward to the beginning of the next word
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1087 (@code{vip-forward-word}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1088 @item W
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1089 @kindex 127 @kbd{W} (@code{vip-forward-Word})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1090 Move point forward to the beginning of the next word, where a @dfn{word} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1091 considered as a sequence of non-white characters (@code{vip-forward-Word}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1092 @item b
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1093 @kindex 142 @kbd{b} (@code{vip-backward-word})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1094 Move point backward to the beginning of a word (@code{vip-backward-word}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1095 @item B
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1096 @kindex 102 @kbd{B} (@code{vip-backward-Word})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1097 Move point backward to the beginning of a word, where a @i{word} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1098 considered as a sequence of non-white characters (@code{vip-forward-Word}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1099 @item e
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1100 @kindex 145 @kbd{e} (@code{vip-end-of-word})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1101 Move point forward to the end of a word (@code{vip-end-of-word}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1102 @item E
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1103 @kindex 105 @kbd{E} (@code{vip-end-of-Word})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1104 Move point forward to the end of a word, where a @i{word} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1105 considered as a sequence of non-white characters (@code{vip-end-of-Word}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1106 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1107 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1108 @cindex syntax table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1109 Here the meaning of the word `word' for the @kbd{w}, @kbd{b} and @kbd{e}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1110 commands is determined by the @dfn{syntax table} effective in the current
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1111 buffer. Each major mode has its syntax mode, and therefore the meaning of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1112 a word also changes as the major mode changes. See GNU Emacs Manual for
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1113 details of syntax table.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1114
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1115 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1116 @item H
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1117 @kindex 110 @kbd{H} (@code{vip-window-top})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1118 Move point to the beginning of the @i{home} (top) line of the window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1119 Given a count @var{n}, go to the @var{n}-th line from top
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1120 (@code{vip-window-top}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1121 @item M
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1122 @kindex 115 @kbd{M} (@code{vip-window-middle})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1123 Move point to the beginning of the @i{middle} line of the window. Given
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1124 a count @var{n}, go to the @var{n}-th line from the middle line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1125 (@code{vip-window-middle}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1126 @item L
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1127 @kindex 114 @kbd{L} (@code{vip-window-bottom})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1128 Move point to the beginning of the @i{lowest} (bottom) line of the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1129 window. Given count, go to the @var{n}-th line from bottom
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1130 (@code{vip-window-bottom}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1131 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1132 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1133 These commands can be used to go to the desired line visible on the screen.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1134
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1135 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1136 @item (
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1137 @kindex 050 @kbd{(} (@code{vip-backward-sentence})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1138 Move point backward to the beginning of the sentence
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1139 (@code{vip-backward-sentence}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1140 @item )
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1141 @kindex 051 @kbd{)} (@code{vip-forward-sentence})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1142 Move point forward to the end of the sentence
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1143 (@code{vip-forward-sentence}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1144 @item @{
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1145 @kindex 173 @kbd{@{} (@code{vip-backward-paragraph})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1146 Move point backward to the beginning of the paragraph
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1147 (@code{vip-backward-paragraph}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1148 @item @}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1149 @kindex 175 @kbd{@}} (@code{vip-forward-paragraph})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1150 Move point forward to the end of the paragraph
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1151 (@code{vip-forward-paragraph}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1152 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1153 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1154 A count repeats the effect for these commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1155
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1156 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1157 @item G
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1158 @kindex 107 @kbd{G} (@code{vip-goto-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1159 Given a count @var{n}, move point to the @var{n}-th line in the buffer on
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1160 the first non-white character. Without a count, go to the end of the buffer
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1161 (@code{vip-goto-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1162 @item ` `
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1163 @kindex 140 @kbd{`} (@code{vip-goto-mark})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1164 Exchange point and mark (@code{vip-goto-mark}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1165 @item ` @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1166 Move point to the position stored in the register @var{ch}. @var{ch} must
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1167 be a lower-case letter.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1168 @item ' '
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1169 @kindex 047 @kbd{'} (@code{vip-goto-mark-and-skip-white})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1170 Exchange point and mark, and then move point to the first non-white
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1171 character on the line (@code{vip-goto-mark-and-skip-white}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1172 @item ' @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1173 Move point to the position stored in the register @var{ch} and skip to the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1174 first non-white character on the line. @var{ch} must be a lower-case letter.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1175 @item %
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1176 @kindex 045 @kbd{%} (@code{vip-paren-match})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1177 Move point to the matching parenthesis if point is looking at @kbd{(},
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1178 @kbd{)}, @kbd{@{}, @kbd{@}}, @kbd{[} or @kbd{]}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1179 @*(@code{vip-paren-match}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1180 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1181 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1182 The command @kbd{G} mark point before move, so that you can return to the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1183 original point by @kbd{` `}. The original point will also be stored in
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1184 the mark ring.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1185
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1186 The following commands are useful for moving points on the line. A count
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1187 will repeat the effect.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1188
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1189 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1190 @item f @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1191 @kindex 146 @kbd{f} (@code{vip-find-char-forward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1192 Move point forward to the character @var{ch} on the line. Signal error if
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1193 @var{ch} could not be found (@code{vip-find-char-forward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1194 @item F @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1195 @kindex 106 @kbd{F} (@code{vip-find-char-backward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1196 Move point backward to the character @var{ch} on the line. Signal error if
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1197 @var{ch} could not be found (@code{vip-find-char-backward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1198 @item t @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1199 @kindex 164 @kbd{t} (@code{vip-goto-char-forward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1200 Move point forward upto the character @var{ch} on the line. Signal error if
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1201 @var{ch} could not be found (@code{vip-goto-char-forward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1202 @item T @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1203 @kindex 124 @kbd{T} (@code{vip-goto-char-backward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1204 Move point backward upto the character @var{ch} on the line. Signal error if
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1205 @var{ch} could not be found (@code{vip-goto-char-backward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1206 @item ;
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1207 @kindex 073 @kbd{;} (@code{vip-repeat-find})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1208 Repeat previous @kbd{f}, @kbd{t}, @kbd{F} or @kbd{T} command
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1209 (@code{vip-repeat-find}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1210 @item ,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1211 @kindex 054 @kbd{,} (@code{vip-repeat-find-opposite})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1212 Repeat previous @kbd{f}, @kbd{t}, @kbd{F} or @kbd{T} command, in the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1213 opposite direction (@code{vip-repeat-find-opposite}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1214 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1215
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1216 @node Searching and Replacing, Modifying Commands, Motion Commands, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1217 @section Searching and Replacing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1218
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1219 Following commands are available for searching and replacing.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1220
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1221 @cindex regular expression (search)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1222
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1223 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1224 @item / @var{string} @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1225 @kindex 057 @kbd{/} (@code{vip-search-forward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1226 Search the first occurrence of the string @var{string} forward starting
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1227 from point. Given a count @var{n}, the @var{n}-th occurrence of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1228 @var{string} will be searched. If the variable @code{vip-re-search} has value
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1229 @code{t} then @dfn{regular expression} search is done and the string
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1230 matching the regular expression @var{string} is found. If you give an
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1231 empty string as @var{string} then the search mode will change from vanilla
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1232 search to regular expression search and vice versa
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1233 (@code{vip-search-forward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1234 @item ? @var{string} @key{RET}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1235 @kindex 077 @kbd{?} (@code{vip-search-backward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1236 Same as @kbd{/}, except that search is done backward
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1237 (@code{vip-search-backward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1238 @item n
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1239 @kindex 156 @kbd{n} (@code{vip-search-next})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1240 Search the previous search pattern in the same direction as before
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1241 (@code{vip-search-next}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1242 @item N
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1243 @kindex 116 @kbd{N} (@code{vip-search-Next})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1244 Search the previous search pattern in the opposite direction
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1245 (@code{vip-search-Next}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1246 @item C-s
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1247 @kindex 023 @kbd{C-s} (@code{isearch-forward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1248 Search forward incrementally. See GNU Emacs Manual for details
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1249 (@code{isearch-forward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1250 @item C-r
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1251 @kindex 022 @kbd{C-r} (@code{isearch-backward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1252 Search backward incrementally (@code{isearch-backward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1253 @cindex vanilla (replacement)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1254 @cindex regular expression (replacement)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1255 @item R @var{string} RET @var{newstring}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1256 @kindex 122 @kbd{R} (@code{vip-replace-string})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1257 There are two modes of replacement, @dfn{vanilla} and @dfn{regular expression}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1258 If the mode is @i{vanilla} you will get a prompt @samp{Replace string:},
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1259 and if the mode is @i{regular expression} you will ge a prompt
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1260 @samp{Replace regexp:}. The mode is initially @i{vanilla}, but you can
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1261 toggle these modes by giving a null string as @var{string}. If the mode is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1262 vanilla, this command replaces every occurrence of @var{string} with
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1263 @var{newstring}. If the mode is regular expression, @var{string} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1264 treated as a regular expression and every string matching the regular
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1265 expression is replaced with @var{newstring} (@code{vip-replace-string}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1266 @item Q @var{string} RET @var{newstring}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1267 @kindex 121 @kbd{Q} (@code{vip-query-replace})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1268 Same as @kbd{R} except that you will be asked form confirmation before each
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1269 replacement
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1270 @*(@code{vip-query-replace}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1271 @item r @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1272 @kindex 162 @kbd{r} (@code{vip-replace-char})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1273 Replace the character point is looking at by the character @var{ch}. Give
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1274 count, replace that many characters by @var{ch} (@code{vip-replace-char}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1275 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1276 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1277 The commands @kbd{/} and @kbd{?} mark point before move, so that you can
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1278 return to the original point by @w{@kbd{` `}}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1279
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1280 @node Modifying Commands, Delete Commands, Searching and Replacing, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1281 @section Modifying Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1282
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1283 In this section, commands for modifying the content of a buffer are
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1284 described. These commands affect the region determined by a motion command
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1285 which is given to the commands as their argument.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1286
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1287 @cindex point commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1288 @cindex line commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1289
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1290 We classify motion commands into @dfn{point commands} and
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1291 @dfn{line commands}. The point commands are as follows:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1292 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1293 @kbd{h}, @kbd{l}, @kbd{0}, @kbd{^}, @kbd{$}, @kbd{w}, @kbd{W}, @kbd{b}, @kbd{B}, @kbd{e}, @kbd{E}, @kbd{(}, @kbd{)}, @kbd{/}, @kbd{?}, @kbd{`}, @kbd{f}, @kbd{F}, @kbd{t}, @kbd{T}, @kbd{%}, @kbd{;}, @kbd{,}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1294 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1295 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1296 The line commands are as follows:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1297 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1298 @kbd{j}, @kbd{k}, @kbd{+}, @kbd{-}, @kbd{H}, @kbd{M}, @kbd{L}, @kbd{@{}, @kbd{@}}, @kbd{G}, @kbd{'}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1299 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1300 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1301 @cindex expanding (region)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1302 If a point command is given as an argument to a modifying command, the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1303 region determined by the point command will be affected by the modifying
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1304 command. On the other hand, if a line command is given as an argument to a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1305 modifying command, the region determined by the line command will be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1306 enlarged so that it will become the smallest region properly containing the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1307 region and consisting of whole lines (we call this process @dfn{expanding
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1308 the region}), and then the enlarged region will be affected by the modifying
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1309 command.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1310
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1311 @menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1312 * Delete Commands:: Commands for deleting text.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1313 * Yank Commands:: Commands for yanking text in Vi's sense.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1314 * Put Back Commands:: Commands for putting back deleted/yanked text.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1315 * Change Commands:: Commands for changing text.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1316 * Repeating and Undoing Modifications::
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1317 @end menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1318 @node Delete Commands, Yank Commands, Modifying Commands, Modifying Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1319 @subsection Delete Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1320
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1321 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1322 @item d @var{motion-command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1323 @kindex 1440 @kbd{d} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1324 Delete the region determined by the motion command @var{motion-command}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1325 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1326 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1327 For example, @kbd{d $} will delete the region between point and end of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1328 current line since @kbd{$} is a point command that moves point to end of line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1329 @kbd{d G} will delete the region between the beginning of current line and
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1330 end of the buffer, since @kbd{G} is a line command. A count given to the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1331 command above will become the count for the associated motion command.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1332 Thus, @kbd{3 d w} will delete three words.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1333
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1334 @kindex 042 @kbd{"} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1335 It is also possible to save the deleted text into a register you specify.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1336 For example, you can say @kbd{" t 3 d w} to delete three words and save it
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1337 to register @kbd{t}. The name of a register is a lower-case letter between
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1338 @kbd{a} and @kbd{z}. If you give an upper-case letter as an argument to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1339 a delete command, then the deleted text will be appended to the content of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1340 the register having the corresponding lower-case letter as its name. So,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1341 @kbd{" T d w} will delete a word and append it to register @kbd{t}. Other
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1342 modifying commands also accept a register name as their argument, and we
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1343 will not repeat similar explanations.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1344
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1345 We have more delete commands as below.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1346
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1347 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1348 @item d d
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1349 @kindex 1442 @kbd{d d}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1350 Delete a line. Given a count @var{n}, delete @var{n} lines.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1351 @item d r
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1352 @kindex 1442 @kbd{d r}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1353 Delete current region.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1354 @item d R
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1355 @kindex 1441 @kbd{d R}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1356 Expand current region and delete it.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1357 @item D
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1358 @kindex 104 @kbd{D} (@code{vip-kill-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1359 Delete to the end of a line (@code{vip-kill-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1360 @item x
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1361 @kindex 170 @kbd{x} (@code{vip-delete-char})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1362 Delete a character after point. Given @var{n}, delete @var{n} characters
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1363 (@code{vip-delete-char}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1364 @item @key{DEL}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1365 @kindex 177 @kbd{DEL} (@code{vip-delete-backward-char})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1366 Delete a character before point. Given @var{n}, delete @var{n} characters
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1367 (@code{vip-delete-backward-char}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1368 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1369
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1370 @node Yank Commands, Put Back Commands, Delete Commands, Modifying Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1371 @subsection Yank Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1372
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1373 @cindex yank
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1374
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1375 Yank commands @dfn{yank} a text of buffer into a (usually anonymous) register.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1376 Here the word `yank' is used in Vi's sense. Thus yank commands do not
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1377 alter the content of the buffer, and useful only in combination with
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1378 commands that put back the yanked text into the buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1379
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1380 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1381 @item y @var{motion-command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1382 @kindex 1710 @kbd{y} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1383 Yank the region determined by the motion command @var{motion-command}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1384 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1385 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1386 For example, @kbd{y $} will yank the text between point and the end of line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1387 into an anonymous register, while @kbd{"c y $} will yank the same text into
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1388 register @kbd{c}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1389
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1390 Use the following command to yank consecutive lines of text.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1391
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1392 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1393 @item y y
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1394 @itemx Y
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1395 @kindex 131 @kbd{Y} (@code{vip-yank-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1396 @kindex 1712 @kbd{y y} (@code{vip-yank-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1397 Yank a line. Given @var{n}, yank @var{n} lines (@code{vip-yank-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1398 @item y r
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1399 @kindex 1712 @kbd{y r}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1400 Yank current region.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1401 @item y R
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1402 @kindex 1711 @kbd{y R}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1403 Expand current region and yank it.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1404 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1405
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1406 @node Put Back Commands, Change Commands, Yank Commands, Modifying Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1407 @subsection Put Back Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1408 Deleted or yanked texts can be put back into the buffer by the command
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1409 below.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1410
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1411 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1412 @item p
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1413 @kindex 160 @kbd{p} (@code{vip-put-back})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1414 Insert, after the character point is looking at, most recently
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1415 deleted/yanked text from anonymous register. Given a register name
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1416 argument, the content of the named register will be put back. Given a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1417 count, the command will be repeated that many times. This command also
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1418 checks if the text to put back ends with a new line character, and if so
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1419 the text will be put below the current line (@code{vip-put-back}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1420 @item P
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1421 @kindex 120 @kbd{P} (@code{vip-Put-back})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1422 Insert at point most recently deleted/yanked text from anonymous register.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1423 Given a register name argument, the content of the named register will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1424 be put back. Given a count, the command will be repeated that many times.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1425 This command also checks if the text to put back ends with a new line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1426 character, and if so the text will be put above the current line rather
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1427 than at point (@code{vip-Put-back}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1428 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1429 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1430 @cindex number register
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1431 Thus, @kbd{" c p} will put back the content of the register @kbd{c} into the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1432 buffer. It is also possible to specify @dfn{number register} which is a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1433 numeral between @kbd{1} and @kbd{9}. If the number register @var{n} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1434 specified, @var{n}-th previously deleted/yanked text will be put back. It
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1435 is an error to specify a number register for the delete/yank commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1436
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1437 @node Change Commands, Repeating and Undoing Modifications, Put Back Commands, Modifying Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1438 @subsection Change Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1439
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1440 Most commonly used change command takes the following form.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1441
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1442 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1443 @item c @var{motion-command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1444 @kindex 1430 @kbd{c} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1445 Replace the content of the region determined by the motion command
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1446 @var{motion-command} by the text you type. If the motion command is a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1447 point command then you will type the text into minibuffer, and if the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1448 motion command is a line command then the region will be deleted first and
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1449 you can insert the text in @var{insert mode}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1450 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1451 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1452 For example, if point is at the beginning of a word @samp{foo} and you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1453 wish to change it to @samp{bar}, you can type @kbd{c w}. Then, as @kbd{w}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1454 is a point command, you will get the prompt @samp{foo =>} in the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1455 minibuffer, for which you can type @kbd{b a r @key{RET}} to complete the change
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1456 command.@refill
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1457
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1458 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1459 @item c c
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1460 @kindex 1432 @kbd{c c}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1461 Change a line. Given a count, that many lines are changed.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1462 @item c r
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1463 @kindex 1432 @kbd{c r}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1464 Change current region.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1465 @item c R
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1466 @kindex 1431 @kbd{c R}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1467 Expand current region and change it.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1468 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1469
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1470 @node Repeating and Undoing Modifications, Other Vi Commands, Change Commands, Modifying Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1471 @subsection Repeating and Undoing Modifications
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1472
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1473 VIP records the previous modifying command, so that it is easy to repeat
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1474 it. It is also very easy to undo changes made by modifying commands.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1475
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1476 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1477 @item u
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1478 @kindex 165 @kbd{u} (@code{vip-undo})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1479 Undo the last change. You can undo more by repeating undo by the repeat
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1480 command @samp{.}. For example, you can undo 5 previous changes by typing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1481 @samp{u....}. If you type @samp{uu}, then the second @samp{u} undoes the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1482 first undo command (@code{vip-undo}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1483 @item .
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1484 @kindex 056 @kbd{.} (@code{vip-repeat})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1485 Repeat the last modifying command. Given count @var{n} it becomes the new
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1486 count for the repeated command. Otherwise, the count for the last
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1487 modifying command is used again (@code{vip-repeat}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1488 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1489
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1490 @node Other Vi Commands, Commands in Insert Mode, Repeating and Undoing Modifications, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1491 @section Other Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1492
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1493 Miscellaneous Vi commands are collected here.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1494
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1495 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1496 @item Z Z
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1497 @kindex 132 @kbd{Z Z} (@code{save-buffers-kill-emacs})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1498 Exit Emacs. If modified buffers exist, you will be asked whether you wish
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1499 to save them or not (@code{save-buffers-kill-emacs}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1500 @item !@: @var{motion-command} @var{format-command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1501 @itemx @var{n} !@: !@: @var{format-command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1502 @kindex 041 @kbd{!} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1503 The region determined by the motion command @var{motion-command} will be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1504 given to the shell command @var{format-command} and the region will be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1505 replaced by its output. If a count is given, it will be passed to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1506 @var{motion-command}. For example, @samp{3!Gsort} will sort the region
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1507 between point and the 3rd line. If @kbd{!} is used instead of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1508 @var{motion-command} then @var{n} lines will be processed by
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1509 @var{format-command} (@code{vip-command-argument}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1510 @item J
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1511 @kindex 112 @kbd{J} (@code{vip-join-lines})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1512 Join two lines. Given count, join that many lines. A space will be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1513 inserted at each junction (@code{vip-join-lines}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1514 @item < @var{motion-command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1515 @itemx @var{n} < <
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1516 @kindex 074 @kbd{<} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1517 Shift region determined by the motion command @var{motion-command} to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1518 left by @var{shift-width} (default is 8). If @kbd{<} is used instead of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1519 @var{motion-command} then shift @var{n} lines
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1520 @*(@code{vip-command-argument}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1521 @item > @var{motion-command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1522 @itemx @var{n} > >
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1523 @kindex 076 @kbd{>} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1524 Shift region determined by the motion command @var{motion-command} to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1525 right by @var{shift-width} (default is 8). If @kbd{<} is used instead of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1526 @var{motion-command} then shift @var{n} lines
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1527 @*(@code{vip-command-argument}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1528 @item = @var{motion-command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1529 @kindex 075 @kbd{=} (@code{vip-command-argument})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1530 Indent region determined by the motion command @var{motion-command}. If
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1531 @kbd{=} is used instead of @var{motion-command} then indent @var{n} lines
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1532 (@code{vip-command-argument}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1533 @item *
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1534 @kindex 052 @kbd{*} (@code{vip-call-last-kbd-macro})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1535 Call last remembered keyboard macro.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1536 @item #
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1537 A new vi operator. @xref{New Commands}, for more details.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1538 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1539
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1540 The following keys are reserved for future extensions, and currently
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1541 assigned to a function that just beeps (@code{vip-nil}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1542
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1543 @kindex 046 @kbd{&} (@code{vip-nil})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1544 @kindex 100 @kbd{@@} (@code{vip-nil})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1545 @kindex 125 @kbd{U} (@code{vip-nil})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1546 @kindex 133 @kbd{[} (@code{vip-nil})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1547 @kindex 135 @kbd{]} (@code{vip-nil})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1548 @kindex 137 @kbd{_} (@code{vip-nil})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1549 @kindex 161 @kbd{q} (@code{vip-nil})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1550 @kindex 176 @kbd{~} (@code{vip-nil})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1551
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1552 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1553 &, @@, U, [, ], _, q, ~
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1554 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1555
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1556 VIP uses a special local keymap to interpret key strokes you enter in vi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1557 mode. The following keys are bound to @var{nil} in the keymap. Therefore,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1558 these keys are interpreted by the global keymap of Emacs. We give below a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1559 short description of the functions bound to these keys in the global
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1560 keymap. See GNU Emacs Manual for details.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1561
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1562 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1563 @item C-@@
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1564 @kindex 000 @kbd{C-@@} (@code{set-mark-command})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1565 Set mark and push previous mark on mark ring (@code{set-mark-command}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1566 @item TAB
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1567 @kindex 011 TAB (@code{indent-for-tab-command})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1568 Indent line for current major mode (@code{indent-for-tab-command}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1569 @item C-j
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1570 @kindex 012 @kbd{C-j} (@code{newline-and-indent})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1571 Insert a newline, then indent according to mode (@code{newline-and-indent}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1572 @item C-k
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1573 @kindex 013 @kbd{C-k} (@code{kill-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1574 Kill the rest of the current line; before a newline, kill the newline.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1575 With a numeric argument, kill that many lines from point. Negative arguments
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1576 kill lines backward (@code{kill-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1577 @item C-l
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1578 @kindex 014 @kbd{C-l} (@code{recenter})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1579 Clear the screen and reprint everything (@code{recenter}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1580 @item @var{n} C-p
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1581 @kindex 020 @kbd{C-p} (@code{previous-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1582 Move cursor vertically up @var{n} lines (@code{previous-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1583 @item C-q
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1584 @kindex 021 @kbd{C-q} (@code{quoted-insert})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1585 Read next input character and insert it. Useful for inserting control
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1586 characters
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1587 @*(@code{quoted-insert}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1588 @item C-r
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1589 @kindex 022 @kbd{C-r} (@code{isearch-backward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1590 Search backward incrementally (@code{isearch-backward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1591 @item C-s
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1592 @kindex 023 @kbd{C-s} (@code{isearch-forward})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1593 Search forward incrementally (@code{isearch-forward}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1594 @item @var{n} C-t
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1595 @kindex 024 @kbd{C-t} (@code{transpose-chars})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1596 Interchange characters around point, moving forward one character. With
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1597 count @var{n}, take character before point and drag it forward past @var{n}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1598 other characters. If no argument and at end of line, the previous two
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1599 characters are exchanged (@code{transpose-chars}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1600 @item @var{n} C-v
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1601 @kindex 026 @kbd{C-v} (@code{scroll-up})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1602 Scroll text upward @var{n} lines. If @var{n} is not given, scroll near
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1603 full screen (@code{scroll-up}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1604 @item C-w
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1605 @kindex 027 @kbd{C-w} (@code{kill-region})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1606 Kill between point and mark. The text is save in the kill ring. The
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1607 command @kbd{P} or @kbd{p} can retrieve it from kill ring
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1608 (@code{kill-region}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1609 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1610
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1611 @node Commands in Insert Mode, Ex Commands, Other Vi Commands, Vi Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1612 @section Insert Mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1613
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1614 You can enter insert mode by one of the following commands. In addition to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1615 these, you will enter insert mode if you give a change command with a line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1616 command as the motion command. Insert commands are also modifying commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1617 and you can repeat them by the repeat command @kbd{.} (@code{vip-repeat}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1618
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1619 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1620 @item i
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1621 @kindex 151 @kbd{i} (@code{vip-insert})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1622 Enter insert mode at point (@code{vip-insert}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1623 @item I
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1624 @kindex 111 @kbd{I} (@code{vip-Insert})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1625 Enter insert mode at the first non white character on the line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1626 (@code{vip-Insert}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1627 @item a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1628 @kindex 141 @kbd{a} (@code{vip-append})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1629 Move point forward by one character and then enter insert mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1630 (@code{vip-append}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1631 @item A
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1632 @kindex 101 @kbd{A} (@code{vip-Append})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1633 Enter insert mode at end of line (@code{vip-Append}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1634 @item o
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1635 @kindex 157 @kbd{o} (@code{vip-open-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1636 Open a new line below the current line and enter insert mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1637 (@code{vip-open-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1638 @item O
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1639 @kindex 117 @kbd{O} (@code{vip-Open-line})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1640 Open a new line above the current line and enter insert mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1641 (@code{vip-Open-line}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1642 @item C-o
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1643 @kindex 017 @kbd{C-o} (@code{vip-open-line-at-point})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1644 Insert a newline and leave point before it, and then enter insert mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1645 @*(@code{vip-open-line-at-point}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1646 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1647
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1648 Insert mode is almost like emacs mode. Only the following 4 keys behave
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1649 differently from emacs mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1650
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1651 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1652 @item @key{ESC}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1653 @kindex 033 @kbd{ESC} (@code{vip-change-mode-to-vi}) (insert mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1654 This key will take you back to vi mode (@code{vip-change-mode-to-vi}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1655 @item C-h
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1656 @kindex 010 @kbd{C-h} (@code{delete-backward-char}) (insert mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1657 Delete previous character (@code{delete-backward-char}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1658 @item C-w
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1659 @kindex 027 @kbd{C-w} (@code{vip-delete-backward-word}) (insert mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1660 Delete previous word (@code{vip-delete-backward-word}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1661 @item C-z
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1662 @kindex 032 @kbd{C-z} (@code{vip-ESC}) (insert mode)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1663 This key simulates @key{ESC} key in emacs mode. For instance, typing
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1664 @kbd{C-z x} in insert mode is the same as typing @kbd{ESC x} in emacs mode
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1665 (@code{vip-ESC}).
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1666 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1667 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1668 You can also bind @kbd{C-h} to @code{help-command} if you like.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1669 (@xref{Customizing Key Bindings}, for details.) Binding @kbd{C-h} to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1670 @code{help-command} has the effect of making the meaning of @kbd{C-h}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1671 uniform among emacs, vi and insert modes.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1672
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1673 When you enter insert mode, VIP records point as the start point of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1674 insertion, and when you leave insert mode the region between point and
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1675 start point is saved for later use by repeat command etc. Therefore, repeat
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1676 command will not really repeat insertion if you move point by emacs
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1677 commands while in insert mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1678
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1679 @node Ex Commands, Ex Command Reference, Commands in Insert Mode, Top
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1680 @chapter Ex Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1681
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1682 @kindex 072 @kbd{:} (@code{vip-ex})
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1683
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1684 In vi mode, you can execute an Ex command @var{ex-command} by typing:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1685 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1686 @kbd{:@: @var{ex-command} @key{RET}}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1687 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1688 Every Ex command follows the following pattern:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1689 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1690 @var{address command} @kbd{!}@: @var{parameters count flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1691 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1692 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1693 @cindex address
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1694 where all parts are optional. For the syntax of @dfn{address}, the reader
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1695 is referred to the reference manual of Ex.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1696
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1697 @cindex magic
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1698 @cindex regular expression
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1699
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1700 In the current version of VIP, searching by Ex commands is always
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1701 @dfn{magic}. That is, search patterns are always treated as @dfn{regular
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1702 expressions}. For example, a typical forward search would be invoked by
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1703 @kbd{:/@var{pat}/}. If you wish to include @samp{/} as part of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1704 @var{pat} you must preceded it by @samp{\}. VIP strips off these @kbd{\}'s
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1705 before @kbd{/} and the resulting @var{pat} becomes the actual search
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1706 pattern. Emacs provides a different and richer class or regular
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1707 expressions than Vi/Ex, and VIP uses Emacs' regular expressions. See GNU
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1708 Emacs Manual for details of regular expressions.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1709
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1710 Several Ex commands can be entered in a line by separating them by a pipe
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1711 character @samp{|}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1712
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1713 @menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1714 * Ex Command Reference:: Explain all the Ex commands available in VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1715 @end menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1716 @node Ex Command Reference, Customization, Ex Commands, Ex Commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1717 @section Ex Command Reference
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1718 In this section we briefly explain all the Ex commands supported by VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1719 Most Ex commands expect @var{address} as their argument, and they use
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1720 default addresses if they are not explicitly given. In the following, such
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1721 default addresses will be shown in parentheses.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1722
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1723 Most command names can and preferably be given in abbreviated forms. In
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1724 the following, optional parts of command names will be enclosed in
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1725 brackets. For example, @samp{co[py]} will mean that copy command can be
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1726 give as @samp{co} or @samp{cop} or @samp{copy}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1727
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1728 If @var{command} is empty, point will move to the beginning of the line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1729 specified by the @var{address}. If @var{address} is also empty, point will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1730 move to the beginning of the current line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1731
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1732 @cindex flag
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1733
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1734 Some commands accept @dfn{flags} which are one of @kbd{p}, @kbd{l} and
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1735 @kbd{#}. If @var{flags} are given, the text affected by the commands will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1736 be displayed on a temporary window, and you will be asked to hit return to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1737 continue. In this way, you can see the text affected by the commands
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1738 before the commands will be executed. If you hit @kbd{C-g} instead of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1739 @key{RET} then the commands will be aborted. Note that the meaning of
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1740 @var{flags} is different in VIP from that in Vi/Ex.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1741
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1742 @table @kbd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1743 @item (.,.@:) co[py] @var{addr} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1744 @itemx (.,.@:) t @var{addr} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1745 Place a copy of specified lines after @var{addr}. If @var{addr} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1746 @kbd{0}, it will be placed before the first line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1747 @item (.,.@:) d[elete] @var{register} @var{count} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1748 Delete specified lines. Text will be saved in a named @var{register} if a
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1749 lower-case letter is given, and appended to a register if a capital letter is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1750 given.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1751 @item e[dit] !@: +@var{addr} @var{file}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1752 @itemx e[x] !@: +@var{addr} @var{file}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1753 @itemx vi[sual] !@: +@var{addr} @var{file}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1754 Edit a new file @var{file} in the current window. The command will abort
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1755 if current buffer is modified, which you can override by giving @kbd{!}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1756 If @kbd{+}@var{addr} is given, @var{addr} becomes the current line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1757 @item file
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1758 Give information about the current file.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1759 @item (1,$) g[lobal] !@: /@var{pat}/ @var{cmds}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1760 @itemx (1,$) v /@var{pat}/ @var{cmds}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1761 Among specified lines first mark each line which matches the regular
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1762 expression @var{pat}, and then execute @var{cmds} on each marked line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1763 If @kbd{!}@: is given, @var{cmds} will be executed on each line not matching
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1764 @var{pat}. @kbd{v} is same as @kbd{g!}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1765 @item (.,.+1) j[oin] !@: @var{count} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1766 Join specified lines into a line. Without @kbd{!}, a space character will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1767 be inserted at each junction.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1768 @item (.@:) k @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1769 @itemx (.@:) mar[k] @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1770 Mark specified line by a lower-case character @var{ch}. Then the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1771 addressing form @kbd{'}@var{ch} will refer to this line. No white space is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1772 required between @kbd{k} and @var{ch}. A white space is necessary between
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1773 @kbd{mark} and @var{ch}, however.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1774 @item map @var{ch} @var{rhs}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1775 Define a macro for vi mode. After this command, the character @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1776 will be expanded to @var{rhs} in vi mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1777 @item (.,.@:) m[ove] @var{addr}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1778 Move specified lines after @var{addr}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1779 @item (.@:) pu[t] @var{register}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1780 Put back previously deleted or yanked text. If @var{register} is given,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1781 the text saved in the register will be put back; otherwise, last deleted or
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1782 yanked text will be put back.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1783 @item q[uit] !
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1784 Quit from Emacs. If modified buffers with associated files exist, you will
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1785 be asked whether you wish to save each of them. At this point, you may
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1786 choose not to quit, by hitting @kbd{C-g}. If @kbd{!}@: is given, exit from
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1787 Emacs without saving modified buffers.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1788 @item (.@:) r[ead] @var{file}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1789 Read in the content of the file @var{file} after the specified line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1790 @item (.@:) r[ead] !@: @var{command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1791 Read in the output of the shell command @var{command} after the specified
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1792 line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1793 @item se[t]
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1794 Set a variable's value. @xref{Customizing Constants}, for the list of variables
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1795 you can set.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1796 @item sh[ell]
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1797 Run a subshell in a window.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1798 @item (.,.@:) s[ubstitute] /@var{pat}/@var{repl}/ @var{options} @var{count} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1799 @itemx (.,.@:) & @var{options} @var{count} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1800 On each specified line, the first occurrence of string matching regular
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1801 expression @var{pat} is replaced by replacement pattern @var{repl}. Option
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1802 characters are @kbd{g} and @kbd{c}. If global option character @kbd{g}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1803 appears as part of @var{options}, all occurrences are substituted. If
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1804 confirm option character @kbd{c} appears, you will be asked to give
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1805 confirmation before each substitution. If @kbd{/@var{pat}/@var{repl}/} is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1806 missing, the last substitution is repeated.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1807 @item st[op]
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1808 Suspend Emacs.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1809 @item ta[g] @var{tag}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1810 @cindex tag
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1811 @cindex selected tags table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1812 Find first definition of @var{tag}. If no @var{tag} is given, previously
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1813 given @var{tag} is used and next alternate definition is find. By default,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1814 the file @file{TAGS} in the current directory becomes the @dfn{selected tags
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1815 table}. You can select another tags table by @kbd{set} command.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1816 @xref{Customizing Constants}, for details.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1817 @item und[o]
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1818 Undo the last change.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1819 @item unm[ap] @var{ch}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1820 The macro expansion associated with @var{ch} is removed.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1821 @item ve[rsion]
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1822 Tell the version number of VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1823 @item (1,$) w[rite] !@: @var{file}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1824 Write out specified lines into file @var{file}. If no @var{file} is given,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1825 text will be written to the file associated to the current buffer. Unless
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1826 @kbd{!}@: is given, if @var{file} is different from the file associated to
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1827 the current buffer and if the file @var{file} exists, the command will not
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1828 be executed. Unlike Ex, @var{file} becomes the file associated to the
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1829 current buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1830 @item (1,$) w[rite]>> @var{file}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1831 Write out specified lines at the end of file @var{file}. @var{file}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1832 becomes the file associated to the current buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1833 @item (1,$) wq !@: @var{file}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1834 Same as @kbd{write} and then @kbd{quit}. If @kbd{!}@: is given, same as
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1835 @kbd{write !}@: then @kbd{quit}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1836 @item (.,.) y[ank] @var{register} @var{count}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1837 Save specified lines into register @var{register}. If no register is
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1838 specified, text will be saved in an anonymous register.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1839 @item @var{addr} !@: @var{command}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1840 Execute shell command @var{command}. The output will be shown in a new
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1841 window. If @var{addr} is given, specified lines will be used as standard
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1842 input to @var{command}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1843 @item ($) =
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1844 Print the line number of the addressed line.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1845 @item (.,.) > @var{count} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1846 Shift specified lines to the right. The variable @code{vip-shift-width}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1847 (default value is 8) determines the amount of shift.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1848 @item (.,.) < @var{count} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1849 Shift specified lines to the left. The variable @code{vip-shift-width}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1850 (default value is 8) determines the amount of shift.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1851 @item (.,.@:) ~ @var{options} @var{count} @var{flags}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1852 Repeat the previous @kbd{substitute} command using previous search pattern
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1853 as @var{pat} for matching.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1854 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1855
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1856 The following Ex commands are available in Vi, but not implemented in VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1857 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1858 @kbd{abbreviate}, @kbd{list}, @kbd{next}, @kbd{print}, @kbd{preserve}, @kbd{recover}, @kbd{rewind}, @kbd{source},
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1859 @kbd{unabbreviate}, @kbd{xit}, @kbd{z}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1860 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1861
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1862 @node Customization, Customizing Constants, Ex Command Reference, Top
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1863 @chapter Customization
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1864
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1865 If you have a file called @file{.vip} in your home directory, then it
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1866 will also be loaded when VIP is loaded. This file is thus useful for
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1867 customizing VIP.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1868
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1869 @menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1870 * Customizing Constants:: How to change values of constants.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1871 * Customizing Key Bindings:: How to change key bindings.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1872 @end menu
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1873
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1874 @node Customizing Constants, Customizing Key Bindings, Customization, Customization
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1875 @section Customizing Constants
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1876 An easy way to customize VIP is to change the values of constants used
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1877 in VIP. Here is the list of the constants used in VIP and their default
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1878 values.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1879
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1880 @table @code
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1881 @item vip-shift-width 8
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1882 The number of columns shifted by @kbd{>} and @kbd{<} command.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1883 @item vip-re-replace nil
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1884 If @code{t} then do regexp replace, if @code{nil} then do string replace.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1885 @item vip-search-wrap-around t
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1886 If @code{t}, search wraps around the buffer.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1887 @item vip-re-search nil
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1888 If @code{t} then search is reg-exp search, if @code{nil} then vanilla
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1889 search.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1890 @item vip-case-fold-search nil
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1891 If @code{t} search ignores cases.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1892 @item vip-re-query-replace nil
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1893 If @code{t} then do reg-exp replace in query replace.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1894 @item vip-open-with-indent nil
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1895 If @code{t} then indent to the previous current line when open a new line
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1896 by @kbd{o} or @kbd{O} command.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1897 @item vip-tags-file-name "TAGS"
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1898 The name of the file used as the tags table.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1899 @item vip-help-in-insert-mode nil
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1900 If @code{t} then @key{C-h} is bound to @code{help-command} in insert mode,
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1901 if @code{nil} then it sis bound to @code{delete-backward-char}.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1902 @end table
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1903 @noindent
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1904 You can reset these constants in VIP by the Ex command @kbd{set}. Or you
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1905 can include a line like this in your @file{.vip} file:
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1906 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1907 (setq vip-case-fold-search t)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1908 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1909
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1910 @node Customizing Key Bindings,, Customizing Constants, Customization
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1911 @section Customizing Key Bindings
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1912
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1913 @cindex local keymap
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1914
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1915 VIP uses @code{vip-command-mode-map} as the @dfn{local keymap} for vi mode.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1916 For example, in vi mode, @key{SPC} is bound to the function
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1917 @code{vip-scroll}. But, if you wish to make @key{SPC} and some other keys
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1918 behave like Vi, you can include the following lines in your @file{.vip}
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1919 file.
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1920
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1921 @example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1922 (define-key vip-command-mode-map "\C-g" 'vip-info-on-file)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1923 (define-key vip-command-mode-map "\C-h" 'vip-backward-char)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1924 (define-key vip-command-mode-map "\C-m" 'vip-next-line-at-bol)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1925 (define-key vip-command-mode-map " " 'vip-forward-char)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1926 (define-key vip-command-mode-map "g" 'vip-keyboard-quit)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1927 (define-key vip-command-mode-map "s" 'vip-substitute)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1928 (define-key vip-command-mode-map "C" 'vip-change-to-eol)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1929 (define-key vip-command-mode-map "R" 'vip-change-to-eol)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1930 (define-key vip-command-mode-map "S" 'vip-substitute-line)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1931 (define-key vip-command-mode-map "X" 'vip-delete-backward-char)
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1932 @end example
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1933
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1934 @node GNU Free Documentation License,,, Top
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1935 @appendix GNU Free Documentation License
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1936 @include doclicense.texi
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1937
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1938
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1939 @unnumbered Key Index
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1940
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1941 @printindex ky
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1942
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1943 @unnumbered Concept Index
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1944 @printindex cp
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1945
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1946 @setchapternewpage odd
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1947 @contents
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1948 @bye
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1949
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1950 @ignore
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1951 arch-tag: 7c5d17b9-1d21-4261-a88a-b9fdbbf1020b
299931d27e45 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1952 @end ignore