# Create new org-roam node ignoring pre selected existing nodes

**URL:** <https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448>\
**Category:** Troubleshooting\
**Created:** [February 12, 2022, 12:51pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448 "2022-02-12T12:51:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![2mEuFY0iakxhveQ31](https://avatars.discourse-cdn.com/v4/letter/2/a4c791/32.png) [@2mEuFY0iakxhveQ31](https://org-roam.discourse.group/u/2mEuFY0iakxhveQ31)\
**Post date:** [February 12, 2022, 12:51pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448/1 "2022-02-12T12:51:25Z")

</div>

I am not sure if this is org-roam related or if it is about ivy or counsel or something else.  
At the bottom you find a minimal `init.el` and a screen recording illustrating the problem.

I am using Emacs27 on Debian 11; usually with evil, ivy, counsel, org-roam.

`C-c n f` is bind to `org-roam-node-find` in my setup.  
A search field (ivy?) and a search result list comes up.

I can search existing nodes or create a new one if it does not exist yet. Assume that there still is a node with the title `Foobar in summer` and I want to create a new node with title `summer`.

This is not possible because when I type `summer` (after `C-c n f`) the existing node `Foobar in summer` is pre selected in the search list. When I hit `ENTER` (or `TAB`) the existing node opens in a new buffer instead of a new created node (capture buffer?) with title `summer`.

How can I create a new node preventing pre selection of existing nodes.

I illustrated the problem with a GIF-recording  
 ![C-c_n_f_preselect_problem](https://global.discourse-cdn.com/free1/uploads/orgroam/original/2X/d/da20fdb66cd9f6136e3a5ba964c46013e02369fc.gif)

The used (minimal) `init.el` for that recording

```auto
;; -*- lexical-binding: t; -*-

;; === Package setup ===
(require 'package)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
			 ("org" . "https://orgmode.org/elpa/")
			 ("elpa" . "https://elpa.gnu.org/packages/")))
;; Initializes the package infrastructure
(package-initialize)

;; === use-package ==
;; use-package to simplify the config file
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(require 'use-package)
(setq use-package-always-ensure 't)

;; === Improved search field
; M-o opens "context menu" of a search item
(use-package ivy
  :diminish
  :bind (("C-s" . swiper))
  :config
  (ivy-mode 1))

;; === Add docstring column to function search results
(use-package ivy-rich
    :init
    (ivy-rich-mode 1))

(use-package org-roam
  :init ; is called before the package is loaded
  (setq org-roam-v2-ack t) ; do not show migration warning after startup
  :custom
  (org-roam-directory "~/tab-cloud/my.org-roam")
  :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)
	 )
  :config
  (org-roam-db-autosync-mode)
  )

```

Sidenode: There is an open issue (from me) in the [ivy repo](https://github.com/abo-abo/swiper/issues/2956).

---

<div class="post-metadata">

**Author:** ![Jousimies](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@Jousimies](https://org-roam.discourse.group/u/Jousimies)\
**Post date:** [February 12, 2022, 1:40pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448/2 "2022-02-12T13:40:48Z")

</div>

press up arrow, move cursor up one line in minibuffer. Then you can create a new one.

---

<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:** [February 12, 2022, 2:27pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448/3 "2022-02-12T14:27:48Z")

</div>

Yes. It’s an Ivy quark. If what @Jousimies does not work, see this FAQ section in Ivy [README](https://github.com/abo-abo/swiper#frequently-asked-questions).

> Q: How do I enter an input that matches one of the candidates instead of this candidate? Example: create a file `bar` when a file `barricade` exists in the current directory.

> A: Press C-M-j. Alternatively, you can make the prompt line selectable with `(setq ivy-use-selectable-prompt t)` .

---

<div class="post-metadata">

**Author:** ![2mEuFY0iakxhveQ31](https://avatars.discourse-cdn.com/v4/letter/2/a4c791/32.png) [@2mEuFY0iakxhveQ31](https://org-roam.discourse.group/u/2mEuFY0iakxhveQ31)\
**Post date:** [February 12, 2022, 3:30pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448/4 "2022-02-12T15:30:14Z")

</div>

> press up arrow, move cursor up one line in minibuffer. Then you can create a new one.  
> Have you tested that with my minimal working example? It does not work for me. But maybe I misunderstand you.

---

<div class="post-metadata">

**Author:** ![suliveevil](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@suliveevil](https://org-roam.discourse.group/u/suliveevil)\
**Post date:** [December 23, 2022, 2:36pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448/5 "2022-12-23T14:36:49Z")

</div>

Is this a workaround, or there are better solutions?

`C-M-j` is `default-indent-new-line` on my device.

EDIT:

I find the correct way to do it:

```auto
vertico: vertico-exit-input
ivy: ivy-immediate-done

```

---

<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:** [December 23, 2022, 4:03pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448/6 "2022-12-23T16:03:49Z")

</div>

It’s good that you are thorough. Thanks for following up.

It’s the same solution for Ivy.  
This [line of code](https://github.com/abo-abo/swiper/blob/master/ivy.el#L318):

```auto
(ivy-define-key map (kbd "C-M-j") 'ivy-immediate-done)

```

For the record, the above comes directly from [Ivy’s README](https://github.com/abo-abo/swiper#frequently-asked-questions).

> [@suliveevil](#):
>
> `C-M-j` is `default-indent-new-line` on my device.

Yeah, I have no doubt. I think this is not for your minibuffer, though, is it? Then it’s not relevant.

---

<div class="post-metadata">

**Author:** ![suliveevil](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@suliveevil](https://org-roam.discourse.group/u/suliveevil)\
**Post date:** [December 23, 2022, 4:27pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448/7 "2022-12-23T16:27:29Z")

</div>

😆 We have different packages and keybindings for the same function.

---

<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:** [December 23, 2022, 6:04pm UTC](https://org-roam.discourse.group/t/create-new-org-roam-node-ignoring-pre-selected-existing-nodes/2448/8 "2022-12-23T18:04:13Z")

</div>

Well, I don’t use Ivy any more. I am referencing the default from the package and its official documentation.
