Add more counsel keybindings and enable wgrep in ivy-occur buffers

This commit is contained in:
Jeremy Dormitzer 2020-05-01 11:53:58 -04:00
parent 87f5b13b0b
commit 11c350bc2a

View File

@ -4400,6 +4400,12 @@ An Emacs interface to MPD, the Music Player Daemon
(general-def mpc-mode-map "a" #'mpc-playlist-add)
#+END_SRC
* wgrep
#+BEGIN_SRC emacs-lisp
(use-package wgrep
:defer t)
#+END_SRC
* Ivy
An alternative minibuffer completion framework:
#+BEGIN_SRC emacs-lisp
@ -4407,15 +4413,17 @@ An alternative minibuffer completion framework:
:defer 0
:config
(ivy-mode 1)
(counsel-mode 1)
(setq ivy-height 20
ivy-wrap t
ivy-use-virtual-buffers nil
ivy-count-format "%d/%d ")
ivy-wrap t
ivy-use-virtual-buffers nil
ivy-count-format "%d/%d ")
(with-eval-after-load 'projectile
(setq projectile-completion-system 'ivy))
(leader-def-key "SPC" #'counsel-M-x)
(jdormit/define-prefix "i" "ivy")
(jdormit/define-prefix "iU" "ui")
(leader-def-key "ir" #'ivy-resume)
(leader-def-key "ip" #'counsel-yank-pop)
(leader-def-key "iu" #'counsel-unicode-char)
(leader-def-key "iUt" #'counsel-load-theme)
@ -4426,15 +4434,15 @@ An alternative minibuffer completion framework:
(leader-def-key "bb" #'counsel-ibuffer)
(if (executable-find "rg")
(leader-def-key "ig" #'counsel-rg)
(leader-def-key "ig" #'counsel-rg)
(leader-def-key "ig" #'counsel-grep))
(defvar counsel-set-frame-font-history nil)
(defun counsel-set-frame-font (font)
(interactive (list (ivy-read "Font: " (delete-dups (font-family-list))
:require-match t
:history 'counsel-set-frame-font-history
:caller 'counsel-set-frame-font)))
:require-match t
:history 'counsel-set-frame-font-history
:caller 'counsel-set-frame-font)))
(set-frame-font font))
(leader-def-key "iUf" #'counsel-set-frame-font)
@ -4448,11 +4456,12 @@ An alternative minibuffer completion framework:
(defun find-file-default (filename &optional wildcards)
(interactive
(let ((completing-read-function 'completing-read-default))
(find-file-read-args "Find file: "
(confirm-nonexistent-file-or-buffer))))
(find-file-read-args "Find file: "
(confirm-nonexistent-file-or-buffer))))
(funcall-interactively 'find-file filename wildcards))
:general
("C-c C-r" #'ivy-resume)
("M-x" #'counsel-M-x)
("C-x C-f" #'counsel-find-file)
("C-M-u" #'counsel-unicode-char)
@ -4467,20 +4476,21 @@ An alternative minibuffer completion framework:
(use-package counsel-projectile
:after (counsel projectile)
:commands (counsel-projectile
counsel-projectile-switch-project
counsel-projectile-find-file
counsel-projectile-grep)
counsel-projectile-switch-project
counsel-projectile-find-file
counsel-projectile-grep)
:init
(counsel-projectile-mode)
(leader-def-key "pp" #'counsel-projectile-switch-project)
(leader-def-key "pf" #'counsel-projectile)
(if (executable-find "rg")
(leader-def-key "pg" #'counsel-projectile-rg)
(leader-def-key "pg" #'counsel-projectile-rg)
(leader-def-key "pg" #'counsel-projectile-grep)))
(use-package lsp-ivy
:after (ivy lsp)
:commands (lsp-ivy-workspace-symbol
lsp-ivy-global-workspace-symbol))
lsp-ivy-global-workspace-symbol))
(leader-def-key "cs" #'lsp-ivy-workspace-symbol)
#+END_SRC