Editing

Aember opens text files in a code editor, Markdown files with a preview, and binary files in a hex editor. This chapter shows how to type, move, search, fold, bookmark and save in them.

Type and Move in the Editor

Each text editor pane has a bar at its top. The bar shows the file name on the left and the cursor position as line:column on the right.

Insert and overwrite

The button at the right end of the window’s tab bar shows INS or OVR. Click it to switch between inserting text and typing over the characters after the cursor. In OVR mode, typing never replaces the end of a line, and Return still inserts a new line. The mode belongs to the project, so every text editor in the window uses it.

Move the cursor

These are the default keys. Hold Shift with any of the movement keys to extend the selection instead of moving the cursor.

KeysAction
← → ↑ ↓One character or one line
⌥← ⌥→One word
⌘← ⌘→Start or end of the line
⌘↑ ⌘↓, Home, EndStart or end of the file
Page Up, Page DownOne page
⌃↑ ⌃↓Scroll the view one line
⌃A ⌃E ⌃N ⌃P ⌃F ⌃BLine start, line end, next line, previous line, forward, back

Delete text

KeysAction
⌫ or ⌃HDelete the character before the cursor
⌦ or ⌃DDelete the character after the cursor
⌥⌫ or ⌃WDelete the word before the cursor
⌥⌦Delete the word after the cursor
⌘⌫ or ⌃UDelete to the start of the line
⌃KDelete to the end of the line

Double-click a word to select it. Choose Edit > Undo (⌘Z) and Edit > Redo (⇧⌘Z) to step through your changes. History keeps every change too. See History.

When you type a closing character such as ), ], }, >, " or ' and the same character is already after the cursor, the cursor moves past it instead of adding a second one.

Indent and Comment Code

Aember indents with the settings in the Editor pane of Settings: Use Spaces for Tabs, Tab Width: and Enable Smart Indent. See Editor settings.

Indent lines

  • Press Tab to indent. With spaces, Aember adds spaces up to the next tab stop. With a selection, Tab indents every selected line by one level.
  • Press ⇧Tab to remove one level of indentation from the current line or from every selected line.
  • Press ⌥Tab to insert a real tab character, whatever the settings say. Use this in files such as Makefiles that need tabs.
  • When you use spaces, ⌫ at a tab stop with only spaces before it deletes back to the previous tab stop.

Smart indent

With Enable Smart Indent on, Return starts the new line with the same indentation as the current one. If the line ends with {, [, ( or :, the new line gets one more level. If the cursor is between a pair such as {}, Aember puts the closing character on its own line and places the cursor on an indented line between them.

When you type }, ] or ) on a line that has only spaces or tabs before the cursor, Aember removes one level of indentation first.

Comment code

  • Edit > Toggle Line Comment (⌘/) comments or uncomments the current line or the selected lines.
  • Edit > Toggle Block Comment (⌥⌘/) wraps the selection in a block comment, or removes it. With no selection, it uses the current line.

Aember uses the comment style of the file’s language. If the language has no block comments, Toggle Block Comment beeps. Both commands are also in the editor’s context menu.

Select by Structure

Aember reads the structure of your code with tree-sitter, so it can select and move by whole expressions, blocks and functions.

Expand and contract the selection

  • Edit > Expand Selection (⇧⌘E) grows the selection to the next larger piece of code, such as a word, then an expression, then a block.
  • Edit > Contract Selection (⌥⌘E) goes back to the previous, smaller selection.

You can also use the mouse. Shift-click inside the selection to expand it, and Command-click inside the selection to contract it. The same commands are in the Selection submenu of the editor’s context menu. In that submenu, Contract Selection is available only after you have expanded the selection.

Move between functions

Choose Edit > Go to Next Function or Edit > Go to Previous Function to move the cursor to the next or previous function, method or class. These commands are also in the editor’s context menu when the file’s language is known.

Matching brackets

When the cursor is at a parenthesis, brace or square bracket, Aember highlights the bracket that matches it.

Find in a File

Choose Edit > Find… (⌘F) to show the find bar at the top of the active editor pane. The field shows Find in document… until you type.

  1. Type the text you want to find. Aember searches as you type. The search ignores case and matches the text exactly as written, not as a pattern.
  2. Aember selects the first match at or after the cursor. The bar shows which match is selected and how many there are, or No matches.
  3. Press Return, or click the next-match button, to go to the next match. Click the previous-match button to go back. At the end of the file, the search wraps around to the start.
  4. Press Escape, or click the close button, to hide the bar and go back to the editor.

The find bar works in the text editor, the Markdown editor (it searches the Markdown text, and shows it if the preview is showing), History panes, the hex editor, diff views, the conflict resolution view and Git History. In the hex editor, text you type matches the bytes of that text, and ASCII letters match in either case. To find byte values, type them as \ followed by two hex digits, for example \de\ad\be\ef. Type \\ to find a backslash.

The find bar has no replace field. To replace text, use Find and Replace in the Project, and set the Files: filter to the file’s name.

Find and Replace in the Project

Choose Edit > Find in Project… (⇧⌘F) to open the Find in Project panel. This floating panel searches the project of the window you used last, and shows its name in the title.

  1. Make sure Find & Replace is selected at the top of the panel.
  2. Type in the Search in project… field. The search starts as you type.
  3. To search only some files, type wildcard patterns, separated by commas, in the Files: field, for example *.swift, *.c. A pattern with a / matches the path from the project’s folder, such as Sources/**/*.swift; {swift,md} matches either word and [abc] any one of the letters.
  4. Use the pop-up menu to search everywhere, or only in functions, classes and structs, strings, comments or variables.
  5. Click the Aa button (Case Sensitive) to match case. Click the .* button (Regular Expression) to search with a regular expression.

Aember searches what you see in its editors, including unsaved changes, not only what is on disk. It skips hidden files, binary files, folders such as .git, node_modules, build and DerivedData, and Xcode’s .xcodeproj and .xcworkspace bundles. It shows at most 1000 matches.

Use the results

Click a result to show it in the active editor, if that editor has the file open. Double-click it, or press Return, to open the file at that line, in the preview tab. See The preview tab.

Replace

  1. Type the new text in the Replace with… field. With Regular Expression on, $1, $2 and so on insert the groups the pattern matched.
  2. Each result has a checkbox. Clear the ones you want to keep. Space switches the selected result’s checkbox. Click All or None to check or clear every result.
  3. Click the replace button, which shows how many matches it replaces, then confirm in the Replace Matches dialog.

Aember changes open files in their editors, and saves them if they had no unsaved changes before. It writes closed files to disk. In a closed file whose unsaved changes History keeps, the change stays unsaved. All the changes are one operation in History, so you can undo them there.

While the window is parked at a History moment, the panel searches the project as it was then, and cannot replace.

Find & Rename searches for symbols with the language server instead. See Code Intelligence.

Choose What the Gutter Shows

The gutter is the strip to the left of the text. It shows line numbers, bookmarks, the language server’s errors and warnings, fold chevrons, changed lines and blame.

Right-click the gutter to choose what this editor shows:

  • Add Bookmark bookmarks the line you clicked. See Bookmark Lines.
  • Line Numbers shows or hides line numbers.
  • Change Markers shows or hides the marks for lines changed since the last commit. It is dimmed for a file git doesn’t track. See Changed Lines in the Editor.
  • Blame shows or hides who wrote each line. See Blame.
  • Reset Gutter to Defaults shows what Settings say and turns blame off.

A check mark shows what is on. Your choices apply to this editor only. Aember keeps them with the project, so the file reopens with the same gutter.

Show Line Numbers in Editor settings and Show changed lines in the editor gutter in Git settings set what new editors show. When you change one of them, every editor follows it, also files you open later, and the choices you made in single editors are dropped.

To hide the fold chevrons, turn off Enable Code Folding in Code Tools settings. Folding needs the chevrons, so it goes off too.

Fold Code

Folding hides the body of a function, class or other block, so you see only its first line.

  1. Make sure Enable Code Folding is on in the Code Tools pane of Settings. See Code Tools settings.
  2. In the gutter, to the left of the line numbers, a chevron marks each line that starts a block you can fold. A down chevron means the block is open.
  3. Click the chevron to fold the block. The chevron points right, and three dots after the line show that lines are hidden.
  4. Click the chevron again to show the lines.

Aember finds the blocks with tree-sitter, so folding works in files whose language Aember knows.

If you turn Enable Code Folding off, the chevrons disappear and every folded block opens again.

Keep Your Place with Sticky Headers

When you scroll through a long function or class, its first line stays at the top of the editor as a sticky header. Nested blocks add more headers below it, one row each, so you can always see which function, class or block you are in. When you scroll back up, the headers go back into place.

Click a sticky header to scroll to that line and put the cursor there.

To turn sticky headers on or off, use Show Breadcrumb Navigation Bar in the Code Tools pane of Settings. See Code Tools settings.

Wrap Long Lines

Wrapping shows a long line on several rows, so you can read it without scrolling sideways. It changes only how the line is shown: the file still has one line, and the line number stays the same.

To turn wrapping on, select Wrap Lines in the Editor pane of Settings. It is off by default, and it applies to every editor. See Editor Settings.

Prose and code

  • Markdown and plain text files are prose. They wrap at the right edge of the editor, between words, and the next rows start at the left edge. A word wider than the editor is broken inside the word.
  • Every other file is code. Code wraps at the column set by Code Column: in Settings, 80 by default, even when the editor is narrower; scroll sideways to see the rest. Lines break at spaces, around operators, and after , ( [ { and ., never inside a name or number. The next rows are indented one level more than the line.

Rows and the cursor

  • The line number and the gutter markers are on the line’s first row.
  • ↑ and ↓ move one row at a time and keep the cursor’s horizontal place.
  • ⌘← and ⌘→ go to the start or end of the row first. Press them again to go to the start or end of the line.
  • Page Up and Page Down move by rows.
  • Inlay hints and AI suggestions take room on the row, so they can make a line wrap.
  • A folded line shows its three dots after its last row.
  • A line that starts in a right-to-left language, such as Arabic or Hebrew, stays on one row; scroll sideways to see the rest.

Column guide

Select Show Column Guide in the Editor pane of Settings to draw a thin vertical line at the code column in code editors. It works with wrapping on or off, so you can see where long lines pass the column. It is off by default.

Bookmark Lines

A bookmark marks a line so you can come back to it. Bookmarks belong to the project and are saved with it.

Add a bookmark

  1. Right-click the line in the editor and choose Add Bookmark. The hex editor has the same item.
  2. In the Add Bookmark panel, type a name in the Name: field. You can add text in the Notes: field.
  3. Click Add. A name is required.

A bookmark icon appears in the gutter next to the line.

Edit a bookmark

Click the bookmark icon in the gutter. If the line has more than one bookmark, choose one from the menu. Change the name or notes in the Edit Bookmark panel, then click Save. The panel does not block the window, so you can keep it open while you work.

Go to a bookmark

The navigator shows a Bookmarks folder when the project has bookmarks. Each bookmark shows its name, file and line, sorted by name. Double-click a bookmark, or right-click it and choose Go to Bookmark, to open the file at that line. Choose Delete Bookmark to remove it.

When the text changes

As you add or delete lines above a bookmark, it moves with its line. If you delete the line itself, the bookmark is deleted too.

If the file changes outside Aember, Aember looks for the bookmarked line again, using its text and the lines around it, when the file reloads or next opens, including when you go to the bookmark. If the line can’t be found, for example on another branch, the bookmark stays where it was, and it finds its line again if the text comes back.

Preview Markdown

Files that end in .md, .markdown, .mdown, .mkdn or .mkd open in the Markdown editor. It opens in preview mode, which shows the formatted text.

The Markdown editor has a bar at its top with the file name and a button on the right. Click the button to switch between the preview and the source. Its tooltip says Switch to Edit Mode or Switch to Preview Mode. You can also choose View > Toggle Markdown Preview (⇧⌘P).

The preview shows headings, bold and italic text, inline code, code blocks, links, lists with task checkboxes, block quotes and tables. Images show as their description in square brackets. You can select and copy text in the preview, but you cannot edit it. Switch to edit mode to change the file.

In edit mode, the gutter shows what it shows for any other text file: line numbers, bookmarks, changed lines, the language server’s errors and warnings, and blame. Turning on blame from the preview switches to edit mode.

Edit Binary Files

Files that are not text, such as images, audio, video and other binary files, open in the hex editor. It shows each row of 16 bytes three ways: the offset of the first byte, the bytes in hexadecimal, and the same bytes as ASCII characters.

Change bytes

Click in the hex column or the ASCII column and type. The cursor in the other column follows yours.

  • In the hex column, you can type only hex digits, 0 to 9 and A to F. Each digit replaces the digit under the cursor.
  • In the ASCII column, each character you type replaces the byte under the cursor.

The hex editor always types over existing bytes. ⌫ and ⌦ beep; to remove bytes, select them and cut them.

Copy, cut and paste

  • Copy puts the selected bytes on the clipboard as hex values separated by spaces, for example DE AD BE EF.
  • Cut copies the selected bytes, then removes them. The bytes after them move up.
  • Paste reads hex values separated by spaces from the clipboard and writes them over the bytes from the cursor on.

These items are in the hex editor’s context menu, with Select All and Add Bookmark. To find bytes, use Find in a File.

Save your changes with File > Save (⌘S).

Start Files from Templates

A file template gives a new file its first contents, such as a license header. Each template has a name, a filename pattern and the template text.

Create a template

  • Open the Editor pane of Settings. In the File Templates section, click the Add File Template button. Type a name, a pattern in the Pattern: field and the text in the Template: field, then click Save Template.
  • Or right-click a file in the navigator or a file’s tab and choose Add as Template. Aember uses the file’s contents as the text and suggests a pattern that matches its extension. Change the name and pattern if you want, then click Add.

The pattern is a regular expression that Aember matches against the file name, for example \.swift$. A pattern that is not valid shows Invalid regex pattern.

Use a template

When you create a file from the New… submenu of the navigator’s context menu, Aember fills it in from the first template whose pattern matches its name.

In the template text, these words are replaced:

TextReplaced with
${aember.filename}The file name, with its extension
${aember.yyyy}The year, four digits
${aember.mm}The month, two digits
${aember.dd}The day, two digits

Change or delete a template

Click a template’s name in the File Templates section to edit it. To delete it, swipe left with two fingers on its row, then click the trash button. Aember keeps templates in ~/.aember_user/templates.

Create and Save Files

Create a file

Choose File > New, then the type of document you want: text, Markdown or binary. ⌘N creates a text document. Aember creates an empty file named Unnamed Document in the project folder and opens it. You can also use the New… submenu in the navigator’s context menu, which asks for the name first.

Save

  • File > Save (⌘S) saves the active file. If the file still has its Unnamed Document name, Aember asks where to save it.
  • File > Save As… (⇧⌘S) saves a copy under a new name or in a new place and goes on editing the copy. The original file stays as it was.
  • File > Save All (⌥⌘S) saves every file with unsaved changes. This includes closed files whose unsaved changes History keeps.

You can also click the file icon in a tab to save that file. Its tooltip says Save file when the file has unsaved changes and File saved when it has none.

Aember keeps each file’s line endings and byte order mark when it saves. If Format Document on Save is on, the language server formats the file first. See Code Intelligence.

Discard changes

Choose File > Revert to Saved to throw away the unsaved changes in the active file and load it from disk again. Aember does not ask first, because the discarded text stays in History. See Restore an Earlier Version.

Handle Changes Made Outside Aember

Aember watches the files you have open. When another app changes one of them, Aember does not load the new version on its own. It marks the file, so you can choose.

See which files changed

When a file’s text on disk is different from the text in Aember, its tab and its row in the navigator show an orange warning triangle. The tab’s tooltip says File changed on disk - right-click to reload.

Choose which version to keep

  • To load the version on disk, right-click the file’s tab, or the file in the navigator, and choose Reload from disk. This replaces the text in Aember, including any unsaved changes.
  • To keep your version, save the file. Aember asks first: Save Anyway writes your version over the one on disk, Revert to Disk loads the version on disk instead, and Cancel does neither. File > Save All asks the same for each such file.

Either way, History keeps both versions, so you can get the other one back. See History.

When Aember runs git

A git operation that Aember runs, such as switching branches, stashing or resetting, can change the files you have open. Files without unsaved changes then show the version git left on disk, with no warning triangle. A file with unsaved changes keeps them, and is marked if its file changed.

When an agent works on the file

When an agent uses Aember’s tools while a file without unsaved changes has changed on disk, Aember first loads the version on disk, so the agent sees and edits that version. The warning triangle goes away, and History records the change as made outside Aember. A file with unsaved changes stays as it is.

Deleted files

If another app deletes a file you have open, the status bar shows a warning. The editor stays open.

Unsaved changes in closed files

History keeps the unsaved changes of files you close. When you open such a file again, Aember shows your unsaved changes. If the file changed on disk in the meantime, Aember opens the version on disk and the status bar says that your unsaved changes are kept in History.

Last updated November 23, 2026