Fleet 1.0 Help

Getting started

This is a quick tour around Fleet that shows how to do basic things to get you started. All you need to follow along is install Fleet on your computer.

For simplicity, this tutorial only covers local development and assumes that you are using specific set of tools, for example, Gradle for building JVM projects. For steps that are dependent on the programming language, the instructions are provided for all languages that Fleet currently supports.

First of all, you will learn how to start Fleet and do some basic personalization. Then you will use Fleet as a text editor and explore its text editing, search, and navigation features. Also, you will learn how to version your project files using Git. Finally, the destination of our journey is working with code, which involves using code intelligence features, running, and debugging the program.

Start Fleet

Select color themes

You can customize Fleet appearance to your liking. Let's start with choosing the color theme.

  • Press ⌃` to switch themes.

    Select color themes

For more customizations, refer toSettings.

Tools and panels

All Fleet tools are organized in panels. Whenever you need to use a tool, for example, the terminal or debugger, you can open it in one of the panels.

UI overview

You can open tool panels using the buttons in the top-left corner of the window or by pressing ⌘1, ⌘2, or ⌘3.

Work with files and directories

Fleet does not rely on the concept of project. Instead, you can work with any directory and individual files as you would normally do in most text editors.

Open a directory

  1. From the workspaces menu, select Open in New Workspace.

    Workspace menu
  2. Select a directory.

    Open dir

When you open a directory, it becomes the root of a workspace. You can view its contents in the Files view.

Files tree

Create a file

  1. Select a directory in the Files view and press⌘N. Alternatively, right-click the directory and select New file.

  2. Give the file a name and an extension.

    New file

Edit text

At its core, Fleet is a lightweight text editor, well suited for viewing and editing individual text files. Let's look at some of the Fleet editor features:

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).

    Split view

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

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

Multicaret

Expand and shrink selection

  • You can expand and shrink selection at caret based on text or code structure. Use ⌥↑ and ⌥↓ for that.

Search

Whenever you want to perform a full-text search, navigate to a class, or just don't remember how to do something in Fleet, the Go to dialog is the right tool.

  • Press ⌘K and select the required tab with.

    Goto

Version control

You can commit and manage your Git repository from Fleet.

  1. Open the terminal ⌘⌥T and run the following commands:

    git init echo "Hello" > greeting git add . git commit -m "first commit"

    This will initialize a Git repository in the workspace, create a text file, and add the entire workspace to version control. You can omit this step and use your own Git-enabled project instead.

  2. Make some changes to the text file:

    Edit file

    A blue circle appears in the Files view near this file, indicating there are uncommitted changes.

  3. In the Files view, go to the Git tab, make sure that the change is selected, and click Commit.

    Commit changes

You can view commit details and diffs in the History tab:

Diff

Smart mode

When you are working with a programming language rather than just text, you'll need to enable smart mode, which turns Fleet into a full-fledged IDE.

This chapter is language-specific. Choose one of the supported languages before proceeding.

Let's create a Gradle project and use it as the example.

Create a project

  1. Make sure Gradle is installed on your computer.

  2. Press ⌘⌥T to open a terminal and execute the gradle init command.

  3. When prompted, answer:

    • Project type – 2 (application)

    • Implementation language – 3 (Java)

    • Split functionality across subprojects – 1 (no)

    • Build script DSL – 2 (Kotlin)

    • Test framework – 1 (JUnit 4)

    • Project name – skip

    • Source package – skip

Enable smart mode

  • In the top-right corner of the window, click Smart Mode Status, then Enable.

    Enable smart mode

After you click the Enable button, you may have to wait for some time, while backend is being prepared.

Here's what we can do in smart mode. The below is not an exhaustive list of smart mode features, rather a couple of examples that'll help you to get the feel of how it works in Fleet.

Use quick-fixes and intention actions

  • Press ⌥↵ to access actions that Fleet suggests in the current context.

    Intentions java

Refactor code

  • Place the caret at a literal or select an expression, then press ⌘⌥V.

    Extract variable java

    A variable is extracted from the selection.

Navigate the codebase

  • Navigate to the declaration of a symbol with ⌘B.

  • Use inlay hints navigate to client code and hierarchy members.

    Usages inlay java
  • Skim over the errors with ⌘E and ⌘⇧E

Use live templates

  • To generate a for loop, type fori and press . Press as you fill in the necessary variables.

    Template fori java

Let's create a Gradle project and use it as the example.

Create a project

  1. Make sure Gradle is installed on your computer.

  2. Press ⌘⌥T to open a terminal and execute the gradle init command.

  3. When prompted, answer:

    • Project type – 2 (application)

    • Implementation language – 4 (Kotlin)

    • Split functionality across subprojects – 1 (no)

    • Build script DSL – 2 (Kotlin)

    • Project name – skip

    • Source package – skip

Enable smart mode

  • In the top-right corner of the window, click Smart Mode Status, then Enable.

    Enable smart mode

After you click the Enable button, you may have to wait for some time, while backend is being prepared.

Here's what we can do in smart mode. The below is not an exhaustive list of smart mode features, rather a couple of examples that'll help you to get the feel of how it works in Fleet.

Use quick-fixes and intention actions

  • Press ⌥↵ to access actions that Fleet suggests in the current context.

    Intentions

Refactor code

  • Place the caret at a literal or select an expression, then press ⌘⌥V.

    Extract variable

    A variable is extracted from the selection.

Navigate the codebase

  • Navigate to the declaration of a symbol with ⌘B.

  • Use inlay hints navigate to client code and hierarchy members.

    Usages inlay
  • Skim over the errors with ⌘E and ⌘⇧E

Use live templates

  • To generate a for loop, type iter and press . Press as you fill in the necessary variables.

    Template fori

Create a project

  1. Make sure Rust is installed on your computer.

  2. Create a new Rust project: cargo new hello-world. Open the newly created directory in Fleet.

  3. Insert the following code to main.rs:

    fn main() { let myGreeting = "Hello"; let myIde = "Fleet"; greet(myGreeting, myIde); } fn greet(greeting: &str, name: &str) { println!("{}, {}!", greeting, name) }

Enable smart mode

  • In the top-right corner of the window, click Smart Mode Status, then Enable.

    Enable smart mode

After you click the Enable button, you may have to wait for some time, while backend is being prepared.

When you enable Smart Mode for a Rust project, Fleet ensures that you have the latest version of Rust analyzer and downloads it if necessary. This may take some time.

In Smart Mode, you get semantic highlighting, warnings, and code intelligence features. Let's try out some of them.

Apply quick-fixes

  1. Place the caret at a symbol that has a warning and press ⌥↵ to see if Fleet suggests a quick-fix.

    Rust caret at warning
  2. Select the appropriate quick-fix from the list.

    Rust intention

    The code gets corrected automatically.

Rename symbols

  • Place the caret at the symbol you want to rename and press ⌃R. Enter the new name for the symbol.

    Rust rename

    All occurrences of the symbol across the project get the new name.

Show parameter information

  • Place the caret at an argument passed to a function and press ⌘I.

    Rust parameter info

    Parameter information appears at the caret.

Show documentation

  • Place the caret at a symbol for which you want to view documentation and press ⌘⇧I.

    Rust doc

Run applications

In order to run your code, you need a run configuration. It defines how an application should be run. Run configurations are set up through the run.json file under .fleet.

Create a run configuration

  1. Press⌘R. The Run dialog opens.

    Create run json 0

    As there is no run.json in our project, Fleet suggests to create one. Click Create Run Configuration in run.json.

  2. Append a gradle run configuration to the array, so that the resulting JSON looks like the following:

    { "configurations": [ { "name": "run sh", "type": "command", "program": "/bin/sh" }, { "name": "gradle run", "type": "gradle", "tasks": [ "run" ] } ] }

Launch a run configuration

  • Press⌘R. The Run dialog opens. Select the newly created gradle run configuration.

    The application runs, and you can review its output in the console that opens.

    Console 0

Debug the application

  1. Add "debugJvm": "true", to the run configuration you are using, so that it looks like the following:

    { "name": "gradle run", "debugJvm": "true", "type": "gradle", "tasks": [ "run" ] }
  2. Set a breakpoint by clicking at an executable line in the gutter. This will suspend the application just when this line is about to execute.

    Breakpoint
  3. Run the application as usual. All application threads get suspended when any of them reaches the line with the breakpoint.

    Breakpoint suspend
  4. Inspect the program state in the Run and debug panel. As we are using a hello-world type of app here, we don't have a lot of state to inspect.

    The buttons above the threads list let you control the program execution. You can advance it line-by-line, step in and out of methods, resume and stop the program.

    Threads

To run a Rust application, click the gutter icon at the declaration of the main() function.

Rust run

The application runs, and you can review its output in the console that opens.

Rust console output
Last modified: 25 November 2021