# Keyboard Shortcuts

Reference for all keyboard shortcuts in Tabnine CLI.

Key bindings can be customized via `~/.tabnine/agent/keybindings.json`. See [Custom Key Bindings](#custom-key-bindings) at the bottom of this page. For [slash commands](/main/getting-started/tabnine-cli/features/commands.md), type `/` on an empty prompt.

### Basic Controls

| Action                       | Keys                                              |
| ---------------------------- | ------------------------------------------------- |
| Confirm selection            | `Enter`                                           |
| Dismiss dialog               | `Esc`, `Ctrl+[`                                   |
| Cancel request / clear input | `Ctrl+C`                                          |
| Exit (empty input buffer)    | `Ctrl+D`                                          |
| Suspend to background        | `Ctrl+Z` (double-press; not supported on Windows) |

### Text Input

| Action                  | Keys                                                            |
| ----------------------- | --------------------------------------------------------------- |
| Submit prompt           | `Enter`                                                         |
| New line without submit | `Ctrl+Enter`, `Cmd+Enter`, `Alt+Enter`, `Shift+Enter`, `Ctrl+J` |
| Open external editor    | `Ctrl+X`                                                        |
| Paste from clipboard    | `Ctrl+V`, `Cmd+V`, `Alt+V`                                      |

### Cursor Movement

| Action        | Keys                               |
| ------------- | ---------------------------------- |
| Start of line | `Ctrl+A`, `Home`                   |
| End of line   | `Ctrl+E`, `End`                    |
| Move up       | `Up`                               |
| Move down     | `Down`                             |
| Move left     | `Left`                             |
| Move right    | `Right`, `Ctrl+F`                  |
| Word left     | `Ctrl+Left`, `Alt+Left`, `Alt+B`   |
| Word right    | `Ctrl+Right`, `Alt+Right`, `Alt+F` |

### Editing

| Action                  | Keys                                         |
| ----------------------- | -------------------------------------------- |
| Delete to end of line   | `Ctrl+K`                                     |
| Delete to start of line | `Ctrl+U`                                     |
| Delete previous word    | `Ctrl+Backspace`, `Alt+Backspace`, `Ctrl+W`  |
| Delete next word        | `Ctrl+Delete`, `Alt+Delete`, `Alt+D`         |
| Delete character left   | `Backspace`, `Ctrl+H`                        |
| Delete character right  | `Delete`, `Ctrl+D`                           |
| Undo                    | `Cmd+Z`, `Alt+Z`                             |
| Redo                    | `Ctrl+Shift+Z`, `Cmd+Shift+Z`, `Alt+Shift+Z` |

### Scrolling

| Action           | Keys                      |
| ---------------- | ------------------------- |
| Scroll up        | `Shift+Up`                |
| Scroll down      | `Shift+Down`              |
| Scroll to top    | `Ctrl+Home`, `Shift+Home` |
| Scroll to bottom | `Ctrl+End`, `Shift+End`   |
| Page up          | `Page Up`                 |
| Page down        | `Page Down`               |

### History & Search

| Action                   | Keys     |
| ------------------------ | -------- |
| Previous history         | `Ctrl+P` |
| Next history             | `Ctrl+N` |
| Reverse search           | `Ctrl+R` |
| Submit search result     | `Enter`  |
| Accept search suggestion | `Tab`    |

{% hint style="info" %}
`Up`/`Down` arrows also navigate input history when the cursor is on the first or last line.
{% endhint %}

### Navigation

| Action               | Keys        |
| -------------------- | ----------- |
| Move up in lists     | `Up`        |
| Move down in lists   | `Down`      |
| Move up in dialogs   | `Up`, `K`   |
| Move down in dialogs | `Down`, `J` |
| Next dialog item     | `Tab`       |
| Previous dialog item | `Shift+Tab` |

### Auto-Completion

| Action              | Keys             |
| ------------------- | ---------------- |
| Accept suggestion   | `Tab`, `Enter`   |
| Previous option     | `Up`, `Ctrl+P`   |
| Next option         | `Down`, `Ctrl+N` |
| Expand suggestion   | `Right`          |
| Collapse suggestion | `Left`           |

### App Controls

| Action                                                                                      | Keys        |
| ------------------------------------------------------------------------------------------- | ----------- |
| Clear screen                                                                                | `Ctrl+L`    |
| Toggle Markdown rendering                                                                   | `Alt+M`     |
| Toggle error details                                                                        | `F12`       |
| Toggle copy mode                                                                            | `Ctrl+S`    |
| Toggle TODO list                                                                            | `Ctrl+T`    |
| Toggle IDE context                                                                          | `Ctrl+G`    |
| Toggle YOLO mode                                                                            | `Ctrl+Y`    |
| Cycle [approval mode](/main/getting-started/tabnine-cli/features/settings.md#approval-mode) | `Shift+Tab` |
| Expand/collapse blocks                                                                      | `Ctrl+O`    |
| Focus shell input                                                                           | `Tab`       |
| Unfocus shell input                                                                         | `Shift+Tab` |
| Toggle background shell                                                                     | `Ctrl+B`    |

### Shell Mode

| Action            | Keys                 |
| ----------------- | -------------------- |
| Toggle shell mode | `!` (on empty input) |
| Exit shell mode   | `Esc`                |

### Special Keys

| Action                | Keys                             |
| --------------------- | -------------------------------- |
| Show shortcuts panel  | `?` (on empty input)             |
| Select file or folder | `@`                              |
| Clear and rewind      | `Esc` `Esc` (double-press)       |
| Line continuation     | `` ` `` at end of line + `Enter` |

### Vim Mode

When Vim mode is enabled (via `/vim` command or `general.vimMode` [setting](/main/getting-started/tabnine-cli/features/settings/settings-reference.md)):

#### NORMAL Mode

* Navigate: `h`, `j`, `k`, `l`, `Left`, `Right`, `Up`, `Down`
* Word jumps: `w`, `W`, `b`, `B`, `e`, `E`
* Find character: `f{char}`, `F{char}`, `t{char}`, `T{char}`, `;`, `,`
* Line start/end: `0`, `$`, `^`
* Go to line: `gg`, `G`, `{count}G`
* Edit: `x`, `X`, `~`, `r{char}`
* Delete: `dd`, `D`, `d{motion}` (dw, db, de, dh, dj, dk, dl, d0, d$, d^, dgg, dG)
* Change: `cc`, `C`, `c{motion}` (cw, cb, ce, ch, cj, ck, cl, c0, c$, c^, cgg, cG)
* Insert: `i`, `a`, `o`, `O`, `I`, `A`
* Yank: `yy`, `yw`, `yW`, `ye`, `yE`, `y$`, `Y`
* Paste: `p`, `P`
* Undo: `u`
* Repeat: `.`
* Count prefix: `{count}` before any command

#### INSERT Mode

* Return to NORMAL: `Esc`, `Ctrl+[`
* All standard editing keys pass through

## Custom Key Bindings

Create `~/.tabnine/agent/keybindings.json` to add or remove bindings:

```json
[
  { "command": "app.toggleMarkdown", "key": "ctrl+m" },
  { "command": "-app.toggleMarkdown", "key": "alt+m" }
]
```

* Prefix a command with `-` to remove a binding
* Key format: modifiers joined with `+` (e.g., `ctrl+shift+a`, `alt+enter`)
* Available modifiers: `ctrl`, `shift`, `alt` (or `option`/`opt`), `cmd` (or `meta`)

{% hint style="info" %}
Quick tips:

* Type `?` on an empty prompt to show the shortcuts panel
* In dialogs, type numbers `1`–`9` to jump to options
* Shell commands run with `TABNINE_CLI=1` environment variable
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tabnine.com/main/getting-started/tabnine-cli/features/keyboard-shortcuts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
