Under Development
stars

Edit Input Fields#

Overview#

NeoMutt has a built-in line editor for inputting text wherever you type at a prompt β€” for example, email addresses in header fields, filenames, search patterns, and command lines. The key bindings follow Emacs conventions.

Key Bindings#

Movement#

Key

Function

Description

Ctrl-A or <Home>

<bol>

Move to the start of the line

Ctrl-E or <End>

<eol>

Move to the end of the line

Ctrl-B or <Left>

<backward-char>

Move back one character

Ctrl-F or <Right>

<forward-char>

Move forward one character

Alt-B

<backward-word>

Move back one word

Alt-F

<forward-word>

Move forward one word

Deletion#

Key

Function

Description

Ctrl-D or <Delete>

<delete-char>

Delete the character under the cursor

<Backspace>

<backspace>

Delete the character before the cursor

Ctrl-K

<kill-eol>

Delete to the end of the line

Ctrl-U

<kill-line>

Delete the entire line

Ctrl-W

<kill-word>

Delete the word before the cursor

Alt-d

<kill-eow>

Delete to the end of the word

Word Case#

Key

Function

Description

Alt-u

<upcase-word>

Convert word to upper case

Alt-l

<downcase-word>

Convert word to lower case

Alt-c

<capitalize-word>

Capitalize the word

Miscellaneous#

Key

Function

Description

Ctrl-V

<quote-char>

Quote (escape) the next typed key

Ctrl-G

n/a

Abort the current prompt or action

<Return>

n/a

Confirm / finish editing

Tab Completion#

Press <Tab> to trigger completion. What gets completed depends on context:

  • Filenames β€” completes paths in the filesystem

  • Aliases β€” completes known address aliases

  • Labels β€” completes mailbox labels

Press Ctrl-T to run an address query (using $query_command) and complete from the results.

History Navigation#

NeoMutt keeps a separate history list for each input category (addresses, filenames, patterns, shell commands, mailboxes, config commands, and everything else). The number of history entries is controlled by $history.

Key

Function

Description

<Up>

<history-up>

Recall the previous string from history

<Down>

<history-down>

Recall the next string from history

Ctrl-R

<history-search>

Search history using the current input

NeoMutt remembers what you were typing as you cycle through history, and wraps back to your original entry.

To make history persistent across sessions, set:

set history_file = ~/.config/neomutt/history
set save_history = 100

To remove all duplicate entries (not just consecutive ones):

set history_remove_dups

Entries starting with a space are silently ignored β€” useful in macros to avoid polluting history with transient values.

Remapping Editor Keys#

Use the :bind command with the editor map to remap any function. For example, to make <Delete> behave like <Backspace> (deleting the character before the cursor instead of under it):

bind editor <delete> backspace

Using an External Editor#

Set $editor to launch an external editor for composing message bodies:

set editor = "vim"

The built-in line editor is still used for all prompt fields (To, Subject, etc.). The external editor is invoked only for the message body when composing.