summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2016-11-14 09:59:57 +0100
committerAlan Pearce2016-11-14 09:59:57 +0100
commit4f3fcb5fb8ec10f47339175a8550166e6036f00f (patch)
treef587412325087bbb641b472e2946cfeed1b52632
parent384e602dfb942d2d6a4871f6449181d44bd0c26b (diff)
downloaddotfiles-4f3fcb5fb8ec10f47339175a8550166e6036f00f.tar.lz
dotfiles-4f3fcb5fb8ec10f47339175a8550166e6036f00f.tar.zst
dotfiles-4f3fcb5fb8ec10f47339175a8550166e6036f00f.zip
Emacs: Add counsel-yank-pop binding
-rw-r--r--tag-emacs/emacs.d/init.org44
1 files changed, 23 insertions, 21 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 5e6b995..afce66b 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -1242,27 +1242,29 @@ replacement for helm so far.
 
 #+BEGIN_SRC emacs-lisp
   (use-package counsel
-  :config (progn
-        (bind-key "M-x" #'counsel-M-x)
-        (bind-key "<apps>" #'counsel-M-x)
-        (bind-key "<menu>" #'counsel-M-x)
-        (bind-key "C-c M-x" #'execute-extended-command)
-        (bind-key "C-x C-f" #'counsel-find-file)
-        (bind-key "C-x b" #'counsel-switch-to-persp-buffer)
-        (defadvice counsel-find-file (after find-file-sudo activate)
-        "Find file as root if necessary."
-        (when (and buffer-file-name
-               (not (file-writable-p buffer-file-name)))
-          (message "File not writable %s" buffer-file-name)
-          (find-alternate-file (concat "/sudo::" buffer-file-name))))
-        (defun counsel-switch-to-persp-buffer (arg)
-        "Forward to `persp-switch-to-buffer'."
-        (interactive "P")
-        (ivy-read (format "Switch to buffer [%s]: " (persp-name persp-curr))
-              (remq nil (mapcar #'buffer-name (persp-buffers persp-curr)))
-              :preselect (buffer-name (other-buffer (current-buffer)))
-              :action #'ivy--switch-buffer-action
-              :keymap ivy-switch-buffer-map))))
+    :config (progn
+              (bind-key "M-x" #'counsel-M-x)
+              (bind-key "<apps>" #'counsel-M-x)
+              (bind-key "<menu>" #'counsel-M-x)
+              (bind-key "C-c M-x" #'execute-extended-command)
+              (bind-key "C-x C-f" #'counsel-find-file)
+              (bind-key "C-x b" #'counsel-switch-to-persp-buffer)
+              (bind-key "M-y" #'counsel-yank-pop)
+              (bind-key "M-y" #'ivy-next-line ivy-minibuffer-map)
+              (defadvice counsel-find-file (after find-file-sudo activate)
+                "Find file as root if necessary."
+                (when (and buffer-file-name
+                           (not (file-writable-p buffer-file-name)))
+                  (message "File not writable %s" buffer-file-name)
+                  (find-alternate-file (concat "/sudo::" buffer-file-name))))
+              (defun counsel-switch-to-persp-buffer (arg)
+                "Forward to `persp-switch-to-buffer'."
+                (interactive "P")
+                (ivy-read (format "Switch to buffer [%s]: " (persp-name persp-curr))
+                          (remq nil (mapcar #'buffer-name (persp-buffers persp-curr)))
+                          :preselect (buffer-name (other-buffer (current-buffer)))
+                          :action #'ivy--switch-buffer-action
+                          :keymap ivy-switch-buffer-map))))
 #+END_SRC