# Key Bindings Reference

This document provides a comprehensive reference of all default key bindings in eilmeldung.

**Note:** You can redefine all key bindings according to your preferences. You can also add completely new key bindings via the [configuration file](configuration.md).

---

## Table of Contents

- [Getting Help](#getting-help)
- [Syncing & Refreshing](#syncing--refreshing)
- [Navigation](#navigation)
- [Reading Articles](#reading-articles)
- [Read/Unread Status](#readunread-status)
- [Marking Articles](#marking-articles)
- [Tags](#tags)
- [Flagging Articles](#flagging-articles)
- [Zen Mode](#zen-mode)
- [Opening Links in Articles with Hints](#opening-links-in-articles-with-hints)
- [Article Views](#article-views)
- [Searching & Filtering](#searching--filtering)
- [Sorting Articles](#sorting-articles)
- [Command Line](#command-line)
- [Customizing Key Bindings](#customizing-key-bindings)
- [Mouse Support](#mouse-support)

---

## Getting Help

| Key | Action |
|-----|--------|
| `?` | Show all available key bindings |

**Tip:** Press `/` in the help dialog to filter and search for specific commands!

---

## Syncing & Refreshing

| Key | Action |
|-----|--------|
| `s` | Sync all feeds with your RSS provider |

---

## Navigation

| Key                   | Action                                                                              |
| -----                 | --------                                                                            |
| `j` / `k`             | Move down / up (vim-style)                                                          |
| `h` / `l`             | Move left (article → article list → feeds) / right (feeds → article list → article) |
| `gg`                  | Go to first item                                                                    |
| `G`                   | Go to last item                                                                     |
| `space`               | Toggle category tree node (open/close)                                              |
| `C-h`/`C-l`           | Navigate up/down in feed tree                                                       |
| `Ctrl-f` / `Ctrl-b`   | Page down / page up                                                                 |
| `Tab` / `Shift-Tab`   | Cycle through panels (forward / backward)                                           |
| `g f` / `g a` / `g c` | Jump directly to feeds / articles / content panel                                   |
| `C-j`                 | Move down in feeds list (from anywhere)                                             |
| `C-k`                 | Move up in feeds list (from anywhere)                                               |
| `J`                   | Move down in article content (from anywhere)                                          | 
| `K`                   | Move up in article content (from anywhere)                                          | 
| `M-j`                 | Move down in article list (from anywhere)                                             |
| `M-k`                 | Move up in article list (from anywhere)                                             | 

---

## Reading Articles

| Key | Action |
|-----|--------|
| `o` | Open article in browser, mark as read, and jump to next unread    |
| `O` | Open all unread articles in browser and mark all as read          |
| `y` | Copy article URL to clipboard                                     |
| `x` | Scrape full article content from the web (for truncated articles) |
| `S` | Share article (opens command line with share targets)             |
| `e` | Open (default) enclosure                                          |
| `E` | Open enclosure (opens command line with enclosure type)           |

---

## Read/Unread Status

| Key | Action |
|-----|--------|
| `r` | Mark current article as read (and go to next unread article) |
| `R` | Mark **all** articles as read (asks for confirmation) |
| `u` | Mark current article as unread |
| `U` | Mark **all** articles as unread (asks for confirmation) |
| `Alt-r` | Open command line to set read with query (e.g., `:read unread today`) |

**Note**: These commands are context-dependent! In the article list, they act on the *current article* or *all articles* in the list. On the feed list/tree they act on the *current category/feed* or *all categories/feeds*.

**Note**: To mark all articles *above* (and inlucding) the current article as read, press `0 r`; for all articles after `$ r`. This also works for `u`.

---
## Marking Articles

| Key | Action |
|-----|--------|
| `m` | Mark current article |
| `M` | Mark **all** articles (asks for confirmation) |
| `v` | Unmark current article |
| `V` | Unmark **all** articles (asks for confirmation) |

---
## Tags

| Key | Action |
|-----|--------|
| `t` | Open command line to tag article (e.g., `:tag tech`), **TAB** to autocomplete tag names |

You can create new tags with `:tagadd urgent red` (press **TAB** for autocomplete colors!). Once created, you can bulk-tag articles: `:tag tech unread` tags all unread articles as `tech`.

---

## Flagging Articles

You can flag (select) articles to execute bulk-operations like read, unread, mark, tag, etc. on them.


| Key | Action |
|-----|--------|
| `f` | Flag article |
| `F` | Flag **all** articles |
| `d` | Unflag current article (*d*elete flag) |
| `D` | Unflag **all** articles  |
| `i` | Invert flag of current article (*d*elete flag) |
| `I` | Invert flag **all** articles  |
| `Alt-f`/`Alt-d`/`Alt-d` | Open command line with `flag`/`unflag`/`flaginvert` with query (e.g., `:flag unread today`) |


**Note**: These commands only work for article list!

After flagging article, you can bulk-execute any of the above commands on them (`r` for `read`, `m` for `mark`, `t` for `tag`, you get it).

**Note**: To flag flag of all articles *above* and including the current article, press `0 f`; for all articles after `$ f` etc. This also works for `d` and `i`.

---

## Zen Mode

| Key | Action |
|-----|--------|
| `z` | Toggle distraction-free mode (hides all panels except article content) |

---

# Opening Links in Articles with Hints

Eilmeldung shows *hints* for links/images in the article:

![Image showing several link/image hints in the article content display of eilmeldung](images/hints.png)

The "codes" (letters in this case, see setting `hint_type`) before the icons are called *(link) hints*. The following default keybindings are defined for hints:


| Key | Action |
|-----|--------|
| `; ;` | Open a hint in the webbrowser, by entering the hint (see also command `hintopen`)        |
| `; s` | Share URL of hint: enter a share target and then the hint (see also command `hintshare`) |
| `; y` | Copy URL of hint to clipboard (see also command `hintshare`)                             |

## Article Views

| Key | Action |
|-----|--------|
| `1` | Show all articles |
| `2` | Show only unread articles |
| `3` | Show only marked articles |

---

## Searching & Filtering

| Key | Action |
|-----|--------|
| `/` | Search articles (type query and press Enter) |
| `n` / `N` | Jump to next / previous match |
| `=` | Open command line to filter articles |
| `+ +` | Apply current filter |
| `+ r` | Clear filter and show all articles |

See [Article Queries](queries.md) for how to craft powerful queries.

**Note**: `=` executes `filter` which is *non-sticky*, i.e., when you change the selected entry in the feed tree, it is not applied automatically. If you want to apply a *sticky* filter, you have to use `filtersticky`, i.e., re-map `=` to `cmd filtersticky`.

---

## Sorting Articles

| Key | Action |
|-----|--------|
| `\` | Open command line to set sort order |
| `\| \|` | Reverse current sort order |
| `\| r` | Clear sort order and restore default |

Articles can be sorted by multiple criteria: `feed`, `date`, `synced`, `title`, or `author`. The sort order is displayed in the article list header with an icon (󰌼 for normal, 󰒿 for reversed).

**Examples:**
```
:sort date                    # Sort by date (newest first)
:sort >date                   # Sort by date (oldest first)
:sort feed title              # Sort by feed name, then by title
:sort feed date               # Sort by feed (A-Z), then by date (newest first)
```

For complete sorting documentation, see [Commands](commands.md#sorting-articles).

---

## Feed List Management

These start all with `c` for *change*.

| Key   | Action                                                                               |
| ----- | --------                                                                             |
| `c w` | Rename selected element                                                              |
| `c d` | Remove selected element (move children/subentries up)                                |
| `c x` | Remove selected element and all its children/subentries                              |
| `c f` | Add a feed (opens command line)                                                      |
| `c a` | Add a category (opens command line)                                                  |
| `c u` | Change URL of feed (opens command line)                                              |
| `c y` | *Yank* selected element for move operation (feed or category)                        |
| `c p` | *Paste* yanked element *after* selected element (or *into* if cateogry is selected)  |
| `c P` | *Paste* yanked element *before* selected element (or *into* if cateogry is selected) |
| `c c` | Change color of selected tag                                                         |
| `c s` | Sorts feeds alphabetically                                                           |

## Command Line

| Key | Action |
|-----|--------|
| `:` | Open command line for advanced commands |
| `Esc` or `Ctrl-g` | Cancel command input |
| `Ctrl-u` | Clear command input |
| `Tab`, `Backtab` | Trigger/cycle autocomplete and show help |

---

## Customizing Key Bindings

All key bindings can be customized in your configuration file. See the [Input Configuration](configuration.md#input-configuration) section for details on:

- How to remap existing keys
- How to create multi-key sequences (like `gg`)
- How to bind multiple commands to a single key
- How to unbind keys

**Example custom bindings:**
```toml
[input_config.mappings]
# Vim-style save and quit
"Z Z" = ["confirm quit"]

# Quick tagging
"t i" = ["tag important"]
"t u" = ["tag urgent"]

# Custom navigation
"C-j" = ["pagedown"]
"C-k" = ["pageup"]

# Using modifiers
"C-k" = ["..."] # Ctrl
"M-k" = ["..."] # Meta (Alt)
"S-f1" = ["..."] # Shift and F1
"S-down" = ["..."] # Shift and down arrow key
```

See the [default configuration](../examples/default-config.toml) for the complete list of default key bindings.

## Mouse Support

Mouse support is disabled by default. Enable it by `mouse_support = true`:
- selection by a mouse click is supported in the feed and article list
- rudimentary scrolling support in the article list and the article content
- drag the border between the articles and the content to resize (note that this overrides layout settings from the config file)
