# Editor

[← Back to README](../README.md)

K3 Studio draws everything itself: a single GL draw call with SDF rounded rects, its own glyph atlas with kerning, and a rope text buffer. It only redraws when something changes, so it sits at about 0% CPU when idle.

## Editing

![Multi-cursor](images/multicursor.png)

- Undo/redo, clipboard, IME, selections with mouse and keyboard, smooth scrolling
- Multi-cursor: `Ctrl+Alt+Up/Down`, `Alt+click`, `Ctrl+D` (next match), `Ctrl+Shift+L` (all matches). Copy and paste go one line per caret.
- Line actions: move (`Alt+Up/Down`), copy (`Shift+Alt+Up/Down`), delete (`Ctrl+Shift+K`), comment (`Ctrl+/`), go to line (`Ctrl+G`)
- Fallback fonts (Segoe UI, Segoe UI Symbol, Emoji, Microsoft YaHei) for glyphs the code font doesn't have

## Highlighting

Highlighting comes from tree-sitter and uses a semantic palette: keyword, call, **native (amber)**, method, field, parameter, string, number and comment. Supported languages: Lua, JS/TS, JSON, CSS, SCSS, HTML, Svelte (script as TypeScript, style as SCSS), `server.cfg`, SQL and Markdown.

## Explorer and tabs

The explorer shows file-type icons, and folders that mean something in FiveM get their own color and glyph: `client`, `server`, `shared`, `web`, `[category]` and others. You can create, rename, move and delete from the right-click menu. When two tabs have the same file name, the label adds as much of the path as it takes to tell them apart (`client/main.lua`, `server/main.lua`).

## Command palette and quick open

![Palette: natives](images/palette.png)

`Ctrl+P` opens files (fuzzy). Typing a prefix switches mode:

| Prefix | Mode |
|---|---|
| `>` | Commands (also `Ctrl+Shift+P`) |
| `#` | FiveM natives: inserts the call, tagged client / server / shared |
| `@` | Symbols in the file: functions, events, commands, callbacks, CSS rules |
| `=` | Lua utilities: `joaat`, hex/signed, colors |

![Palette: symbols](images/palette_symbols.png)

JSON → Lua conversion runs on the selection as a `>` command.

## Search and replace

![Search](images/search.png)

Workspace search can be scoped by side (Client / Server) and by resource.

| Action | Keys |
|---|---|
| Find in file | `Ctrl+F` |
| Replace in file | `Ctrl+R` |
| Replace in workspace | `Ctrl+Shift+R` |

![Find in file](images/find.png)

![Replace in workspace](images/replace_ws.png)

## Snippets

Built-in Lua snippets, workspace snippets in `.fed/snippets.json` and personal ones in `%APPDATA%/K3 Studio/snippets.json` all show up in completion.

## Markdown

![Markdown preview](images/markdown.png)

`.md` files open rendered, with headings, lists, tasks, quotes, code, tables, rules and inline HTML. Switch with **Preview | Text**, or double-click a block to edit it at its line. **Ask the agent** opens the composer with the file attached.

## Images

![SVG viewer](images/image_svg.png)

PNG, JPEG, BMP, GIF, TGA, PSD and SVG open as pictures, with fit, 1:1, wheel zoom, and the size and format shown. They're never saved as text.

## Terminal

![Terminal](images/terminal.png)

Named terminals are ConPTY shells (pwsh, or Windows PowerShell if pwsh isn't installed) in the bottom panel. `` Ctrl+` `` toggles the panel, and double-clicking a tab renames it. Terminals keep running while the panel is closed.

## Stats

![Stats](images/stats.png)

Coding time is measured on your computer and never sent anywhere: today, the last 7 days, all time, a 14-day chart, and breakdowns per language and project. You also get lines of code per language and per resource, and today's time sits in the status bar.
