▲ 25 r/emacs
There is VimGolf, but is there any EmacsGolf?
if no
Any intentions to create one?
u/sylas_main — 2 days ago
if no
Any intentions to create one?
sry guys i need testers feedback on my app https://github.com/megamind1230/side/tree/master/nextlearn
this is not promotion but fk these rules
>
function ==> shortcut
​
;; --------------------
;; list bindings
;; --------------------
(defun list-bindings ()
"List all commands with a keybinding, sorted by name."
(interactive)
(let* ((bindings '())
(seen (make-hash-table :test #'equal)))
(cl-labels
((walk (km)
(map-keymap
(lambda (_evt bind)
(cond
((keymapp bind)
(walk bind))
((and (commandp bind) (symbolp bind))
(unless (gethash bind seen)
(puthash bind t seen)
(let ((keys (where-is-internal bind nil t)))
(when keys
(push (cons (symbol-name bind)
(key-description keys))
bindings)))))))
km)))
;; Walk maps
(dolist (km
(append
(list (current-global-map)
(current-local-map))
(when (featurep 'evil)
(list evil-normal-state-map
evil-insert-state-map
evil-visual-state-map
evil-motion-state-map
evil-emacs-state-map))))
(when km (walk km)))
;; Sort
(setq bindings
(sort bindings
(lambda (a b) (string< (car a) (car b)))))
;; Output buffer
(with-current-buffer (get-buffer-create "*keybindings*")
(let ((inhibit-read-only t))
(erase-buffer)
(insert (format "%-50s %s\n" "Function" "Keybinding"))
(insert (make-string 70 ?=) "\n\n")
(pcase-dolist (`(,cmd . ,keys) bindings)
(insert (format "%-50s ==> %s\n" cmd keys)))
(goto-char (point-min))
(setq buffer-read-only t))
(display-buffer (current-buffer))
(message "Found %d keybindings" (length bindings))))))
;; Bind it
(global-set-key (kbd "C-c k") #'list-bindings)
this is so much useful for the new emacs users especially
>makes it easier to search functions/ memorize their names / and of course remember the keybindings of them
hope you enjoy it
it's not a promotion .. just need help wtf
I need a feedback or contributions to make this useful btw im noob but still accept flaming and im learning by building projects with AI