I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.7 KiB

  1. #+TITLE: Ivy
  2. #+AUTHOR: Christopher James Hayward
  3. #+EMAIL: chris@chrishayward.xyz
  4. #+PROPERTY: header-args:emacs-lisp :tangle ivy.el :comments org
  5. #+PROPERTY: header-args:shell :tangle no
  6. #+PROPERTY: header-args :results silent :eval no-export :comments org
  7. #+OPTIONS: num:nil toc:nil todo:nil tasks:nil tags:nil
  8. #+OPTIONS: skip:nil author:nil email:nil creator:nil timestamp:nil
  9. Bring Emacs out of the eighties.
  10. * Config
  11. There's a lot of occasions where Emacs asks you to input text to match a file name in a directory, or of a potential buffer selection. The family of packages ~ivy/swiper~[fn:1] work together toward this common goal of improving the default completion menu system.
  12. #+begin_src emacs-lisp
  13. (use-package ivy
  14. :diminish
  15. :config (ivy-mode 1))
  16. #+end_src
  17. ** Replacements
  18. Include ~counsel~[fn:2], a customized set of commands to replace the built-in completion buffers. This will provide an experience similar to what you've maybe experienced on ~doom~ or ~spacemacs~.
  19. #+begin_src emacs-lisp
  20. (use-package counsel
  21. :after ivy
  22. :custom (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
  23. :config (counsel-mode 1))
  24. #+end_src
  25. ** Additional details
  26. Provide more information about each item in the completion menu with ~ivy-rich~[fn:3]. This will include snippets from any available documentation, or active buffers.
  27. #+begin_src emacs-lisp
  28. (use-package ivy-rich
  29. :after counsel
  30. :init (ivy-rich-mode 1))
  31. #+end_src
  32. ** Popup selection frame
  33. Display ~ivy~[fn:1] completions in a popup buffer with the ~ivy-posframe~[fn:4] package. I prefer to use this since the menu appears in the center of my screen, stopping my from having to tilt my head to look down at the default completion menu appearing in the mini-buffer.
  34. #+begin_src emacs-lisp
  35. (use-package ivy-posframe
  36. :after ivy
  37. :when (window-system)
  38. :custom (ivy-posframe-display-functions-alist '((t . ivy-posframe-display)))
  39. (ivy-posframe-parameters '((parent-frame nil)))
  40. :config (ivy-posframe-mode 1))
  41. #+end_src
  42. ** Candidate selection sorting
  43. Sort completion candidates based on how recently or frequently they're selected with ~prescient.el~[fn:5]. This can be helpful when using =M-x= to run commands that aren't bound to specific key-strokes.
  44. #+begin_src emacs-lisp
  45. (use-package ivy-prescient
  46. :after counsel
  47. :custom (ivy-prescient-enable-filtering nil)
  48. :config (prescient-persist-mode 1)
  49. (ivy-prescient-mode 1))
  50. #+end_src
  51. * Footnotes
  52. [fn:1] https://github.com/abo-abo/swiper
  53. [fn:2] https://libraries.io/emacs/counsel
  54. [fn:3] https://github.com/Yevgnen/ivy-rich
  55. [fn:4] https://github.com/tumashu/ivy-posframe
  56. [fn:5] https://github.com/raxod502/prescient.el