3.4. Key Bindings

If you want to bind a command to a key you can do so by adding the pair to the [bindings] section. This will introduce a global binding, that works in all modes. To make a binding specific to a mode you have to add the pair under the subsection named like the mode. For instance, if you want to bind T to open a new search for threads tagged with ‘todo’, and be able to toggle this tag in search mode, you’d add this to your config

[bindings]
  T = search tag:todo

  [[search]]
  t = toggletags todo

Known modes are:

  • envelope
  • search
  • thread
  • taglist
  • bufferlist

Have a look at the urwid User Input documentation on how key strings are formatted.

3.4.1. Default bindings

User-defined bindings are combined with the default bindings listed below.

up = move up
down = move down
page up = move page up
page down = move page down
j = move down
k = move up
' ' = move page down
@ = refresh
? = help bindings
I = search tag:inbox AND NOT tag:killed
L = taglist
shift tab = bprevious
U = search tag:unread
tab = bnext
\ = prompt 'search '
d = bclose
$ = flush
m = compose
o = prompt 'search '
q = exit
';' = bufferlist
':' = prompt

[bufferlist]
    x = close
    enter = open

[search]
    enter = select
    a = toggletags inbox
    & = toggletags killed
    ! = toggletags flagged
    s = toggletags unread
    l = retagprompt
    O = refineprompt
    | = refineprompt

[envelope]
    a = prompt 'attach ~/'
    y = send
    P = save
    s = 'refine Subject'
    t = 'refine To'
    b = 'refine Bcc'
    c = 'refine Cc'
    S = togglesign
    enter = edit
    H = toggleheaders

[taglist]
    enter = select

[thread]
    enter = select
    C = fold --all
    E = unfold --all
    c = fold
    e = unfold
    < = fold
    > = unfold
    H = toggleheaders
    h = togglesource
    P = print --all --separately --add_tags
    S = save --all
    g = reply --all
    f = forward
    p = print --add_tags
    n = editnew
    s = save
    r = reply
    | = prompt 'pipeto '

3.4.2. Overwriting defaults

To disable a global binding you can redefine it in your config to point to an empty command string. For example, to add a new global binding for key a, which is bound to toggletags inbox in search mode by default, you can remap it as follows.

[bindings]
  a = NEW GLOBAL COMMAND

  [[search]]
    a =

If you omit the last two lines, a will still be bound to the default binding in search mode.

Table Of Contents

Previous topic

3.3. Contacts Completion

Next topic

3.5. Hooks

This Page