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 Editor overview f](https://resources.jetbrains.com.cn/help/img/fleet/1.39/editor-overview-f.png)
The editor consists of the following areas:
Tabs – show the names of the currently opened files and help you navigate between them
Gutter – shows line numbers and provides the related functionality, such as breakpoints or buttons for running the code at a particular line
Problems widget – summarizes warnings and errors in the current file
Breadcrumbs – show the path to the current symbol and help you navigate in the path
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: ⌘ ⌥ ←
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).
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 Enable preview option.
. Select theAlternatively, add
"editor.previewTab": true
to your settings.json.
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 Multiple carets in the editor](https://resources.jetbrains.com.cn/help/img/fleet/1.39/multicaret.png)
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.
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 Tab size setting.
. Configure the number of spaces with thePlace 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 Automatically detect indentation based on file content setting as required.
. Configure the
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 indices80
and120
.
Select color theme
Press ⌃ `. Alternatively, press ⌘ ⇧ K then type
Select color theme
.
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 JetBrains Fleet: Sticky lines in the editor](https://resources.jetbrains.com.cn/help/img/fleet/1.39/fleet_enabling_sticky_lines.png)
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.
Press ⌘ , to open settings and then select Show sticky lines checkbox.
. Clear the