Next: 10.4 The Edit Buffer
Up: 10. Editing
Previous: 10.2 Restoring Deleted Text
Subsections
No editor would be of much use if you couldn't change the text in your file. Ved makes it easy for you to do this. No confusing modes or states to deal with--you
are always in ``edit mode''. To change text, just move the cursor to where you want
your change or insert to occur and type.
If you are inserting characters into an existing line you may notice that the end of the line drops off the edge of the screen. Don't be alarmed, your text is still there! It will be displayed properly when you finish editing the line. As well, wordwrap will be updated.
You should note that there are two editing modes available. They can be changed
though your Ved RC file, or though the Options-menu-mode function.:
This is the default mode. It simply means that text will be inserted at the
current position. When you are in insert mode, a ``I'' will be displayed to the
left of the line number at the bottom of the display.
10.3.2 Overwrite Mode
In overwrite mode text will replace what is currently in the file. One exception
is that if you are the end of a line (an EOL character) text will be inserted.
You will never delete an EOL by typing over it in overwrite mode. When in overwrite
mode a ``O'' will be displayed to the left of the line number at the bottom of the
display.
Two other modes deserve mention at this point (again, these can be set
in your RC file or with the Options-menu).
When indent mode is enable (it is by default always enabled), new lines
will always be indented to the same spacing as the previous line.
10.3.4 C Mode
When editing C source files it is quite useful to have the editor do some
of the indentation chore for you.
When Cmode is enabled (it is by default always enabled), the following
features come to life:
- If you enter a ``#'' character on a line containing only blanks (spaces or tabs), the blanks will be deleted and the ``#'' will be inserted at the start of the line. This is useful for typing lines in the form ``#include ...''.
- If a new line is started and the previous line ends in a ``{'', the new line will be indented by an additional tab character. Note that this is independent of the actions of the auto indent function (see above).
- If you enter a ``}'' character on a line containing only blanks (spaces or tabs), one tab character will be deleted from the line.
The [Backspace] key will delete the character preceding the cursor. If the cursor is at the start of a line, this command will delete the last character on the previous line. If the cursor is at the start of the file, the first character in the file will be deleted.
The [Delete] key will delete the character at the cursor.
The [Insert] key will insert a space at the current cursor position. The cursor will not be moved. This command is useful when you are in overwrite mode and wish to insert some characters ... insert one or more spaces with [Insert], then type your new text over the spaces.
The [Tab] key inserts a horizontal tab character into the buffer. Normally tabs are not visible10.2, but the spacing of the text reflects, properly, the tab10.3.
Next: 10.4 The Edit Buffer
Up: 10. Editing
Previous: 10.2 Restoring Deleted Text
2004-05-02