JetBrains Fleet 1.42 Help

Editor

The JetBrains Fleet editor is the main part of the code editor that you use to create, read, and modify code.

Editor overview f

The editor consists of the following areas:

  1. Tabs – show the names of the currently opened files and help you navigate between them

  2. Gutter – shows line numbers and provides the related functionality, such as breakpoints or buttons for running the code at a particular line

  3. Problems widget – summarizes warnings and errors in the current file

  4. Breadcrumbs – show the path to the current symbol and help you navigate in the path

  5. File settings – provide configuration such as file encoding and format

Scrollbar

When you work with code in the editor, JetBrains Fleet displays code analysis results, that include errors and warnings, on the scrollbar. You can check whether your code has issues and quickly navigate to them.

The top of the scrollbar has the Problems widget that gives you a brief summary of the code problems. Click the widget to get more information on each detected problem.

The stripes on the scrollbar indicate places where JetBrains Fleet found a problem.

It is normal to see many stripes while you are working on a file. Many of these errors, warnings, and suggestions are eventually resolved as you complete the code. Should any errors remain when you feel your code is complete, we recommend that you explore and resolve them before compiling or running your project.

The different colors of stripes indicate the severity of the problems.

Tabs and splits

Switch between the tabs

  • Click a tab, or use the following shortcuts:

    • Next tab: ⌘ ⌥ →

    • Previous tab: ⌘ ⌥ ←

Preview files in a separate tab

You can choose to preview files selected in the Files tree in a separate preview tab.

  • Press ⌘ , to open settings and select Editor | Appearance. Select the Enable preview option.

  • Alternatively, add "editor.previewTab": true to your settings.json.

Split view

  • It is sometimes convenient to work in several tabs side-by-side. To do that, drag a tab to an editor side (for vertical split) or to editor top or bottom (for horizontal split).

    Two files viewed simultaneously in the same editor
  • Press ⌘ ⇧ K and start typing split. Select an action with split that you would like to perform.

  • Alternatively, you can use shortcuts. By default, JetBrains Fleet has the following shortcuts preconfigured.

    • Split Right: ⌘ \

    • Focus First Split: ⌃ ⇧ 1

    • Focus Last Split: ⌃ ⇧ 2

    • Focus Next Split: ⌃ ⇧ ]

    • Focus Previous Split: ⌃ ⇧ [

    To set shortcuts for other split actions, refer to Review and edit key bindings.

    Shortcuts for split views

Code

Multiple carets

You can make changes to your text in several places simultaneously using additional carets. To create additional carets, do one of the following:

  • Press ⌘ ⌥ ↑ or ⌘ ⌥ ↓ to respectively add carets above or below the current one.

  • Hold Alt+Shift and click the places where you want to add carets

  • Position the caret at the repeated word or text range, then press ⌘ ⇧ L. Carets will be added to all occurrences of the repeated word within the file.

With multiple carets, you are not limited to typing: you can copy, paste, auto-complete words, and so on.

Multiple carets in the editor

Expand and shrink selection

  • You can expand and shrink selection at caret based on text or code structure.

    Use ⌥ ⇧ ↑ to select the outer scope (expand selection) or ⌥ ⇧ ↓ to select the inner scope (shrink selection).

Fold a code block

  • Point at the gutter near a code block. This reveals arrows, which you can use to fold or unfold the respective code block.

    Arrows appear upon pointing at the gutter near a foldable code block

Appearance and behavior

Configure tab size

You can configure how many spaces are equivalent to each tab in one of the following ways:

  • Press ⌘ , to open settings and select Editor | Code. Configure the number of spaces with the Tab size setting.

  • Place the .editorconfig file in the folder, where you want the setting to take effect.

Auto-detect indent

By default, JetBrains Fleet automatically detects the indentation style in the file and uses it when inserting new lines and reformatting code. The auto-detected indent settings only apply if the required indent is not indicated in the .editorconfig file.

You can change this behavior in JetBrains Fleet settings:

  • Press ⌘ , to open settings and select Editor | Code. Configure the Automatically detect indentation based on file content setting as required.

Add vertical guides

JetBrains Fleet supports vertical guides for code alignment and visual clarity.

  • Add the following property to settings.json: "editor.guides": [ ] specifying character indices for placing one or more guides.

    For example, "editor.guides": [80, 120] sets two vertical guides at indices 80 and 120.

Select color theme

  • Press ⌃ `. Alternatively, press ⌘ ⇧ K then type Select color theme.

    Color themes preview

Sticky lines

The sticky lines (or sticky scroll) feature enhances your coding experience by maintaining the visibility of parent elements as you scroll through the file, offering immediate context to your code. In a file with a complex hierarchy of classes and methods, this feature ensures that the signature of the currently viewed method and its containing classes always remain at the top of the editor.

You can also click any of the sticky lines to scroll the editor to the corresponding declaration.

JetBrains Fleet: Sticky lines in the editor

Disable sticky lines

By default, the Show sticky lines feature is enabled.

Disable sticky lines for all languages

  • Right-click the sticky lines in the editor and click Disable sticky lines.

    Disable Sticky Lines
  • Press ⌘ , to open settings and then select Editor | Appearance. Clear the Show sticky lines checkbox.

Last modified: 20 September 2024