Skip to content

Instantly share code, notes, and snippets.

@Metaxal
Last active August 3, 2020 17:35
Show Gist options
  • Save Metaxal/b233efb81649cd7e7fe0786cc0cb6394 to your computer and use it in GitHub Desktop.
Save Metaxal/b233efb81649cd7e7fe0786cc0cb6394 to your computer and use it in GitHub Desktop.
A quickscript to show the active keybindings
#lang racket/gui
;;; License: MIT/Apache2
(require quickscript
search-list-box)
(script-help-string "Show active keybindings")
(define-script keybindings
#:label "keybindings"
(λ (selection #:editor ed)
(define kmap (send ed get-keymap))
(define tb (sort (hash->list (send kmap get-map-function-table))
string<? #:key cdr))
(define fr
(new search-list-box-frame%
[label "Show active keybindings"]
[contents tb]
[key (λ (cont) (format "~a (~a)" (cdr cont) (car cont)))]))
#f))
@Metaxal
Copy link
Author

Metaxal commented Aug 3, 2020

Screenshot from 2020-08-03 18-35-19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment