From db1deb4a18e73f4216af282d164c0971726458b4 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 6 May 2017 23:01:09 +0200 Subject: [PATCH] Fix M-z in minibuffer (ivy/evil/etc) --- TODO.org | 10 ++++++---- core/autoload/minibuffer.el | 6 ++++++ modules/completion/ivy/config.el | 1 + modules/private/hlissner/+bindings.el | 3 ++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/TODO.org b/TODO.org index f1d826459..db7f85a79 100644 --- a/TODO.org +++ b/TODO.org @@ -5,7 +5,7 @@ + [-] Work-in-progress + [X] Complete -** Unreleased [49/124] +** Unreleased [51/126] + [1/13] Potential plugins + [ ] [[https://github.com/etu/webpaste.el][webpaste.el]]: sending text to bin servies (like gist, ix.io, sprunge, etc.) + [ ] [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]]: client for MS Language Server Protocol, keep an eye on this @@ -90,14 +90,16 @@ + [ ] rss + [ ] twitter + [ ] present ++ [ ] Restore open neotree window state properly when switching perspectives + [ ] Fix invisible buffer-info in modeline for terminal Emacs + [ ] send-to-REPL workflow: does it still work? (see ~:repl~ & ~+eval/repl-send-region~) -+ [ ] Fix ~M-z~, ~C-u~ and ~C-w~ in ~org-store-link~ & ~org-insert-link~ prompts - Should undo, delete-line, and delete-word, respectively. Instead, they fall - back to vanilla commands. + [ ] Update screenshots + [ ] tools/upload: add ~+upload/open-remote-file~ command to open current file on the remote (with TRAMP) + [ ] Fix ~0/0~ displaying in modeline (caused by leftover anzu state) ++ [X] Fix ~M-z~, ~C-u~ and ~C-w~ in ~org-store-link~ & ~org-insert-link~ prompts + Should undo, delete-line, and delete-word, respectively. Instead, they fall + back to vanilla commands. ++ [X] Prevent 'buffer is read-only' messages while in minibuffer + [X] completion/ivy: replace Ag with RipGrep + [X] Detect & load \~/.emacs.local.el, if available + [X] lang/org: fontify items with all subitems done, e.g. ~+ [0/0] headline~ diff --git a/core/autoload/minibuffer.el b/core/autoload/minibuffer.el index 2563e4fce..fb5633f1c 100644 --- a/core/autoload/minibuffer.el +++ b/core/autoload/minibuffer.el @@ -17,3 +17,9 @@ monopolizing the minibuffer." (interactive) (when (> (point) (minibuffer-prompt-end)) (call-interactively 'backward-kill-sentence))) + +;;;###autoload +(defun doom-minibuffer-undo () + "Undo an edit in the minibuffer without throwing errors." + (interactive) + (ignore-errors (call-interactively 'undo))) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index eaaa5cef2..1eac4b8d3 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -43,6 +43,7 @@ (map! :map ivy-minibuffer-map [escape] #'keyboard-escape-quit "M-v" #'yank + "M-z" #'undo "C-r" #'evil-paste-from-register "C-k" #'ivy-previous-line "C-j" #'ivy-next-line diff --git a/modules/private/hlissner/+bindings.el b/modules/private/hlissner/+bindings.el index e2a299f6e..d8a985859 100644 --- a/modules/private/hlissner/+bindings.el +++ b/modules/private/hlissner/+bindings.el @@ -376,7 +376,8 @@ "C-w" 'doom-minibuffer-kill-word "C-u" 'doom-minibuffer-kill-line "C-b" 'backward-word - "C-f" 'forward-word) + "C-f" 'forward-word + "M-z" 'doom-minibuffer-undo) (:after view (:map view-mode-map "" 'View-quit-all))