Add Consult and Embark

main
Sergio Alvariño 3 years ago
parent dabd44db58
commit 2adf6069f1

@ -1,12 +1,3 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keep emacs clean!
;; Change the user-emacs-directory to keep unwanted things out of ~/.emacs.d
(setq user-emacs-directory (expand-file-name "~/.cache/emacs/")
url-history-file (expand-file-name "url/history" user-emacs-directory))
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; set up straight package manager
(defvar bootstrap-version)
@ -25,6 +16,16 @@
(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keep emacs clean!
;; Change the user-emacs-directory to keep unwanted things out of ~/.emacs.d
(setq user-emacs-directory (expand-file-name "~/.cache/emacs/")
url-history-file (expand-file-name "url/history" user-emacs-directory))
;; Use no-littering to automatically set common paths to the new user-emacs-directory
;; (use-package no-littering)
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Install org-mode
(straight-use-package 'org)
@ -44,11 +45,10 @@
;; (org-babel-load-file (f))))
;; Load configuration
;; Load myconfig.el unless there are changes in myconfig.org
(let ((config-el (expand-file-name "myconfig.el" user-emacs-directory))
(config-org (expand-file-name "myconfig.org" user-emacs-directory)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Load myconfig file.
(let ((config-el (expand-file-name "~/.emacs.d/myconfig.el"))
(config-org (expand-file-name "~/.emacs.d/myconfig.org")))
(if (and (file-exists-p config-el)
(time-less-p (file-attribute-modification-time (file-attributes config-org))
(file-attribute-modification-time (file-attributes config-el))))

@ -109,6 +109,12 @@
(define-key own-map (kbd "e") 'aya-expand)
#+end_src
** General (a new binding system)
Have a look at [[https://github.com/noctuid/general.el#key-features][doc]]
#+begin_src emacs-lisp
;; (use-package general)
#+end_src
** Syntax highlight
Set maximum colors
#+begin_src emacs-lisp
@ -137,7 +143,7 @@
)
#+end_src
* which-key
** which-key
Some help with composed hotkeys
#+begin_src emacs-lisp
(use-package which-key
@ -148,7 +154,7 @@
)
#+end_src
* ace-windows
** ace-windows
To jump to different windows easily
#+begin_src emacs-lisp
(use-package ace-window
@ -160,6 +166,14 @@
)
#+end_src
** PCRE2el
Perl Compatible Regexes
#+begin_src emacs-lisp
(use-package pcre2el
:config
(pcre-mode +1))
#+end_src
* Completion systems
** Selectrum
#+begin_src emacs-lisp
@ -215,12 +229,59 @@
)
#+end_src
* Consult and Embark
Consult is a collection of programs using emacs =completing-read=
You must read [[https://github.com/minad/consult][the doc]]!
#+begin_src emacs_lisp
#+begin_src emacs-lisp
(use-package consult
:bind
("C-c h" . consult-history)
("C-c m" . consult-mode-command)
("C-c k" . consult-kmacro)
;; C-x bindings (ctl-x-map)
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
)
#+end_src
** Embark
[[https://github.com/oantolin/embark][The doc]]
#+begin_src emacs-lisp
(use-package embark
:bind
(("C-." . embark-act) ;; pick some comfortable binding
("C-;" . embark-dwim) ;; good alternative: M-.
("C-h B" . embark-bindings)) ;; alternative for `describe-bindings'
:init
;; Optionally replace the key help with a completing-read interface
(setq prefix-help-command #'embark-prefix-help-command)
:config
;; Hide the mode line of the Embark live/completions buffers
(add-to-list 'display-buffer-alist
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
nil
(window-parameters (mode-line-format . none))))
)
;; Consult users will also want the embark-consult package.
(use-package embark-consult
:after (embark consult)
:demand t ; only necessary if you have the hook below
;; if you want to have consult previews as you move around an
;; auto-updating embark collect buffer
:hook
(embark-collect-mode . consult-preview-at-point-mode))
#+end_src
* next
#+begin_src emacs-lisp
#+end_src
* ivy - counsel - swipper
An enhanced incremental search and a lot of features from counsel

Loading…
Cancel
Save