Skip to content

Manual §5 Emacs Mode

Koichi Murase edited this page Jan 16, 2020 · 9 revisions

[ 日本語 | English ] ≫ Manual [§1 Intro | §2 Color | §3 Bind | §4 Edit | §5 Emacs | §6 Vim | §7 Comp | §8 Misc]

5. Emacs editing mode

Emacs editing mode is essentially the same as what is described in §4 Editing. The specific bindings in Emacs editing mode explained here.

5.1 Editing

Character insert and delete

Key combination Widget Description
C-q, C-v emacs/quoted-insert Insert the next character before key decode
paste_begin emacs/bracketed-paste Start Bracketed Paste Mode
C-d delete-region-or delete-forward-char-or-exit Delete the selection or the forward character, or exit the shell

Undo & Redo

Key combination Widget Description
C-_, C-DEL, C-BS, C-/, C-x u, C-x C-u emacs/undo Undo
C-x U, C-x C-S-u emacs/redo Redo
M-r emacs/revert Restore the original text

Internal use

Key combination Widget
__attach__ safe/__attach__
__before_widget__ emacs/__before_widget__
__after_widget__ emacs/__after_widget__
C-</kbd>, C-^ bell

5.2 Shell operations

Expansions

Key combination Widget Description
M-^ history-expand-line Perform history expansions
SP magic-space Perform expansions and insert a space
M-C-e shell-expand-line Perform shell expansions
M-& tilde-expand Perform tilde expansions

Run command or cancel

Key combination Widget Description
C-c discard-line Discard the contents of the current line
C-j, C-RET accept-line Execute the current line
C-m, RET accept-single-line-or-newline Execute the current line (in single-line mode) or insert a newline
C-o accept-and-next Execute the current line and go to the next history entry
C-x C-e edit-and-execute-command Edit and execute the current command
M-# insert-comment Insert comments
C-g, C-x C-g, C-M-g bell Cancel

Miscellaneous

Key combination Widget Description
C-l clear-screen Clear screen and redraw the line
C-M-l redraw-line Redraw the line
f1 command-help Show help of the current command
C-x C-v display-shell-version Display the shell version
C-z, M-z (command) fg Resume the stopped job

5.3 Settings specific to Emacs editing mode

Settings specific to Emacs editing mode needs to be performed through the hook keymap_emacs_load.

# blerc (Example)

function my/emacs-load-hook {
  # Settings for Emacs editing mode
  ...
}

blehook/eval-after-load keymap_emacs my/emacs-load-hook
# ble-0.3 and before
# ble/array#push _ble_keymap_emacs_load_hook my/emacs-load-hook

[ 日本語 | English ] ≫ Manual [§1 Intro | §2 Color | §3 Bind | §4 Edit | §5 Emacs | §6 Vim | §7 Comp | §8 Misc]

Clone this wiki locally