# goto-matching-fence(2)

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

## NAME

goto-matching-fence - Move the cursor to specified line

## SYNOPSIS

n goto-matching-fence (esc C-f)

## DESCRIPTION

goto-matching-fence moves the cursor to the opposing fence character of the character currently under the cursor. The set of fence characters include `[ ... ]`, `{ ... }`, `( ... )` and `< ... >`. i.e. if the character under the cursor is ``{`' then goto-matching-fence moves the cursor to the matching closing ``}`' fence, and visa versa.

goto-matching-fence can also be used to move to a matching `' ... '` and `" ... "` fence, but, as the start and end fence is the same, bit `0x04` must be used to indicate whether the current fence is the open or close fence, see below.

goto-matching-fence can also be used to move the cursor between the start and end of a C/C++ `/* ... */` style comment. It can also be used to move to matching C/C++ `#if`, `#elif`, `#else` and `#endif` constructs, cycling through them in the given order.

The numeric argument n is used to modify the default behavior of the command, where the bits are defined as follows:

0x01

When this bit is set (the default) the terminal bell is rung if the matching fence cannot be found.

0x02

When this bit is set the command moves the cursor to the matching fence, updates the screen and pauses for $pause-time(5) before moving hte cursor back again. When omitted the cursor is simply moved to the matching fence.

0x04

When this bit is set the fence the cursor is current at is treated as the close fence so goto-matching-fence moves backwards through the file looking for the matching open fence. When this bit is omitted the fence is assumed to be the open fence, this bit is only used for `'` and `"` type fences.

When the fence(2m) buffer mode is enabled the matching open fence is automatically displayed when the closing fence is typed. The length of time the matching fence is displayed for can be controlled by the $pause-time(5) variable.

## SEE ALSO

fence(2m), $pause-time(5), goto-line(2).

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

</HMTL>