2 Elvis 1.4 CUT BUFFERS Page 6-1
7 When elvis deletes text, it stores that text in a cut buffer.
8 This happens in both visual mode and EX mode. There is no
9 practical limit to how much text a cut buffer can hold.
11 There are 36 cut buffers: 26 named buffers ("a through "z), 9
12 anonymous buffers ("1 through "9), and 1 extra cut buffer (".).
14 In EX mode, the :move and :copy commands use a cut buffer to
15 temporarily hold the text to be moved/copied.
20 In visual mode, text is copied into a cut buffer when you use
21 the d, y, c, C, or s commands.
23 By default, the text goes into the "1 buffer. The text that
24 used to be in "1 gets shifted into "2, "2 gets shifted into "3, and
25 so on. The text that used to be in "9 is lost. This way, the last
26 9 things you deleted are still accessible.
28 You can also put the text into a named buffer -- "a through "z.
29 To do this, you should type the buffer's name (two keystrokes: a
30 double-quote and a lowercase letter) before the d/y/c/C/s command.
31 When you do this, "1 through "9 are not affected by the cut.
33 You can append text to one of the named buffers. To do this,
34 type the buffer's name in uppercase (a double-quote and an
35 uppercase letter) before the d/y/c/C/s command.
37 The ". buffer is special. It isn't affected by the d/y/c/C/s
38 command. Instead, it stores the text that you typed in the last
39 time you were in input mode. It is used to implement the . visual
40 command, and ^A in input mode.
42 In EX mode (also known as colon mode), the :delete, :change, and
43 :yank commands all copy text into a cut buffer. Like the visual
44 commands, these EX commands normally use the "1 buffer, but you can
45 use one of the named buffers by giving its name after the command.
50 will copy lines 20 through 30 into cut buffer "a.
52 You can't directly put text into the ". buffer, or the "2
68 Elvis 1.4 CUT BUFFERS Page 6-2
71 E6.2 Pasting from a Cut BufferF
73 There are two styles of pasting: line-mode and character-mode.
74 If a cut buffer contains whole lines (from a command like "dd")
75 then line-mode pasting is used; if it contains partial lines (from
76 a command like "dw") then character-mode pasting is used. The EX
77 commands always cut whole lines.
79 Character-mode pasting causes the text to be inserted into the
80 line that the cursor is on.
82 Line-mode pasting inserts the text on a new line above or below
83 the line that the cursor is on. It doesn't affect the cursor's
86 In visual mode, the p and P commands insert text from a cut
87 buffer. Uppercase P will insert it before the cursor, and
88 lowercase p will insert it after the cursor. Normally, these
89 commands will paste from the "1 buffer, but you can specify any
90 other buffer to paste from. Just type its name (a double-quote and
91 another character) before you type the P or p.
93 In EX mode, the (pu)t command pastes text after a given line.
94 To paste from a buffer other that "1, enter its name after the
100 The contents of a named cut buffer can be executed as a series
103 To put the instructions into the cut buffer, you must first
104 insert them into the file, and then delete them into a named cut
107 To execute a cut buffer's contents as EX commands, you should
108 give the EX command "@" and the name of the buffer. For example,
109 :@z will execute "z as a series of EX commands.
111 To execute a cut buffer's contents as visual commands, you
112 should give the visual command "@" and the letter of the buffer's
113 name. The visual "@" command is different from the EX "@"
114 command. They interpret the cut buffer's contents differently.
116 The visual @ command can be rather finicky. Each character in
117 the buffer is interpretted as a keystroke. If you load the
118 instructions into the cut buffer via a "zdd command, then the
119 newline character at the end of the line will be executed just like
120 any other character, so the cursor would be moved down 1 line. If
121 you don't want the cursor to move down 1 line at the end of each @z
122 command, then you should load the cut buffer by saying 0"zD
125 Although cut buffers may hold any amount of text, elvis can only
126 -1execute-0 small buffers. For EX mode, the buffer is limited to about
127 1k bytes. For visual mode, the buffer is limited to about 80
128 bytes. If a buffer is too large to execute, an error message is
134 Elvis 1.4 CUT BUFFERS Page 6-3
139 You can't nest @ commands. You can't run @ commands from your
140 .exrc file, or any other :source file either. Similarly, you can't
141 run a :source command from within an @ command. Hopefully, these
142 restrictions will be lifted in a later version.
145 E6.4 The Effect of Switching FilesF
147 When elvis first starts up, all cut buffers are empty. When you
148 switch to a different file (via the :n or :e commands perhaps) the
149 9 anonymous cut buffers are emptied again, but the other 27 buffers