Structured cursor movement |
TeXmacs implements the three main mechanisms for structured cursor movement:
Most keyboard shortcuts for structured cursor movements can be used in combination with the shift-key so as to similtaneously select text while moving around.
To do: customizing the behaviour |
The C-left, C-right, C-up and C-down keys are used for the structured traversal of the entire document. Inside plain text, C-left and C-right allow you to move in a word-by-word manner, while C-up and C-down correspond to paragraph-by-paragraph motion.
In the presence of other markup, the C-left and C-right keys allow you to visit all accessible cursor positions of the document, except that we keep moving in a word-by-word manner inside plain text. The behaviour of the C-up and C-down keys is more context-dependent. Inside matrices, they typically allow you to move one row up or down.
This type of cursor movement allows you to quickly visit all other tags in the document which are similar to the innermost tag. The C-pageup and C-pagedown keys allow you move to the previous or next similar tags, whereas C-home and C-end directly jump to the first or last similar tags.
For instance, when you are inside a section title, you may move to the previous sectional title (which could also be the title of a subsection or a chapter, for instance) using C-pageup. Notice that you may use C-§ to jump to the previous section title.
It is also possible to quickly move inside the innermost tag without quitting it, using H-left, H-right, etc. We recall that the H- prefix corresponds to the hyper-key, which does not exist on most keyboards. In order to compose H--based shortcuts, you may either configure your keyboard so as to map another key to H-, or simulate the hyper key using escape escape escape or C-escape.
In general, H-left, H-right, H-home and H-end provide a way to move to the previous, next, first or last argument of the innermost tag. Furthermore, the shortcuts H-( and H-) may be used to exit the innermost tag on the left or on the right.
This default behaviour may be overridden in special contexts. For instance, inside tables or trees, they rather correspond to cell-by-cell or node-by-node cursor movement. In addition, these cases associate vertical cursor movements to H-up, H-down, H-pageup and H-pagedown.