# goto-line(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

goto-line - Move the cursor to specified line

## SYNOPSIS

n goto-line (esc g)
goto-line "num"

## DESCRIPTION

goto-line moves the cursor to the specified line in the buffer. The user is prompted for the new line number on the command line, which may be entered as a relative displacement ([`+`|`-`]number) from the current position, or as an absolute line number (number). If the number is preceded by `+` or `-` then this is treated as a relative displacement from the current line, otherwise it is an absolute line number.

If a positive argument n is supplied, goto-line moves to this line, e.g. to move the cursor to line 240:

    240 goto-line

A special case of goto-line is operative if an argument of `0` is supplied, argument "num" must also be given as above except goto-line treats the line number or displacement as an absolute move, i.e. includes narrowed out sections when calculating the new position. If the new line lies within a narrowed out section (i.e. a section that has been hidden and is not visible on the screen) the narrow is automatically expanded. See narrow-buffer(2) for more information on narrowing.

Supplying a negative argument to goto-line results in an error.

## NOTES

After successfully calling goto-line, variable $window-line(5) is set to the required line number.

## SEE ALSO

goto-alpha-mark(2), goto-matching-fence(2), narrow-buffer(2), $window-line(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>