Back to Fresh

Emacs Keymap

docs/features/emacs-keymap.md

0.4.103.4 KB
Original Source

Emacs Keymap

Fresh ships an Emacs keymap. Turn it on from View → Keybinding Style → Emacs, or set it in config.json:

json
{
  "active_keybinding_map": "emacs"
}

The keymap inherits default, so every key Emacs has no opinion about — the settings editor, the completion popup, the integrated terminal, the dock, the multi-cursor and bookmark keys — keeps working exactly as it does out of the box. What follows is what the Emacs keymap changes.

Movement

KeyCommand
C-f / C-bforward / backward char
C-n / C-pnext / previous line
C-a / C-ebeginning / end of line
M-f / M-bforward / backward word
M-mback to indentation
M-< / M->beginning / end of buffer
M-{ / M-}backward / forward paragraph
C-v / M-vscroll down / up a page
C-lrecenter
M-g g, M-g M-ggoto line

Editing

KeyCommand
C-ddelete char forward
M-d / M-DELkill word forward / backward
C-kkill to end of line
C-S-DELkill whole line
C-ttranspose chars
C-oopen line
M-;comment / uncomment
M-/dabbrev expand
M-u / M-lupcase / downcase
C-/, C-_, C-x uundo
M-_redo

Mark and kill ring

KeyCommand
C-SPCset mark
C-w / M-wkill / copy region
C-yyank
C-gkeyboard quit — cancels the mark and drops extra cursors
C-x hmark whole buffer

Once the mark is set, plain movement extends the region, as in Emacs.

C-w, M-w and C-y use the system clipboard. Fresh has no kill ring, so C-k does not push the killed text onto it — text killed with C-k comes back with undo, not with C-y.

Search and replace

KeyCommand
C-ssearch forward (opens the search prompt)
C-s / C-r in the promptrepeat forward / backward
C-rsearch backward
M-%query replace

Files, buffers and windows (C-x)

KeyCommand
C-x C-ffind file
C-x C-ssave buffer
C-x ssave all buffers
C-x C-wwrite file (save as)
C-x kkill buffer
C-x b, C-x C-bswitch buffer
C-x <right> / C-x <left>next / previous buffer
C-x dfile explorer (dired)
C-x oother window
C-x 0delete window
C-x 2 / C-x 3split below / right
C-x C-cquit

Minibuffer, popups and menus

M-x opens the command palette. Inside any prompt, C-a/C-e, C-f/C-b, M-f/M-b, C-d, M-d, M-DEL, C-k, C-w, C-y and C-g do what they do in the Emacs minibuffer, and C-n/C-p move through the completion list. C-n/C-p also move in popups, menus and the file explorer, and C-g closes them.

LSP

KeyCommand
M-.go to definition
M-,back to where you jumped from
M-TAB (C-M-i)completion at point

Differences from GNU Emacs

  • No kill ring — see the note above.
  • C-x is a prefix, so it is not cut; C-c is not a prefix and copies.
  • C-q quits (Fresh convention) rather than quoted-insert.
  • M-x is the command palette, which also does file, buffer and line jumps.
  • Emacs has no redo; Fresh's is on M-_.

Anything here can be rebound in the keybinding editor or in the keybindings array of your config.