diff options
-rw-r--r-- | tag-emacs/emacs.d/init.org | 44 |
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 |