Previews and editors

Text, code and Markdown

Read and edit plain text, source code, Markdown and JSON files in the preview.

Text files open in the preview with colors for their language and line numbers. You can edit them in place and save with ⌘S. For opening, closing, saving and finding text in general, see Preview basics.

A configuration file open in the preview with syntax colouring, ready to edit.
A configuration file open in the preview with syntax colouring, ready to edit.

Plain text and source code

Press F3 on a text or source file. Vektor Commander recognizes the language from the file name, so you do not choose it yourself. Files without an extension such as Makefile and Dockerfile are recognized too. Anything else that is text opens as plain text.

Languages with their own colors include C, C++, C#, Java, Kotlin, Swift, Go, Rust, JavaScript, TypeScript, Vue, HTML, XML, CSS, SCSS, PHP, Python, Ruby, Lua, Perl, SQL, shell scripts, AppleScript, YAML, TOML and configuration files.

The row of views offers:

  • Preview — the text with colors and line numbers, read-only.
  • Edit — the same text, editable.
  • Raw — the exact text of the file, without colors or line numbers.
  • Info — the file's facts, including its language, encoding and line endings.

Edit text

  1. Choose Edit.
  2. Type your changes. A * appears next to the file name.
  3. Press ⌘S.

The editor works like other Mac text editors: select, cut, copy, paste, undo and redo. Typing an opening bracket or quote adds the closing one, and typing the closing character when it is already there steps over it. A quote after a letter, as in "don't", is typed normally. Tab indents.

While the editor has the keyboard, the arrow keys move the cursor. To move to the previous or next file, click outside the text first or choose Preview.

Encodings and line endings

Text is read as UTF-8. A file in another common encoding (UTF-16, Western (Windows), Central European (ISO Latin 2) or Western (Mac OS Roman)) is shown in that encoding and saved back in it. A byte-order mark is kept, and so are the file's line endings (LF or CRLF). Info shows which encoding and line endings the file uses.

Markdown

A Markdown file opens formatted: headings, paragraphs, numbered and bulleted lists, task lists, links, inline code, code blocks, tables, block quotes, emphasis and horizontal rules.

The project's README shown formatted in the pane's preview.
The project's README shown formatted in the pane's preview.

The row of views offers Preview (formatted), Markdown (the source, editable), Raw and Info. Changes you make in Markdown show in Preview straight away, before you save.

In the formatted view:

  • Click a web link to open it in your browser. A link to another file next to the document opens that file in the same preview; use the ‹ button in the header to go back.
  • Pictures stored next to the document are shown. Pictures on the internet are not loaded.
  • Each code block has a Copy code button.

To find text in the formatted document, press ⌘F. The preview scrolls to each match, including text inside long code blocks.

JSON

A JSON file opens as a tree in which every object and array can be opened and closed. A closed object shows how many keys it holds, a closed array how many items. Keys, strings, numbers, true/false and null each have their own color.

A JSON file shown as a tree, with nested objects collapsed.
A JSON file shown as a tree, with nested objects collapsed.

The row of views offers Preview (the tree), Edit, Raw and Info.

In the tree:

  • Expand All and Collapse All open or close every level.
  • Hold the pointer over a row to see its Copy value (as JSON text) and Copy path (in the form $.servers[0].port) buttons. The row's context menu has Copy Value and Copy Path too.
  • With the find bar open, Matches Only hides every row that does not lead to a match.

Edit JSON

  1. Choose Edit.
  2. Make your changes. The bar above the text says Valid JSON, or names the problem with its line and column and marks the spot in the text. You can keep typing to fix it.
  3. To tidy the indentation, click Format JSON. This needs valid JSON, and one undo takes it back.
  4. Press ⌘S.

Vektor Commander never refuses to save what you typed. If the JSON is not valid when you save, it saves the file and tells you where the problem is.

© 2026 Vektor Commander