Lugaru's Epsilon
Editor 14.04

Epsilon User's Manual and Reference
   Commands by Topic
      . . .
      Moving Around
         Simple Movement Commands
         Moving in Larger Units
         . . .
         Comparing Many Files
      Changing Text
         Inserting and Deleting
         Killing Text
         Clipboard Access
         Rectangle Commands
         . . .
      Language Modes
         Asm Mode
         Batch Mode
         C Mode
         . . .
         Visual Basic Mode
      . . .

Previous   Up    Next
Inserting and Deleting  Commands by Topic   Clipboard Access

Epsilon User's Manual and Reference > Commands by Topic > Changing Text >

Killing Text

Epsilon has many commands to erase characters from a buffer. Some of these commands save the erased characters away in a special group of buffers called kill buffers, and some do not.

In Epsilon's terminology, to kill means to delete text and save it away in a kill buffer, and to delete means simply to remove the text and not save it away. Any consecutive sequence of killing commands will produce a single block of saved text. The Ctrl-y command then yanks back the entire block of text, inserting it before point. (Even when Epsilon deletes text and doesn't save it, you can usually use the undo command to recover the text. See Undoing.)

The Ctrl-k command kills to the end of the line, but does not remove the line separator. At the end of a line, though, it kills just the line separator. Thus, use two Ctrl-k's to completely remove a nonempty line. Give this command a numeric argument of n to kill exactly n lines, including the line separators. If you give the Ctrl-k command a negative numeric argument, -n, the command kills from the beginning of the previous nth line to point.

The kill-current-line command is an alternative to Ctrl-k. It kills the entire line in one step, including the line separator. The kill-to-end-of-line command kills the rest of the line. If point is at the end of the line, it does nothing. In Brief mode Epsilon uses these two commands in place of the kill-line command that's normally bound to Ctrl-k.

The commands to delete single characters will also save the characters if you give them a numeric argument (to delete that number of characters) or if they follow a command which itself kills text.

Several Epsilon commands operate on a region of text. To specify a region, move to either end of the region and press the Ctrl-@ key or the Ctrl-<Space> key. This sets the mark to the current value of point. Then move point to the other end of the region. The text between the mark and point specifies the region.

When you set the mark with Ctrl-@, Epsilon turns on highlighting for the region. As you move point away from the mark, the region appears in a highlighted color. This allows you to see exactly what text a region-sensitive command would operate upon. To turn the highlighting off, type Ctrl-x Ctrl-h. The Ctrl-x Ctrl-h command toggles highlighting for the region. If you prefix a nonzero numeric argument, it turns highlighting on; a numeric argument of zero turns highlighting off.

You can also check the ends of the region with the Ctrl-x Ctrl-x command. This switches point and mark, to let you see the other end of the region. Most commands do not care whether point (or mark) refers to the beginning or the end of the region.

The mark-whole-buffer command on Ctrl-x h provides a quick way to set point and mark around the entire buffer.

Another way to select text is to hold down the Shift key and move around using the arrow keys, or the keys <Home>, <End>, <PageUp>, or <PageDown>. Epsilon will select the text you move through. The shift-selects variable controls this feature.

The Ctrl-w command kills the region, saving it in a kill buffer. The Ctrl-y command then yanks back the text you've just killed, whether by the Ctrl-w command or any other command that kills text. It sets the region around the yanked text, so you can kill it again with a Ctrl-w, perhaps after adjusting the region at either end. The Alt-w command works like Ctrl-w, except that it does not remove any text from the buffer; it simply copies the text between point and mark to a kill buffer.

Each time you issue a sequence of killing commands, Epsilon saves the entire block of deleted text as a unit in one of its kill buffers. The Ctrl-y command yanks back the last of these blocks. To access the other blocks of killed text, use the Alt-y command. It follows a Ctrl-y or Alt-y command, and replaces the retrieved text with an earlier block of killed text. Each time you press Alt-y, Epsilon substitutes a block from another kill buffer, cycling from most recent back through the oldest, and then around to the most recent again.

In normal use, you go to the place you want to insert the text and issue the Ctrl-y command. If this doesn't provide the right text, give the Alt-y command repeatedly until you see the text you want. If the text you want does not appear in any of the killed blocks, you can get rid of the block with Ctrl-w, since both Ctrl-y and Alt-y always place point and mark around the retrieved block.

By default, Epsilon provides ten kill buffers. You can set the variable kill-buffers if you want a different number of kill buffers. Setting this variable to a new value makes Epsilon throw away the contents of all the kill buffers the next time you execute a command that uses kill buffers.

The Alt-y command doesn't do anything if the region changed since the last Ctrl-y or Alt-y, so you can't lose text with a misplaced Alt-y. Neither of these commands changes the kill buffers themselves. The Alt-y command uses the undo facility, so if you've disabled undo, it won't work.

Epsilon can automatically reindent yanked text. By default it does this in C mode buffers. See Indenting Commands for details. If you invoke Ctrl-y or Alt-y with a negative numeric prefix argument, by typing Alt-<Minus> Ctrl-y for example, the command won't reindent the yanked text, and will insert one copy. (Providing a positive numeric prefix argument makes Epsilon yank that many copies of the text. See Repeating a Single Command.)

Each time you issue a sequence of killing commands, all the killed text goes into one kill buffer. When a killing command follows a non-killing command, the text goes into a new kill buffer (assuming you haven't set up Epsilon to have only one kill buffer). You may sometimes want to append a new kill to the current kill buffer, rather than using the next kill buffer. That would let you yank all the text back at once. The Ctrl-Alt-w command makes an immediately following kill command append to a kill buffer instead of moving to a new one.

The Ctrl-y command can come in handy when entering text for another command. For example, suppose the current buffer contains a line with "report.txt" on it, and you now want to read in the file with that name. Simply kill the line with Ctrl-k and yank it back (so as not to change the buffer) then give the Ctrl-x Ctrl-f command (see Reading Files) to read in a file. When prompted for the file name, press Ctrl-y and the text "report.txt" appears as if you typed it yourself.

Pressing a self-inserting key like "j" while text is highlighted normally deletes the highlighted selection, replacing it with the key. Pressing <Backspace> simply deletes the text. You can disable this behavior by setting the variable typing-deletes-highlight to zero. If you turn off this feature, you may also wish to set the variable insert-default-response to zero. At many prompts Epsilon will insert a highlighted default response before you start typing, if this variable is nonzero. You may also wish to set typing-hides-highlight if you've disabled typing-deletes-highlight, so pressing a self-inserting key turns off highlighting but doesn't delete anything.

You can use the delete-region command to delete the current region without saving it in a kill buffer; this is especially useful if you've set <Backspace> so it doesn't delete highlighted text.

In addition to the above commands which put the text into temporary kill buffers, Epsilon provides commands to make more permanent copies of text. The Ctrl-x x key copies the text in the region between point and mark to a permanent buffer. The command prompts you for a letter (or number), then associates the text with that letter. Thereafter, you can retrieve the text using the Ctrl-x y key. That command asks you for the letter, then inserts the corresponding text before point.

Standard bindings:

  Ctrl-@, Alt-@  set-mark
 Ctrl-x Ctrl-h  highlight-region
 Ctrl-x Ctrl-x  exchange-point-and-mark
 Ctrl-k  kill-line
 Ctrl-w  kill-region
 Alt-w  copy-region
 Ctrl-y  yank
 Alt-y  yank-pop
 Ctrl-Alt-w  append-next-kill
 Ctrl-x x  copy-to-scratch
 Ctrl-x y  insert-scratch
 Ctrl-x h  mark-whole-buffer

Previous   Up    Next
Inserting and Deleting  Commands by Topic   Clipboard Access

Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.