Add consult / org-roam integration
My custom function to search org-roam notes with ripgrep is not needed anymore, it is nearly the same as consult-org-roam-search provided by this package.
This commit is contained in:
parent
fb66ed6041
commit
33f7045180
1 changed files with 34 additions and 6 deletions
40
init.el
40
init.el
|
@ -672,6 +672,40 @@
|
||||||
:after (org-roam citar)
|
:after (org-roam citar)
|
||||||
:hook (org-roam-mode . org-roam-bibtex-mode))
|
:hook (org-roam-mode . org-roam-bibtex-mode))
|
||||||
|
|
||||||
|
(use-package consult-org-roam
|
||||||
|
:ensure t
|
||||||
|
:after org-roam
|
||||||
|
:init
|
||||||
|
(require 'consult-org-roam)
|
||||||
|
;; Activate the minor mode
|
||||||
|
(consult-org-roam-mode 1)
|
||||||
|
:custom
|
||||||
|
;; Use `ripgrep' for searching with `consult-org-roam-search'
|
||||||
|
(consult-org-roam-grep-func #'consult-ripgrep)
|
||||||
|
;; Configure a custom narrow key for `consult-buffer'
|
||||||
|
(consult-org-roam-buffer-narrow-key ?r)
|
||||||
|
;; Display org-roam buffers right after non-org-roam buffers
|
||||||
|
;; in consult-buffer (and not down at the bottom)
|
||||||
|
(consult-org-roam-buffer-after-buffers t)
|
||||||
|
:config
|
||||||
|
;; Eventually suppress previewing for certain functions
|
||||||
|
(consult-customize
|
||||||
|
consult-org-roam-forward-links
|
||||||
|
:preview-key "M-.")
|
||||||
|
:bind
|
||||||
|
;; Define some convenient keybindings as an addition
|
||||||
|
("C-c n e" . consult-org-roam-file-find)
|
||||||
|
("C-c n b" . consult-org-roam-backlinks)
|
||||||
|
("C-c n B" . consult-org-roam-backlinks-recursive)
|
||||||
|
("C-c n l" . consult-org-roam-forward-links)
|
||||||
|
("C-c n r" . consult-org-roam-search))
|
||||||
|
|
||||||
|
(use-package org-download
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(add-hook 'dired-mode-hook 'org-download-enable)
|
||||||
|
(setq org-download-method 'attach))
|
||||||
|
|
||||||
(use-package org-roam-ui
|
(use-package org-roam-ui
|
||||||
:ensure
|
:ensure
|
||||||
(:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
|
(:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
|
||||||
|
@ -686,12 +720,6 @@
|
||||||
org-roam-ui-update-on-save t
|
org-roam-ui-update-on-save t
|
||||||
org-roam-ui-open-on-start t))
|
org-roam-ui-open-on-start t))
|
||||||
|
|
||||||
(defun dl/org-roam-rg-search ()
|
|
||||||
"Search org-roam directory using 'consult-ripgrep'. With live-preview."
|
|
||||||
(interactive)
|
|
||||||
(let ((consult-ripgrep-command "rg --null --ignore-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
|
|
||||||
(consult-ripgrep org-roam-directory)))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; Programming tools
|
;;; Programming tools
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue