Browse Source

Switched to vertico & co

master
Marc 1 year ago
parent
commit
b2414007d9
1 changed files with 65 additions and 66 deletions
  1. 131
      config.org

131
config.org

@ -569,48 +569,27 @@ Exclude some dirs from spamming recentf
"q" '(imenu-list-quit-window :which-key "quit")) "q" '(imenu-list-quit-window :which-key "quit"))
#+END_SRC #+END_SRC
* Selectrum & Co.
Uses default features of emacs instead of bringing a new framework in like helm or counsel
* Vertico & Orderless
Vertico is a completion ui.
Orderless orders the suggestions by recency. The package prescient orders by frequency.
[[https://github.com/minad/vertico][Vertico Github]]
[[https://github.com/oantolin/orderless][Orderless Github]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; either selectrum or vertico
(use-package selectrum
:ensure t
:config
(selectrum-mode)
)
;; as of 2021-10-29 debian emacs 27.1 seems to cause error
;; error in post-command-hook (vertico--exhibit): (wrong-type-argument .....)
;; see https://github.com/minad/vertico/issues/41
;(use-package vertico
; :ensure t
; :init
; (vertico-mode))
;; completion ui
(use-package vertico
:init
(vertico-mode))
;; orderless orders by recency
;; prescient orders by frequency
;; both combined order by frecency (most recent first, then by frequency, then by length)
(use-package orderless (use-package orderless
:ensure t
:config
;; optional performance optimizaion
;; by highlighting only visible candidates
(setq orderless-skip-highlighting (lambda () selectrum-is-active)
selectrum-highlight-candidates-function #'orderless-highlight-matches
:init
(setq completion-styles '(orderless basic)
completion-category-defaults nil completion-category-defaults nil
completion-category-overrides '((file (styles . (partial-completion)))))
:custom
(completion-styles '(orderless))
)
(use-package selectrum-prescient
:ensure t
:config
(setq selectrum-prescient-enable-filtering nil) ; only if used with orderless
(selectrum-prescient-mode)
(prescient-persist-mode)
)
completion-category-overrides '((file (styles partial-completion)))))
#+end_src
* Consult
[[https://github.com/minad/consult][Github]]
#+begin_src emacs-lisp
(use-package consult (use-package consult
:ensure t :ensure t
:bind :bind
@ -627,22 +606,29 @@ Uses default features of emacs instead of bringing a new framework in like helm
consult-ripgrep consult-git-grep consult-grep consult-ripgrep consult-git-grep consult-grep
consult-bookmark consult-recent-file consult-xref consult-bookmark consult-recent-file consult-xref
consult--source-file consult--source-project-file consult--source-bookmark consult--source-file consult--source-project-file consult--source-bookmark
:preview-key (kbd "M-."))
)
;; shows descriptions in M-x
:preview-key (kbd "M-.")))
#+end_src
* Marginalia
[[https://github.com/minad/marginalia/][Github]]
Adds additional information to the minibuffer
#+begin_src emacs-lisp
(use-package marginalia (use-package marginalia
:ensure t :ensure t
:config
:init
(marginalia-mode) (marginalia-mode)
:bind
(:map minibuffer-local-map
("M-A" . marginalia-cycle))
:custom :custom
;; switch by 'marginalia-cycle ;; switch by 'marginalia-cycle
(marginalia-annotators '(marginalia-annotators-heavy (marginalia-annotators '(marginalia-annotators-heavy
marginalia-annotators-light marginalia-annotators-light
nil))
)
nil)))
#+end_src
;; do stuff on minibuffer results
* Embark
Does stuff in the minibuffer results
#+begin_src emacs-lisp
(use-package embark (use-package embark
:ensure t :ensure t
:bind :bind
@ -651,29 +637,11 @@ Uses default features of emacs instead of bringing a new framework in like helm
:init :init
(setq prefix-help-command #'embark-prefix-help-command) (setq prefix-help-command #'embark-prefix-help-command)
:config :config
;; for selectrum
;; (defun current-candidate+category ()
;; (when selectrum-is-active
;; (cons (selectrum--get-meta 'category)
;; (selectrum-get-current-candidate))))
;; (add-hook 'embark-target-finders #'current-candidate+category)
;; (defun current-candidates+category ()
;; (when selectrum-is-active
;; (cons (selectrum--get-meta 'category)
;; (selectrum-get-current-candidates
;; ;; pass relative file names for dired.
;; minibuffer-completing-file-name))))
;; (add-hook 'embark-candidate-collectors #'current-candidates+category)
;; ;; no unnecessary computation delay after injection.
;; (add-hook 'embark-setup-hook 'selectrum-set-selected-candidate)
;; hide modeline of the embark live/completions buffers ;; hide modeline of the embark live/completions buffers
(add-to-list 'display-buffer-alist (add-to-list 'display-buffer-alist
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
nil nil
(window-parameters (mode-line-format . none))))
)
(window-parameters (mode-line-format . none)))))
(use-package embark-consult (use-package embark-consult
:ensure t :ensure t
@ -685,7 +653,7 @@ Uses default features of emacs instead of bringing a new framework in like helm
* Helm * Helm
As an alternative if I'm not happy with selectrum & co As an alternative if I'm not happy with selectrum & co
#+begin_src emacs-lisp
begin_src emacs-lisp
(use-package helm (use-package helm
:ensure t :ensure t
:hook :hook
@ -707,7 +675,7 @@ As an alternative if I'm not happy with selectrum & co
(helm-autoresize-max-height 20) (helm-autoresize-max-height 20)
(helm-autoresize-min-height 5) (helm-autoresize-min-height 5)
) )
#+end_src
end_src
* ivy / counsel / swiper * ivy / counsel / swiper
:PROPERTIES: :PROPERTIES:
@ -1074,6 +1042,8 @@ Customize the org agenda
** *TODO* ** *TODO*
org-super-agenda org-super-agenda
[[https://github.com/alphapapa/org-ql][org-ql]]
[[https://github.com/nobiot/org-transclusion][org-transclusion]]?
** org-caldav ** org-caldav
:PROPERTIES: :PROPERTIES:
@ -1096,6 +1066,7 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden
:END: :END:
[[https://github.com/bastibe/org-journal][Source]] [[https://github.com/bastibe/org-journal][Source]]
Ggf. durch org-roam-journal ersetzen
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package org-journal (use-package org-journal
:if *sys/linux* :if *sys/linux*
@ -1109,6 +1080,34 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden
org-journal-enable-agenda-integration t))) org-journal-enable-agenda-integration t)))
#+END_SRC #+END_SRC
** org-roam
Um Headings innerhalb einer Datei zu verlinken:
- org-id-get-create im Heading,
- org-roam-node-insert in der verweisenden Datei
#+BEGIN_SRC emacs-lisp
(use-package org-roam
:ensure t
:init
(setq org-roam-v2-ack t)
:custom
(org-roam-directory "~/RoamNotes")
(org-roam-completion-everywhere t)
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert)
:map org-mode-map
("C-M-i" . completion-at-point)
:map org-roam-dailies-map
("Y" . org-roam-dailies-capture-yesterday)
("T" . org-roam-dailies-capture-tomorrow))
:bind-keymap
("C-c n d" . org-roam-dailies-map)
:config
(require 'org-roam-dailies) ;; ensure the keymap is available
(org-roam-db-autosync-mode))
#+END_SRC
* Programming * Programming
** misc ** misc
#+begin_src emacs-lisp #+begin_src emacs-lisp

Loading…
Cancel
Save