Next: 10. Editing
Up: 9. Moving Around a
Previous: 9.1 Cursor Movement
Subsections
The jump commands are a powerful and fast way to navigate though files. You
can move quickly to a line number, a percentage point in the file, or to
a label. Jump tries to be as intelligent as possible with your input, hopefully
it succeeds.
The basic jump command is invoked with [Esc][J]. A dialog window will
be created ... you can now enter the new location you want to move to.
The input for jump should be a label or a line number, optionally preceded by
a ``+'' or ``-''. If you wish to enter a label which looks like a number
(perhaps a line number in a BASIC program), you can preface the line number with
a space. In this case the space will be swallowed and the number will be treated
as a label.
The following options are available:
- Edit Point
- Entering a single ``.'' at the jump prompt will move the cursor to the last point in the document which was changed. If no changes have been made an error message will be displayed.
- Percentage
- A numeric value between 0 and 100 preceded by a % will move to and offset in the file. For example, ``%50'' will move the middle of the file. If an optional ``-'' or ``+'' is also included the new position will be calculated from the current cursor position. For example, if you are at the end of the file and you enter ``-%10'' you will move to a position 90% from the start of the file.
- Prior Jump
- A single ``-'' will move to the point you were when the last jump command was issued. Jump points are saved to a level of 10 calls. This is quite convenient when you jump to a position in the file to have a look at something and want to return to where you were. Try it--it will make sense. Ved remembers absolute positions in the file, so if you make changes between a jump and this command the position may have changed.
- Line Number
- A numeric value will move to a line number. Lines are numbered from 1. If you preface the line number with a ``-'' or ``+'' the line will be relative to the current position in the file. If the line specified is greater than the last line in the file an error message will be displayed. When entering a value you can get fancy and specify the number as any legal Ved expression such as $99,
, etc.
Since the line number is that of lines ending with line feeds, the line you end up on and the line number displayed on the status line may not match if line wrapping has been enabled.
- Line Number plus Offset
- In addition to specifing a line number, you can specify the line number and the offset into the line. Separate the two with a single space or ``:''. If the offset is past the end of the line, the end of line will be used. For example, ``100:5'' will move to character 5 in line 100. Note that characters are numbered from 0.
Don't confuse the displayed column on the screen with the character offset--they may be different if tabs are being displayed. Tabs are considered to be single characters when calculating an offset.
- Label
- Entering any other text will cause Ved to look for a ``label'' which matches the entered text. The label must match exactly and be terminated with a non-alphanumeric character. Entering ``start'' would position the cursor to any of the following lines:
start
Start:
start lda #1
START(p1,p2)
If more than one of the above lines are present in your file the cursor will advance to the first one. Note that a jump to ``start'' will not find the following:
starting lda #1
start1(p3,p4)
the start.
The search is normally done from the start of the file; however you can include the an optional ``-'' or ``+'', in which case the search will be done from the current cursor position in a reverse or forward manner. This can be useful if you have a number of similar labels. This might be misleading, but if you are currently on a match when you use the ``-'' or ``+'' option and there is not another match you will get a ``not found'' error message.
If you find that you just want to move to a different place in the buffer (perhaps with a jump, or just via cursor commands), but know you want to return to the current position, you can mark the current position with [Esc][;]. Nothing is displayed, but Ved knows!
If you have inserted a position mark, [Esc]['] will return the cursor to the marked position. If there is no position marked, the command will be silently ignored.
When writing C source code, LATEX files, or just about anything which will be compiled later, the use of various delimiters is common ... and a common problem is not have a matching ``{'' for each ``}''. Ved attempts to help with the [Esc][\] command. It will place the cursor on the matching { }, < >, ( ) or [ ] in your file. If a match is not found, an error message is displayed. For this to work, you have to have the cursor on one of the ``delimiter'' characters.
Next: 10. Editing
Up: 9. Moving Around a
Previous: 9.1 Cursor Movement
2004-05-02