Navigation
This guide explains how to navigate efficiently within a document. It assumes you know how to start the editor and switch between normal/insert mode (if not, please read the Quickstart first).
Scrolling
To scroll up by half a screen, press Ctrl-u ("up") in normal mode.
To scroll down by half a screen, press Ctrl-d ("down") in normal mode.
Line movement
To move the cursor to the last line, type "G" in normal mode.
To move the cursor to the first line, type "gg" in normal mode.
To move the cursor to a specific line number, type "
To move the cursor to the start of the current line (after any indentation), use "^". Use "0" to move to the start of the current line before any indentation.
To move the cursor to the end of the current line, type "$" in normal mode.
Next or previous matching character
To move the cursor forward to the next matching character on a line, type "f{char}" in normal mode, where "{char}" is the character to match. To move the cursor up to, but not on, that character use "t{char}".
Similarly, to move the cursor backwards to a matching char, use "F{char}" and "T{char}".
Word movement
A "word" in aretext is a sequence of characters separated by whitespace or punctuation. To move the cursor forward to the next word, press "w" in normal mode. Use "e" to move the cursor to the end of the current word, and "b" to move the cursor back to the start of the previous word.
Paragraph movement
A "paragraph" in aretext is a contiguous sequence of non-empty lines. To move the cursor to the next paragraph, type "}" in normal mode; to move to the previous paragraph, type "{".
Text search
Aretext supports forward and backward text search within a document.
To search forward, type "/" in normal mode, then type your search query. To move the cursor to the search result, press enter; to abort the search, press escape.
To search backward, type "?" in normal mode, then type your search query.
To repeat a search, type "n" in normal mode (this moves the cursor to the "next" result). To move the cursor back to the previous result, type "N" in normal mode.
If the search contains at least one uppercase letter, then it is case-sensitive; otherwise, it is case-insensitive (this is equivalent to vim's "smartcase" mode). You can override this by adding a suffix "\c" to force case-insensitive search and "\C" to force case-sensitive search. For example:
case-insensitive | case-sensitive |
---|---|
"abc" | "Abc" |
"Abc\c" | "abc\C" |
To search for the word under the cursor, use "*" to search forward and "#" to search backwards. Word searches are always case-sensitive.
Matching braces and parentheses
Many programming languages use curly braces {...}
and parentheses (...)
to mark the beginning and end of a code block.
For matching braces, use "[{" to jump to the previous unmatched open brace and "]}" for the next unmatched close brace. The commands "[(" and "])" work similarly for parentheses.
If the cursor is on a curly brace, parenthesis, or square bracket, use "%" to jump to its match.