Move from Helm to Ivy/Counsel

This commit is contained in:
Gergely Polonkai 2021-02-18 09:55:30 +01:00
parent ed7d5591b6
commit e6dcae995b
No known key found for this signature in database
GPG Key ID: 2D2885533B869ED4
2 changed files with 94 additions and 112 deletions

View File

@ -1025,22 +1025,6 @@ EDiff and Org-mode files dont play nice together…
(activate-mark)) (activate-mark))
#+END_SRC #+END_SRC
** Make the slash (~/~) key act like ~C-j~ in some Helm views
#+BEGIN_SRC emacs-lisp
(defun gpolonkai/helm-ff-slash-dir-complete ()
"Make forward slash (/) do completion in helm."
(interactive)
(if (and (or
(equal "magit-status" (assoc-default 'name (helm-get-current-source)))
(equal "Find Files" (assoc-default 'name (helm-get-current-source)))
(equal "helm-mode-insert-file" (assoc-default 'name (helm-get-current-source))))
(stringp (helm-get-selection))
(file-directory-p (helm-get-selection)))
(helm-execute-persistent-action)
(insert "/")))
#+END_SRC
** Turn the cursor to purple if Yasnippets TAB function would fire ** Turn the cursor to purple if Yasnippets TAB function would fire
Taken from [[http://pages.sachachua.com/.emacs.d/Sacha.html][Sacha Chuas config]]. Taken from [[http://pages.sachachua.com/.emacs.d/Sacha.html][Sacha Chuas config]].
@ -2347,7 +2331,7 @@ accompanying function will be added to ~mu4e-view-mode-hook~.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package mu4e (use-package mu4e
:after helm :after ivy
:ensure nil :ensure nil
:config :config
(require 'org-mu4e) (require 'org-mu4e)
@ -2401,7 +2385,7 @@ accompanying function will be added to ~mu4e-view-mode-hook~.
(mu4e-refile-folder . "/Private/Drafts")))) (mu4e-refile-folder . "/Private/Drafts"))))
org-mu4e-link-query-in-headers-mode nil) org-mu4e-link-query-in-headers-mode nil)
:custom :custom
(mu4e-completing-read-function 'helm-comp-read) (mu4e-completing-read-function ivy-completing-read)
(mu4e-context-policy 'pick-first) (mu4e-context-policy 'pick-first)
(mu4e-confirm-quit nil) (mu4e-confirm-quit nil)
(mail-user-agent 'sendmail-user-agent) (mail-user-agent 'sendmail-user-agent)
@ -3185,123 +3169,120 @@ See previous versions of the current file.
(require 'company-web-html)) (require 'company-web-html))
#+END_SRC #+END_SRC
* Helm & Co. * Ivy & Co.
** Helm ** Ivy & Counsel
#+BEGIN_SRC emacs-lisp #+begin_src emacs-lisp
(use-package helm (use-package ivy
:init
(require 'helm-config)
:custom
(helm-M-x-fuzzy-match t)
(helm-buffers-fuzzy-matching t)
(helm-recentf-fuzzy-match t)
:config :config
(helm-mode t) (ivy-mode 1)
:bind
(("M-x" . helm-M-x)
:map ctl-x-map
("C-f" . helm-find-files)
("b" . helm-mini)
:map helm-map
("/" . gpolonkai/helm-ff-slash-dir-complete)))
#+END_SRC
** GNU Globals with Helm
#+BEGIN_SRC emacs-lisp
(defun gpolonkai/enable-helm-gtags-mode ()
(helm-gtags-mode t))
(use-package helm-gtags
:custom :custom
(helm-gtags-auto-update t) (ivy-use-virtual-buffers t)
(helm-gtags-ignore-case t) (ivy-count-format "(%d/%d) ")
(helm-gtags-path-style 'relative) (ivy-use-selectable-prompt t))
:hook (use-package counsel
(c-mode . gpolonkai/enable-helm-gtags-mode) :config
(counsel-mode)
:bind :bind
(:map helm-gtags-mode-map (:map company-mode-map
("M-t" . helm-gtags-find-tag) ("C-c j" . counsel-company)
("M-r" . helm-gtags-find-rtag) :map company-active-map
("M-s" . helm-gtags-find-symbol) ("C-c j" . counsel-company)))
("M-g M-p" . helm-gtags-parse-file) #+end_src
("C-c <" . helm-gtags-previous-history)
("C-c >" . helm-gtags-next-history)
("M-," . helm-gtags-pop-stack)))
#+END_SRC
** Ag with Helm ** GNU Globals with Counsel
#+BEGIN_SRC emacs-lisp #+begin_src emacs-lisp
(use-package helm-ag (defun gpolonkai/enable-counsel-gtags-mode ()
(counsel-gtags-mode t))
(use-package counsel-gtags
:custom
(counsel-gtags-auto-update t)
(counsel-gtags-path-style 'relative)
:hook
(c-mode . gpolonkai/enable-counsel-gtags-mode)
:bind
(:map counsel-gtags-mode-map
("M-t" . counsel-gtags-find-definition)
("M-r" . counsel-gtags-find-reference)
("M-s" . counsel-gtags-find-symbol)
("C-c <" . counsel-gtags-go-backward)
("C-c >" . counsel-gtags-go-forward)))
#+end_src
** Ag with Counsel
#+begin_src emacs-lisp
(use-package counsel-ag-popup
:bind :bind
(:map gpolonkai/pers-map (:map gpolonkai/pers-map
("s" . helm-do-ag))) ("s" . counsel-ag-popup)))
#+END_SRC #+end_src
** Projectile with Helm ** Projectile with Counsel
#+BEGIN_SRC emacs-lisp #+begin_src emacs-lisp
(use-package helm-projectile (use-package counsel-projectile
:custom :custom
(projectile-completion-system 'helm) (projectile-completion-system 'ivy)
:config :config
(helm-projectile-on)) (counsel-projectile-mode))
#+END_SRC #+end_src
** FlySpell with Helm ** FlySpell with Ace
#+BEGIN_SRC emacs-lisp #+begin_src emacs-lisp
(use-package helm-flyspell (use-package ace-flyspell
:demand
:bind :bind
(:map flyspell-mode-map (:map flyspell-mode-map
("C-M-i" . helm-flyspell-correct))) ("C-M-i" . ace-flyspell-correct-word)))
#+END_SRC #+end_src
** C Yasnippets with Helm ** C Yasnippets with Ivy
#+BEGIN_SRC emacs-lisp #+begin_src emacs-lisp
(use-package helm-c-yasnippet (use-package ivy-yasnippet
:after :after
yasnippet yasnippet
:demand t
:custom
(helm-yas-space-match-any-greedy t)
:bind :bind
(("C-c y" . helm-yas-complete))) (("C-c y" . ivy-yasnippet)))
#+END_SRC #+end_src
** PyDoc with Helm ** PyDoc with Counsel
#+BEGIN_SRC emacs-lisp #+begin_src emacs-lisp
(use-package helm-pydoc) (use-package counsel-pydoc)
#+END_SRC #+end_src
** BibTex with Helm ** BibTex with Ivy
#+BEGIN_SRC emacs-lisp First, set up ~bibtex-completion~:
(use-package helm-bibtex
#+begin_src emacs-lisp
(use-package bibtex-completion
:after :after
org org
:custom :custom
(bibtex-completion-bibliography (expand-file-name "references.bib" org-directory)) (bibtex-completion-bibliography (expand-file-name "references.bib" org-directory))
(bibtex-completion-library-path (expand-file-name "bibtex-pdfs" org-directory)) (bibtex-completion-library-path (expand-file-name "bibtex-pdfs" org-directory))
(bibtex-completion-pdf-open-function 'org-open-file) (bibtex-completion-pdf-open-function 'org-open-file)
:config (bibtex-completion-notes-path (expand-file-name
(setq bibtex-completion-notes-path (expand-file-name (convert-standard-filename "bibliography/ivy-bibtex-notes")
(convert-standard-filename "bibliography/helm-bibtex-notes") org-directory)))
org-directory))) #+end_src
#+END_SRC
** Access passwords in pass using Helm #+begin_src emacs-lisp
(use-package ivy-bibtex
:after bibtex-completion)
#+end_src
#+BEGIN_SRC emacs-lisp ** Access passwords in pass using Ivy
(use-package helm-pass)
#+END_SRC #+begin_src emacs-lisp
(use-package ivy-pass)
#+end_src
* Mode specific ~use-package~ calls * Mode specific ~use-package~ calls
@ -3637,6 +3618,8 @@ With the new Transient package it will be easier. I just dont know how to us
("M-k" . gpolonkai/undo-buffer-kill) ("M-k" . gpolonkai/undo-buffer-kill)
("C-b" . bury-buffer) ("C-b" . bury-buffer)
("/" . repeat) ("/" . repeat)
("C-f" . counsel-find-file)
("b" . counsel-switch-buffer)
:map isearch-mode-map :map isearch-mode-map
("<C-return>" . isearch-exit-other-end) ("<C-return>" . isearch-exit-other-end)
("<S-return>" . isearch-exit-mark-match) ("<S-return>" . isearch-exit-mark-match)

View File

@ -26,6 +26,7 @@
'(minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt)) '(minibuffer-prompt-properties '(read-only t cursor-intangible t face minibuffer-prompt))
'(package-selected-packages '(package-selected-packages
'(a '(a
ace-flyspell
ace-mc ace-mc
ace-window ace-window
achievements achievements
@ -54,6 +55,11 @@
company-restclient company-restclient
company-shell company-shell
company-web company-web
counsel
counsel-ag-popup
counsel-gtags
counsel-projectile
counsel-pydoc
csharp-mode csharp-mode
csv-mode csv-mode
dash dash
@ -112,25 +118,18 @@
goto-last-change goto-last-change
graphql graphql
graphql-mode graphql-mode
helm
helm-ag
helm-bibtex
helm-c-yasnippet
helm-chrome helm-chrome
helm-core
helm-flyspell
helm-gtags
helm-mu helm-mu
helm-pass
helm-projectile
helm-pydoc
helm-unicode
hl-todo hl-todo
hungarian-holidays hungarian-holidays
hungry-delete hungry-delete
hyde hyde
id-manager id-manager
identica-mode identica-mode
ivy
ivy-bibtex
ivy-pass
ivy-yasnippet
jinja2-mode jinja2-mode
js2-mode js2-mode
json-mode json-mode