User guide / Custom key bindings

Key binding recipes

Development reference · View source

Yank the whole buffer:

keys:
  bind:
    normal:
      F6: [select-all, yank]

Sort the selected lines:

keys:
  bind:
    normal:
      Alt-s: { command: pipe, argument: sort }
    select:
      Alt-s: { command: pipe, argument: sort }

Switch to a particular theme (theme is the palette name of open-theme-settings):

keys:
  bind:
    normal:
      F10: { command: theme, argument: mocha }

Open a file:

keys:
  bind:
    normal:
      F11: { command: open, argument: README.md }

Select a line and start typing at its end:

keys:
  bind:
    normal:
      Alt-a: [select-line, insert-line-end]

Stop a key from doing anything (here J, which joins lines by default). Remove it in each mode where it is bound:

keys:
  bind:
    normal:
      J: null
    select:
      J: null

Open the action list with F2 (help is the palette name of show-help):

keys:
  bind:
    normal:
      F2: { command: help, argument: key-actions }