VEDIT works manipulate columns of text, a “columnar block” is a rectangle of characters in your file. It can be anywhere from one character wide to the full width of the text being edited and also extend from as little as one line to many pages in length. All of vEdit's block operations work with columnar blocks, also you can restrict a search/replace operation to the columnar block.

Columnar blocks are especially convenient for editing tabular data such as a spreadsheet or a database. For example, you could copy a table of numbers, say between lines 10 and 20 and between columns 30 and 40 to a text register. This columnar block of numbers can then be inserted anywhere else. To make columnar block operations as simple and useful as possible, VEDIT performs some additional manipulations on your text.

  • It ensures that the columnar block being copied has a flush right margin. If any lines being copied are shorter than the block’s right margin, they are padded with spaces to make them flush. This ensures that when the columnar block is inserted, it does not destroy the alignment of the following text.
  • Similarly, when inserting a columnar block, spaces are added to pad short text lines which do not reach the insertion column. This keeps the inserted text aligned.
  • Any Tab characters in the columnar block being copied are converted to spaces. (This is necessary for columnar operations to work as expected.) When the columnar block is inserted, you can select with CONFIG > Tab / Fill > Retab after columnar operation whether these spaces (and adjacent spaces in the existing text) are retabbed to the optimum number of Tab characters and spaces.
  • In some cases, such as inserting a columnar block at the end of text lines, these extra padded spaces become trailing spaces. These extra spaces are trimmed by default, but this can be changed with CONFIG > Tab / Fill > Trim spaces after columnar operation.
This trimming and tab/space conversion applies only to the inserted text and adjacent spaces. It does NOT affect the entire file and only applies when working with columnar blocks.

Columnar Block Examples

To perform columnar block operations mark the desired block with BLOCK > Set column marker ( Alt-I or toolbar). After setting the first block marker, the highlighting shows precisely which characters are included in the block. You will immediately notice the difference in the way the text is highlighted in Column Mode.

When columnar markers are set, Cursor Right will move past the end of short lines (similar to cursor positioning mode “4”). This lets you set the right column past short lines.

The following screen shows a columnar block highlighted. Note that the cursor is in the lower right corner of the block:

Columnar Block Example 01.png

After copying this block to a text register, the register will contain:

VVVVVVVVV
EEEEEEEEE
DDDDDDDDD
IIIIIIIII
TTTTTTTT. 
VVVVVV... 

The “.” are padding spaces that were added to the register in order to give it a flush right margin.

Now consider the following text before inserting this register.

Columnar Block Example 02.png

After inserting the register, the screen will display:

Columnar Block Example 03.png

This shows the importance of the added extra spaces when the block was initially copied to the text register.

Now consider the following text before inserting the same text register. Note that text lines 6 and 7 do not reach the insertion column.

Columnar Block Example 04.png

After inserting the same register, the screen will display:

Columnar Block Example 05.png

By padding text lines 6 and 7 with spaces, the inserted block also remains aligned.

Notice that the extra spaces added to the text register are now trailing spaces on lines 6 and 7 above and serve no alignment purpose. When CONFIG > Tab/Fill > Trim spaces after columnar operation is enabled (the default), these extra spaces are trimmed following the insertion.

To demonstrate this trimming, consider the following text register. Note that it contains a blank line consisting of spaces.

VVVVVVVVV
EEEEEEEEE
.........
DDDDDDDD.
IIIIII...
TTTT.....

Consider the following text which contains three trailing spaces on lines 4, 6 and 8. (Remember that trailing spaces are invisible unless you change VIEW > Options > Show newlines (CR/LF) to display the location of the “newline” character(s) at the end of each line.)

Columnar Block Example 06.png

With CONFIG > Tab/Fill > Trim spaces after columnar operation enabled, inserting the text register will change the screen to:

Columnar Block Example 07.png

The trailing spaces, including the existing ones on lines 4, have been trimmed. The trailing spaces on line 8, which was not involved in the insertion, still remain.

As explained earlier, Tab characters in a columnar block operation are first converted to spaces and can optionally be converted back to Tab characters. However, a single space is never converted to a Tab character. Also, the first two spaces following a “.” (period), “!” and “:” are not converted to a Tab character. This makes columnar block operations more compatible with the needs of word processing.

The above discussion also applies to columnar block copy/move performed with BLOCK > Copy to cursor and BLOCK > Move to cursor. These are implemented with an internal text register and therefore operate identically.

Use EDIT > Convert > Detab to convert Tab characters in a file to spaces.

Use USER > Remove trailing spaces to remove all trailing spaces from a file. (This assumes the default USER menu.)