跳转到内容

Files, tabs and structure

此内容尚不支持你的语言。

The Project tool window shows the folder, editor tabs hold the files you work on, and File Structure shows the outline of the file in front of you. Project tree, tabs, splits, File Structure and folding: Works. Named layouts of the tool windows: Experimental.

Press ⌘1 (Alt1) or choose View › Tool Windows › Project. The project folder is the root; folders come before files, sorted without regard to case.

  • ↩ or a double click opens a file; → and ← expand and collapse.
  • Names are colored by their Git state (new, changed, ignored), and a file with an error, and every folder above it, is underlined in the error color.
  • The tree follows the disk: files that other programs create, delete or rename show up within about a second.
  • Version control data (.git, .hg, .svn), .DS_Store and Python caches such as __pycache__ are hidden.

To find the file of the active editor in the tree, use Navigate › Select in Project Tree (⌥F1). Navigate › Jump to Navigation Bar lists the folders and files next to the active file in a small popup, for a quick move without the tree.

The context menu of a row has New (File, Directory, and typed files such as Python File or Java Class), Cut, Copy, Paste, Copy Path/Reference, Rename…, Delete…, Reveal in Finder (on Linux Open Containing Folder), Open in Terminal, Local History and Git. Several selected rows are handled together. Moving a file with Refactor › Move… updates its references where the language server can (Refactor code).

Opening a file that is already open selects its tab; a new tab opens to the right of the active one. A modified file shows * after its name. When two tabs have the same file name, the parent folder is added.

  • Close with ⌘W (CtrlF4). The context menu of a tab closes others, all, those to the left or right, the unmodified ones or all but pinned ones; unsaved changes are asked about once.
  • Reopen the last closed tab with Window › Editor Tabs › Reopen Closed Tab; up to 30 are remembered, each at its old place.
  • Pin a tab from its context menu: pinned tabs are never closed by the tab limit or by Close All but Pinned.
  • Switch with the Switcher (⌃Tab): recent files at the right, tool windows and Recent Locations at the left. Hold ⌃ and press Tab to move down.
  • Too many tabs? Only one row is shown and it scrolls to the active tab; the chevron at its end lists the hidden ones. At 30 tabs (the default limit) the oldest unchanged tab closes.

Settings › Editor › Editor Tabs sets the placement (top or none), one row, squeezed tabs or several rows, a row of their own for pinned tabs, the close button, sorting, a preview tab, and the tab limit (1 to 100) with its rule: close unchanged tabs, or close the least used after saving.

The open tabs, pins and split layout are kept per project in .ferris-idea/editor-tabs.json, which is not committed (Ferris IDEA adds it to .ferris-idea/.gitignore).

To see two files side by side, or two places of one file:

  1. Right-click a tab and choose Split Right or Split Down. The same file opens in a new group next to it. Split and Move Right moves the tab instead of copying it.
  2. Drag the divider to resize, or double-click it to make both halves equal.
  3. Move a tab to the other group with Move Tab to Opposite Group. View › Unsplit and Unsplit All join the groups again.

A file open in two groups is one document: typing, undo and saving apply to both, while each view keeps its own caret and scroll position. Groups nest as deep as you like. Files you open from the tree, a search or a jump go to the main group. On macOS, ⌥Tab moves the focus to the next group.

Window › Editor Tabs › Maximize Editor gives the active group the whole editor area; press it again to return.

Navigate › File Structure (⌘F12, CtrlF12) opens the outline of the file below the caret’s line, with the symbol at the caret selected.

  1. Type to filter: every word you type must appear in a name, and the parents of a match stay visible, dimmed.
  2. ↩ jumps to the symbol (Navigate › Back returns). Esc closes.
  3. Press the shortcut again to add inherited members (from supertypes in the project’s own files). ⌘I adds anonymous classes and ⌘L lambdas, where the language server reports them.

The list is ordered by kind and then name: constructors, methods and functions, properties, fields, constants, nested types. Python and JavaScript list a function with its parameters (apply (order, rate=0.1)); HTML lists elements with their id and classes in document order.

The Structure tool window (⌘7, Alt7) shows the same outline and stays open, following the active tab.

The outline comes from the language server, on the text as it is in the editor, saved or not. Without a server for the file, the status bar says No symbols in this file.

Click the arrows in the gutter, which appear when you point at a foldable region (Settings › Editor › General › Code Folding shows them always if you like), or use Code › Folding:

  • Collapse and Expand the region at the caret, Collapse Recursively and Expand Recursively with everything inside it.
  • Collapse All and Expand All for the file; the outermost class stays open.
  • Expand to Level and Expand All to Level › 1 to 5.
  • Expand Doc Comments and Collapse Doc Comments.
  • Fold Selection / Remove Region folds any selected text.

Java one-line methods and the import block of Java and Kotlin files open folded; both are settings under Code Folding. Custom regions fold as well: // region Name … // endregion, #region, and <editor-fold desc="…">. Navigate › Custom Folding… lists the regions of the file. A jump into folded code opens the fold.

Experimental Arrange the tool windows for a task (debugging with the Debug and Terminal windows open, reviewing with Git and Problems), then save the arrangement:

  1. Window › Layouts › Save Current Layout as New… and give it a name.
  2. Switch later with Window › Layouts › <name> › Apply. Restore Current Layout (⇧F12) puts the windows back as the layout has them.

A layout holds which tool windows are open, their sides, sizes and order; nothing of the editor. Layouts belong to you, not to the project, and are kept in window-layouts.json in your settings folder (File formats). There can be up to 50.

Keyboard of
ActionShortcut
Code › Folding › Collapse⌘Numpad − or ⌘-CtrlNumpad − or Ctrl-
Code › Folding › Collapse All⇧⌘Numpad − or ⇧⌘-CtrlShiftNumpad − or CtrlShift-
Code › Folding › Expand⌘Numpad + or ⌘=CtrlNumpad + or Ctrl=
Code › Folding › Expand All⇧⌘Numpad + or ⇧⌘=CtrlShiftNumpad + or CtrlShift=
Code › Folding › Fold Selection / Remove Region⌘.Ctrl.
File › Close Tab⌘WCtrlF4
Navigate › Custom Folding⌥⌘.CtrlAlt.
Navigate › File Structure⌘F12CtrlF12
Navigate › Jump to Navigation Bar⌘↑ or ⌥HomeAltHome
Navigate › Select in Project Tree⌥F1AltF1
Project⌘1Alt1
Structure⌘7Alt7
View › Goto Next Splitter⌥⇥no shortcut
View › Goto Previous Splitter⌥⇧⇥no shortcut
View › Next Tab⇧⌘] or ⌃→Alt→
View › Previous Tab⇧⌘[ or ⌃←Alt←
Window › Active Tool Window › Hide Active Tool Window⇧⎋ShiftEsc
Window › Editor Tabs › Maximize Editor⇧⌘'CtrlShift'
Window › Editor Tabs › Reopen Closed Tab⇧⌘Tno shortcut
Window › Editor Tabs › Switcher⌃⇥ or ⌃⇧⇥ctrlTab or ctrlShiftTab
Window › Restore Current Layout⇧F12ShiftF12

There is no soft wrap and no display of whitespace in the editor yet, and line numbers are always shown.

Agents read the tree, outlines and folding regions without a right. The open tabs and splits are state of the window and need the connection over HTTP (Connect an AI agent).

  • document_symbolsreadsSymbols of a workspace file (functions, types, fields, …) in document order with kind, line and nesting depth, from its language server.
  • editor_tabschangesuiThe editor tabs and split groups of the running Ferris IDEA window.
  • folding_rangesreadsFolding regions of a workspace file from its syntax tree: 0-based start and end line and kind (block, comment, imports, or a custom region).
  • list_filesreadsList project files (relative paths, sorted).
  • tool_windowschangeswriteThe workspace's tool window layout.
  • window_layoutschangesdry run by defaultwritesettingsThe user's named tool window layouts, shared by all projects.