0

Is there some kind of popup creator package which enables me to create some customized cheat sheets to help me with commands I need or haven't yet memorized?

I want to create some simple text files, get them to popup when I need them, cancel the popup after seeing the command I need, or select and execute the command it.

It must be something like the helm-descbinds but one whose information I create myself, so I can tab to the command I want and execute it.

  • M-x find-file-other-window and then M-x delete-window when you are done -- killing the buffer when you are done with it is a matter of personal preference. Please consider editing your question to address just one distinct issue, and advise this forum in the future if you are having people spin their wheels in several locations: reddit.com/r/emacs/comments/6mdzlq/… – lawlist Jul 10 '17 at 14:58
2

The following packages may help you:

which-key              ;;; Display available keybindings in popup
hydra                 ;;; Make bindings that stick around

Which key will remind you of available commands as you type. Then pick bindings that group your commands so they are easier to remember (C-c p is projectile-map). I type C-c p and which-key shows me the available projectile commands.

(use-package which-key              ;;; Display available keybindings in popup
  :diminish which-key-mode
  :config
  (setq which-key-sort-order 'which-key-key-order-alpha)   ;; sort single chars alphabetically P p Q q
  (setq which-key-idle-delay 0.8)
  (which-key-mode))

I use hydra to help remind me of avy-actions

(defhydra hydra-avy-action (:color red :hint nil)
  "
Avy actions^^^^^
_y_: yank           [_z_ _X_]: kill-stay     [_n_ _c_]: copy     _i_ : ispell
_t_: teleport        ^ ^ _x_ : kill-move      ^ ^ _m_ : mark
"
  ("c" avy-action-copy)
  ("n" avy-action-copy)
  ("m" avy-action-mark)
  ("t" avy-action-teleport)
  ("x" avy-action-kill-move)
  ("X" avy-action-kill-stay)
  ("y" avy-action-yank)
  ("z" avy-action-kill-stay)
  ("i" avy-action-ispell)
  ("M-g p" nil "avy-pop-mark"))

(bind-key "C-9" 'hydra-avy-action/body)

1

I use a custom menu. with the package easy-menu you can create your own menus. They show a title, a popup help and the key shortcut.
Do it like this:

(easy-menu-define my-menu global-map "My-Menu"
    '("My-Menu"
      ("General"
       ("File"
        [ "insert file content"   insert-file :help "Copy content of file at point" ]
        )
       ( "---" )
       [ "Save WindowLayout"    my-custom-function :keys "C-u C-x r SPC w" :help "Save window layout\n the keybinding is for a similar command" ]
       ( "Lisp"      :active (string= major-mode "lisp-mode")
         [ "restore scratch"        (switch-to-buffer "*scratch*") :help "create or switch *scratch* buffer\nnext line" ]
         )
       )
      )
    )

Note: This code should demonstrate what is possible. Put the code in your init.el or emacs.el.

0

I ended up using https://github.com/darksmile/cheatsheet.

It is quite simple and straightforward, but I am sure I can cook up something more sophisticated when my emacs skills improve

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.