# Fuzzy completion-at-point

**URL:** <https://org-roam.discourse.group/t/fuzzy-completion-at-point/1715>\
**Category:** Troubleshooting\
**Created:** [July 1, 2021, 3:57pm UTC](https://org-roam.discourse.group/t/fuzzy-completion-at-point/1715 "2021-07-01T15:57:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rberaldo](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/rberaldo/32/819_2.png) [@rberaldo](https://org-roam.discourse.group/u/rberaldo)\
**Post date:** [July 1, 2021, 3:57pm UTC](https://org-roam.discourse.group/t/fuzzy-completion-at-point/1715/1 "2021-07-01T15:57:26Z")

</div>

I have just set up completion in v2 following the instructions here on the forums and by reading the v2 docs.

However, completion is still a little finicky. Here’s two things I can’t get working:

1. When I type `[[`, I expected to see a list of all files but completion doesn’t do anything unless I type at least two or three characters.
2. I have many files starting with an emoji or special symbols, such as `🛖 PhD.org` and `@author0000.org` for hub notes and literature review notes respectively. I don’t want to need to input either symbol or emoji before I can get a match. Is there a way to enable fuzzy matching with company-mode?

Related to (2), sometimes I don’t remember the word in the beginning of a note but something in the middle, which means fuzzy matching would help in those cases as well.

Here’s my current setup function:

```auto
;; org-roam V2 testing, load manually
(defun my/org-roam-load ()
  (interactive)
  (add-to-list 'load-path "/Users/rberaldo/.emacs.d/org-roam-v2/")
  (load-library "org-roam")
  (setq org-roam-directory (file-truename "/Users/rberaldo/org-roam/"))
  (setq org-roam-file-extensions '("org"))
  (org-roam-setup)
  (define-key global-map (kbd "C-c r /") #'org-roam-node-find)
  (define-key global-map (kbd "C-c r c") #'org-roam-capture)
  (define-key global-map (kbd "C-c r i") #'org-roam-node-insert)
  (define-key global-map (kbd "C-c r r") #'org-roam-buffer-toggle)
  (define-key global-map (kbd "C-c r j") #'org-roam-dailies-capture-today)
  (smartparens-global-mode t)
  (add-hook 'after-init-hook 'global-company-mode)
  (setq company-minimum-prefix-length 2)
  (setq company-idle-delay 0.25)
  (add-to-list 'company-backends 'company-capf)
  (setq org-roam-completion-ignore-case t))

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [July 1, 2021, 9:11pm UTC](https://org-roam.discourse.group/t/fuzzy-completion-at-point/1715/2 "2021-07-01T21:11:47Z")

</div>

For issue 1, have a look at this in your config.

> [@rberaldo](#):
>
> `(setq company-minimum-prefix-length 2)`

For issue 2, it’s probably a matter of completion-style. I suggest to consider a package called Orderless — not in front of PC but it’s available on MELPA and good documentation in its GitHub repo.

---

<div class="post-metadata">

**Author:** ![rberaldo](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/rberaldo/32/819_2.png) [@rberaldo](https://org-roam.discourse.group/u/rberaldo)\
**Post date:** [July 1, 2021, 10:56pm UTC](https://org-roam.discourse.group/t/fuzzy-completion-at-point/1715/3 "2021-07-01T22:56:16Z")

</div>

> [@nobiot](#):
>
> For issue 1, have a look at this in your config.
> 
> > [@rberaldo](#):
> >
> > `(setq company-minimum-prefix-length 2)`

That’s what you get for copying config without thinking about it. 🤦‍♂️ Thanks, @nobiot!

I’ll have a look at that package, sounds like what I need.

---

<div class="post-metadata">

**Author:** ![rberaldo](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/rberaldo/32/819_2.png) [@rberaldo](https://org-roam.discourse.group/u/rberaldo)\
**Post date:** [July 2, 2021, 3:52am UTC](https://org-roam.discourse.group/t/fuzzy-completion-at-point/1715/4 "2021-07-02T03:52:47Z")

</div>

I just wanted to follow up on this answer. Your suggestion was _perfect_. I feel now I can fully migrate from Obsidian – the only thing missing is the graph visualization, but hopefully that’s coming soon. Thank you!
