Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to use company/corfu with denote? #508

Open
maikol-solis opened this issue Dec 30, 2024 · 2 comments
Open

Is there a way to use company/corfu with denote? #508

maikol-solis opened this issue Dec 30, 2024 · 2 comments

Comments

@maikol-solis
Copy link
Contributor

One thing that I really miss from org-roam, it's the completion-at-point function. So, if I want to insert a link about “Clouds”, I just type the word, select my note and the capf insert the link.

With denote, I always need to pass for denote-insert-link which it is a little cumbersome after a while (even with keybindings).

Any suggestion is appreciated.

Best.

@protesilaos
Copy link
Owner

protesilaos commented Dec 31, 2024 via email

@maikol-solis
Copy link
Contributor Author

Hi Prot,

My idea is simple: org-roam has an option called org-roam-completion-everywhere which triggers these functions

https://github.com/org-roam/org-roam/blob/2a630476b3d49d7106f582e7f62b515c62430714/org-roam-node.el#L799

https://github.com/org-roam/org-roam/blob/2a630476b3d49d7106f582e7f62b515c62430714/org-roam-node.el#L782

My idea is simply to have a nicer UI to insert links where the user only needs to type a few letters and a company/corfu completes the rest of the link.

Screen.Recording.2025-01-02.at.07.20.29.mov

In this example, I did this:

  1. Have (setq org-roam-completion-everywhere t), corfu/cape installed, and this on my config
(after! org-roam-mode
  (defun cape-roam ()
    (cape-wrap-super #'cape-dict #'org-roam-complete-everywhere #'org-roam-complete-link-at-point))

  (add-hook!
   org-roam-mode
   (add-hook  'completion-at-point-functions #'cape-roam -50)))
  1. I'm using doom with org-roam activated, so this is why the roam links are converted to regular links.
  2. Inserted the word “Machine”.
  3. I chose one of my notes.
  4. The roam link became regular after I saved the buffer.

I hope this helps to understand better the feature.

Best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants