rob-revisited/docs/ide/editor.md

2.6 KiB

Editor

The code editor is Monaco, the editor of VS Code: tabs, preview tabs, split right, sticky scroll, multi-cursor, minimap (option), folding, diff, autosave, dark and light themes.

Tabs

  • A single click in the Project view opens a preview tab (replaced by the next one) when the option is on; a double click or an edit keeps it.
  • Right click a tab: close, close others, split, Show Diff with HEAD, Show Local History, copy the path.
  • Split Right shows two editors side by side; Back / Forward (Ctrl+Alt+← / →, or the mouse's side buttons).
  • Ctrl+S saves every file; with Save files automatically (Settings) files are saved as you type.

Kinds of files

File Opens as
code, text Monaco, coloured by its language (a file without extension by its #! line: bin/console is PHP)
.md rendered, with View / Edit / Edit + View
.html, .twig Code / Split / Design / Preview (HTML editor, Twig preview)
.css, .scss Code / Split / Design / Preview (CSS editor)
.env* the .env editor
*.form.yaml the form designer
pictures, sounds, films, PDF a viewer; sprites, tunes, sound effects, tilesets and levels in the resource editors
binary View as Hexadecimal (any file, also from the status bar): offset, 16 bytes, their characters; a 100 MB file scrolls fast; go to an offset

The file-type button of the status bar opens a file as another language, in hexadecimal, as a picture, a PDF, a film or a sound; the choice is kept per file.

Writing code

  • Completion (Ctrl+Space), parameter hints (Ctrl+P), quick documentation (Ctrl+Q), Reformat Code (Ctrl+Alt+L), Comment Line (Ctrl+/), Rename (Shift+F6), Find (Ctrl+F), Replace (Ctrl+R), Go to Line (Ctrl+G).
  • Paths in strings are completed (JS imports, CSS url(), HTML src / href, Twig templates, PHP strings) and are links: Ctrl+click opens the file; a picture shows a thumbnail on hover.
  • Colours in CSS show a swatch; a click opens a colour picker.
  • Problems are underlined as you type; the Problems window (Alt+6) lists them.

Live preview

Preview HTML (the eye of the tab bar) shows an HTML or CSS file in a sandboxed frame next to the code, updated as you type; the project's stylesheets, pictures and fonts are put in; scripts only run when you tick Scripts.

PHP code intelligence, Navigation, Local history, Encodings.