# How to Use the Help Menu to Discover Available Hotkeys in Superfile

> Discover Superfile hotkeys easily. Press ? in the TUI to open the interactive Help Menu listing all available shortcuts and their descriptions.

- Repository: [Yorukot/superfile](https://github.com/yorukot/superfile)
- Tags: how-to-guide
- Published: 2026-07-26

---

**Press `?` while the superfile TUI is running to open the interactive Help Menu, which lists every available hotkey along with its description and context.**

Superfile is a terminal file manager maintained in the `yorukot/superfile` repository. It exposes its full keyboard reference through an interactive Help Menu that you can invoke without leaving the application. Learning how to use the help menu to discover available hotkeys in superfile lets you explore commands contextually while you are actively navigating files.

## Opening the Help Menu

The input handler in [`src/internal/key_function.go`](https://github.com/yorukot/superfile/blob/main/src/internal/key_function.go) watches for the global trigger. When a key message arrives, the application checks whether it matches `common.Hotkeys.OpenHelpMenu` and then opens the overlay:

```go
// 1. Open the help menu from the TUI (default hotkey: '?')
if slices.Contains(common.Hotkeys.OpenHelpMenu, msg) {
    m.helpMenu.Open() // see key_function.go
}

```

By default, `common.Hotkeys.OpenHelpMenu` is bound to `?` (the question-mark key). These binding slices are declared in [`src/internal/common/hotkeys.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/hotkeys.go), which is generated at build time, so every action references the same source of truth.

## How the Help Menu Compiles Its List

When `m.helpMenu.Open()` is called, the model populates its contents via `getData()` in [`src/internal/ui/helpmenu/data.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/helpmenu/data.go). This function returns a slice of `hotkeydata` structs that map each action to its human-readable description and scope:

```go
// 2. The HelpMenu model builds its data (excerpt)
func getData() []hotkeydata {
    return []hotkeydata{
        {
            hotkey:      common.Hotkeys.OpenHelpMenu,
            description: "Open help menu (hotkey list)",
            hotkeyWorkType: globalType,
        },
        // … many more entries …
    }
}

```

Because the catalog is defined in code, the help menu stays synchronized with the actual key bindings used throughout the TUI.

## Rendering and Formatting

The visual output is produced by `Render()` in [`src/internal/ui/helpmenu/render.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/helpmenu/render.go). It computes column widths, truncates long descriptions, and draws a cursor next to the selected entry. To display multi-key bindings such as `["j", "down"]`, the renderer calls `common.GetHelpMenuHotkeyString`, which joins the slice into a readable token like `j / down` and applies `HelpMenuHotkeyStyle`.

A typical rendering pass looks like this:

```go
// 3. Rendering a line (excerpt)
hotkey := common.GetHelpMenuHotkeyString(m.filteredData[i].hotkey)
description := common.TruncateText(m.filteredData[i].description, valueLength, "...")
r.AddLines(cursor + common.ModalStyle.Render(
    fmt.Sprintf("%*s%s", renderHotkeyLength,
        common.HelpMenuHotkeyStyle.Render(hotkey+" "),
        common.ModalStyle.Render(description)),
))

```

## Fuzzy Search for Faster Discovery

The Help Menu also supports fuzzy filtering. Typing into the search bar invokes `fuzzySearch` inside [`src/internal/ui/helpmenu/render.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/helpmenu/render.go), which leverages `utils.FzfSearch` to match your query against the combined hotkey and description text. This allows you to type a keyword such as “delete” or “rename” and immediately narrow the list to the relevant bindings.

## CLI Help Output

Running `spf --help` invokes the custom printer in [`src/cmd/help_printer.go`](https://github.com/yorukot/superfile/blob/main/src/cmd/help_printer.go). This file produces a cargo-style colored summary of usage and command-line flags. However, as implemented in `yorukot/superfile`, that output does **not** contain TUI hotkeys. The only way to use the help menu to discover available hotkeys in superfile is from within the running application.

## Summary

- Press **`?`** to trigger `common.Hotkeys.OpenHelpMenu`; the handler in [`src/internal/key_function.go`](https://github.com/yorukot/superfile/blob/main/src/internal/key_function.go) calls `m.helpMenu.Open()`.
- The static catalog lives in [`src/internal/ui/helpmenu/data.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/helpmenu/data.go), while the generated key slices reside in [`src/internal/common/hotkeys.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/hotkeys.go).
- [`src/internal/ui/helpmenu/render.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/helpmenu/render.go) draws the modal, formats multi-key strings via `common.GetHelpMenuHotkeyString`, and handles truncation and cursor placement.
- Use the live search bar to fuzzy-filter results with `utils.FzfSearch`.
- The CLI `--help` output in [`src/cmd/help_printer.go`](https://github.com/yorukot/superfile/blob/main/src/cmd/help_printer.go) is strictly for command-line options and omits TUI shortcuts.

## Frequently Asked Questions

### What is the default hotkey to open the superfile help menu?

The default hotkey is **`?`** (question-mark). This binding is stored in `common.Hotkeys.OpenHelpMenu` and is detected in [`src/internal/key_function.go`](https://github.com/yorukot/superfile/blob/main/src/internal/key_function.go) before `m.helpMenu.Open()` is invoked.

### Can I search for a specific action while the help menu is open?

Yes. The help menu provides a fuzzy search bar. As you type, `fuzzySearch` in [`src/internal/ui/helpmenu/render.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/helpmenu/render.go) calls `utils.FzfSearch` to filter entries against the combined hotkey and description text, updating the list in real time.

### Does `spf --help` list the same shortcuts as the interactive help menu?

No. The `spf --help` text produced by [`src/cmd/help_printer.go`](https://github.com/yorukot/superfile/blob/main/src/cmd/help_printer.go) covers command-line usage and flags only. The interactive TUI hotkeys are exclusively available through the in-app Help Menu.

### Where does superfile define the hotkeys shown in the help menu?

The visible entries are constructed by `getData()` in [`src/internal/ui/helpmenu/data.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/helpmenu/data.go). The actual key string slices—such as `OpenHelpMenu`, `ListUp`, and `Quit`—live in [`src/internal/common/hotkeys.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/hotkeys.go), which is generated at build time.