Add evil-collection-describe-all-bindings

This is a simple function to write out known evil-collection bindings to a new
buffer.
This commit is contained in:
Justin Burkett 2018-06-05 14:14:16 -04:00 committed by James N
parent 0e7698dd1a
commit e60988f625
1 changed files with 22 additions and 0 deletions

View File

@ -220,6 +220,28 @@ Filter keys on the basis of `evil-collection-key-whitelist' and
(push (cons package record) evil-collection-bindings-record))
nil))
(defun evil-collection-describe-all-bindings ()
"Print bindings made by evil-collection to separate buffer."
(interactive)
(let ((buf (get-buffer-create "*evil-collection*")))
(switch-to-buffer-other-window buf)
(with-current-buffer buf
(erase-buffer)
(org-mode)
(dolist (package evil-collection-bindings-record)
(insert "\n\n* " (symbol-name (car package)) )
(insert "
| Key | Definition |
|-----|------------|
")
(dolist (binding (cdr package))
;; Don't print nil definitions
(when (cdr binding)
;; FIXME: Handle keys with | in them
(insert (format "| %s | %S |\n"
(key-description (car binding)) (cdr binding)))))
(org-table-align)))))
(defun evil-collection--translate-key (state keymap-symbol
translations
destructive)