jgru/consult-org-roam

How to jump to the search result?

Closed this issue · 3 comments

Hello I thik my issue could be trivial but I could not find an answer in the readme.

I'm using consult-org-roam with pretty default config:

(use-package consult-org-roam
   :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 (kbd "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 r" . consult-org-roam-search))

When I'm using consult-org-roam-search, the searching itself works good and I see list of results but can't easily jump to the current highlighted search result.
I have tried <RET>, C-j, M-j but they all produce the same message to the Messages buffer:

Wrong type argument: number-or-marker-p, nil
jgru commented

Hi @weirdvic,

which completion UI do you use? Assuming you are using vertico you can just set vertico-exit to C-j or your preferred keybinding to exit the minibuffer and jump to the candidate.

A possible but minimal configuration is shown below:

;; Minibuffer-Completion UI
(use-package vertico
  ;; Instruct straight to link extensions as well
  :straight  '( vertico  :files (:defaults "extensions/*")
                         :includes (vertico-buffer
                                    vertico-directory
                                    vertico-flat
                                    vertico-indexed
                                    vertico-mouse
                                    vertico-quick
                                    vertico-repeat
                                    vertico-reverse))
  :defer nil
  :bind (:map vertico-map
         ("C-n" . vertico-next)
         ("C-p" . vertico-previous)
         ("C-<return>" . vertico-exit-input)
         ("C-f" . vertico-exit)
         ("M-d" . backward-kill-word))
  :custom
  (vertico-resize nil)
  (vertico-cycle t)
  :init
  (vertico-mode)) 

Best regards,
jgru

Thank you for the fast reply!
I was using fido-mode but now I have upgraded to vertico and it's all working great now.

jgru commented

Good to hear that this solved it for you, @weirdvic!
Have fun using the package!