From b3cc6bd29c1718e072b08916b218ff4869d214a2 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 19 Feb 2019 15:22:17 +0100 Subject: [PATCH] Create my own Transient command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s presented as a nice menu, and will most probably take over my personal keymap soon. --- configuration.org | 64 +++++++++++++++++++++++++++++++++++++++++++++++ customizations.el | 1 + 2 files changed, 65 insertions(+) diff --git a/configuration.org b/configuration.org index ab82952..b7ecf0e 100644 --- a/configuration.org +++ b/configuration.org @@ -2303,6 +2303,12 @@ Then configure ~real-auto-save-mode~ (prog-mode . fci-mode)) #+END_SRC +** Transient for creating beautiful command menus + +#+BEGIN_SRC emacs-lisp +(use-package transient) +#+END_SRC + * Make programming a bit easier ** Electric case @@ -3238,6 +3244,63 @@ directory. It is available from [[http://plantuml.com/download][here]]. * Last, but not least, key bindings! +** TODO My own, personal, Magit-popup! :experimental: + +With the new Transient package it will be easier. I just don’t know how to use it yet. + +#+BEGIN_SRC emacs-lisp +(define-transient-command gpolonkai/clock-menu () + [("I" "Clock in to last clocked task" org-clock-in-last) + ("g" "Go to the currently clocked task" org-clock-goto) + ("i" "Clock in here" org-clock-in) + ("o" "Clock out" org-clock-out)]) + +(define-transient-command gpolonkai/special-files-menu () + [("i" "My Emacs init file" gpolonkai/visit-init-file) + ("o" "My main Org file" gpolonkai/visit-org-index)]) + +(define-transient-command gpolonkai/git-menu () + [("g" "Update Git gutter everywhere" git-gutter:update-all-windows) + ("m" "Show the origin of this line" git-messenger:popup-message) + ("n" "Next hunk" git-gutter:next-hunk) + ("p" "Previous hunk" git-gutter:previous-hunk)]) + +(define-transient-command gpolonkai/mail-menu () + [("c" "Compose mail" mu4e-compose-new) + ("i" "Jump to folder" mu4e~headers-jump-to-maildir) + ("m" "Mu4e main screen" mu4e) + ("s" "Mu4u search" mu4e-headers-search)]) + +(define-transient-command gpolonkai/sx-menu () + [("i" "Inbox" sx-inbox) + ("s" "Search" sx-search)]) + +(define-transient-command gpolonkai/zone-menu () + [("i" "Enable zone on idle" gpolonkai/zone-enable) + ("q" "Disable zone on idle" zone-leave-me-alone)]) + +(define-transient-command gpolonkai/menu () + [("a" "My agenda" gpolonkai/org-agenda-list) + ("b" "Where has my cursor gone?" beacon-blink) + ("C" "Capture" org-capture) + ("c" "Clocking…" gpolonkai/clock-menu) + ("M-C" "Clean up old buffers" clean-buffer-list) + ("e" "EShell" eshell) + ("g" "Git…" gpolonkai/git-menu) + ("h" "Hide mode-line" hidden-mode-line-mode) + ("l" "Store Org link" org-store-link) + ("m" "Mail…" gpolonkai/mail-menu) + ("o" "Special files…" gpolonkai/special-files-menu) + ("q" "Stack Exchange…" gpolonkai/sx-menu) + ("r" "Show a random TODO" org-random-todo) + ("u" "Open URL" browse-url-at-point) + ("w" "Clean up whitespace problems" whitespace-cleanup) + ("x" "Expand region" er/expand-region) + ("z" "Zone…" gpolonkai/zone-menu)]) +#+END_SRC + +** The actual key bindings + #+BEGIN_SRC emacs-lisp (bind-keys :map global-map @@ -3275,6 +3338,7 @@ directory. It is available from [[http://plantuml.com/download][here]]. ("" . isearch-exit-other-end) ("" . isearch-exit-mark-match) :map gpolonkai/pers-map + ("C-t" . gpolonkai/menu) ("h" . hidden-mode-line-mode) ("C-i e" . "gergely@polonkai.eu") ("C-i w" . "http://gergely.polonkai.eu/") diff --git a/customizations.el b/customizations.el index 5d74e59..0f4e3ae 100644 --- a/customizations.el +++ b/customizations.el @@ -182,6 +182,7 @@ sphinx-doc spinner sx + transient typescript-mode undo-tree use-package