Next: 10.6 Word Change
Up: 10. Editing
Previous: 10.4 The Edit Buffer
Subsections
Often, we being only human, transpose characters in the file. How often have you typed ``hte'', instead of ``the''? Never? Well then skip this section.
The actions of [Esc][T] depend on what type of character the cursor is currently on. There are three ``modes'' of operation:
- If the cursor is on a alphanumeric character followed by a alphanumeric character, those two characters will be swapped. For example, if the cursor is on the ``h'' in the word ``hte'', it will be changed to ``the''.
- If the cursor is on a single space character between two words, those words will be swapped. For example, if the cursor is on the space in the sequence ``the dog'', it will be changed to ``dog the''.
- If the cursor is on the EOL character at the end of a line, the current line will be swapped with the one following it. The actions of this command may be a bit mysterious if you type in lines which are wider than the screen width and you have wordwrap enabled. Screen lines which wrap are terminated with a space, not an EOL ... so in this case you will simply swap words. Swapping lines works best when you are editing program source and have a number of EOL terminated lines.
Don't worry too much if you make a mistake with this command since doing it a second time always restores things.
Much like the previous command, changing case is easy in Ved ... and a bit confusing until you get used to it.
The [Esc][C] command works on the current word. It doesn't really matter where in the word the cursor is, the effect is the same. However, it does matter what word currently looks like. First, the cursor is moved to the first alpha character in the current word. For example, if the current word was ``1foo'' the cursor would move to the ``f''.
- If the first alpha character of the word is lower case, it will be converted to uppercase.
- If the first alpha character of the word is uppercase, then the entire word will be converted to the opposite case of the first alpha character following the first character.
Sound confusing? Well, it's a lot easier to see than to explain. We suggest you move the cursor to a word and press [Esc][C] a few times to see what happens. We're sure you'll find it very useful.
Next: 10.6 Word Change
Up: 10. Editing
Previous: 10.4 The Edit Buffer
2004-05-02