Once an area of the buffer has been marked as a block, the following commands can be accessed. By default, all the block commands are accessed though the block menu; however, all the individual commands can be bound to key sequences, if desired, though the RC file (see Chapter 19).
This command is seldom needed in normal operation since existing markers are deleted when new ones are inserted. However, it can be useful in macros or to clean up a display.
Moves the cursor to the beginning (top) of a defined block. Note that an end marker is not needed for this command to function.12.2
Jump to the end (bottom) of a defined block.
Block-copy expands the buffer and places a copy of the marked text at the current cursor position. The existing block markers are not deleted, making it easy to make multiple copies of the same area. If the cursor is currently in the defined block an error message will be displayed.
Block-move takes the marked text and moves it to the current cursor position. To facilitate the transfer, a temporary disk file is created ... in most cases the data will never be written to the disk, but merely stored in the operating system file buffers. The block markers will be moved along with the block, making it easy to move it again it you made a mistake. If the cursor is currently in the defined block an error message will be displayed.
The Save-Block command writes the marked block of text to a specified file. The ``file'' can be any valid pathname. If the specified file already exists you will be given the option of quitting the command (press [Q]), overwriting the existing file ([O]), or appending the block to the end of the existing file ([A]). This command does not effect the block markers.
Paste the marked block into the special Ved paste buffer. The Paste Block command's main purpose is to copy data between windows. The data between the block markers will be copied to an paste buffer.12.3 This data can then be copied to another place in any window buffer by using the Get Block command. You can make multiple saves to the paste buffer--each save will be appended to the end of the buffer; the buffer is emptied by the Get-Block command.
Just like Paste Block, this command copies the marked block to the paste buffer. In addition, the block is then deleted. The deletion is saved in the undelete buffers.
Get data from the paste buffer. The Get-Block command serves to pull data out of the paste buffer. The data is transferred to the current cursor position. When the transfer is complete the paste buffer is marked as empty. This command is very useful, in conjunction with the Paste Block command for transfers between different buffer-windows.
This command is identical to the Get Block option, above; however, it does not mark the paste buffer as empty--this way you can copy the same block to many buffers or areas.
The Delete Block command removes the marked block of text from the buffer. Like all other delete commands the excised text is saved in the delete buffers and can be restored with the Undelete command (see Section 10.2). Before the deletion is done the cursor will be moved to the start of the defined block--this ensures proper screen refreshes, as well as making it easy to undelete the text in the correct position if the command is entered by mistake.
The Sort Block command will rearrange the lines in the defined block into alphabetical order. This command uses a scratch file created by the operating system. Since the effects of this command cannot be undone you will be prompted with an ``are you sure'' prompt before any changes are made. The Sort Block command requires some internal memory 12.4--if it is not available an error message will be displayed.
Normally, the block is sorted strict alphabetical order. However, by pressing [I] at the ``are you sure'' prompt, the case of the items will be ignored.
The last character in the block to be sorted must be a end-of-line (EOL) character. If it is not a prompt will be displayed offering to move the block end marker to the next EOL.
This option attempts to unformat an area of the buffer which has had real carriage returns inserted at the end of each line (instead of the preferred method of only having carriage returns at the end of paragraphs). To protect the innocent, this option is only available as a block option. It also checks your intentions with an ``are you sure'' prompt.
The effects of this command are not always 100%. The logic used is simple: all carriage returns (EOLs) in the block which are followed by an alpha character will be changed to spaces. This means that a line starting with a space will not be ``wrapped''; nor will a blank line. However, a line starting with a number or punctuation will not be wrapped either--and you may want it to. Ved has no idea as to the contents of your file ... in most cases you will have to clean up after this command.
At times you may want the text in your document to have end of line characters at the end of each pre-determined line width. This is userful when you are sending a document out via electronic mail, or when printing unformatted text. This option prompts for the line width and then inserts EOL characters12.5 at the end of each line.
This option is only available as a block command.
It is sometimes useful to work on a portion of your file in a separate buffer. This command opens a new buffer, and then copies the marked block to that buffer. Finally, it selects (displays) the new buffer. The original block and the contents of the original buffer are unchanged.
As an alternative to accessing the block menu with [F2], you can also bring it up with [Esc][B].