Skip to content

Creating your own keymaps

All internal keymaps are defined with the standard helper macro ‘defvar-keymap’. For example a simple version of the file action keymap could be defined as follows:

emacs-lisp
(defvar-keymap embark-file-map
  :doc "Example keymap with a few file actions"
  :parent embark-general-map
  "d" #'delete-file
  "r" #'rename-file
  "c" #'copy-file)

These action keymaps are perfectly normal Emacs keymaps. You may want to inherit from the ‘embark-general-map’ if you want to access the default Embark actions. Note that ‘embark-collect’ and ‘embark-export’ are also made available via ‘embark-general-map’.