# Lookup

To work with notes, Dendron uses lookups. Lookups help you create, find, and organize your notes. You can watch the following video to see some of the things you can do with lookups.

## Notes

### Finding Notes

Below is an example of a simple two level hierarchy with notes on various command line interface commands. Use Cmd+L (we are going to use mac keybindings for this tutorial) to bring up the lookup and try some of the following queries.

- cli.tar
- cli.curl
- cli.dig


### Creating Notes

While we call it the Lookup Bar, you can also use it to create notes that don’t exist. When you lookup for a note that hasn’t been created, Dendron will create it for you.

To try it yourself, bring up the lookup bar. Type dendron.lookup.hello and hit Enter.

#### Creating Special Notes

Dendron has builtin notion for certain types of notes with pre-defined hierarchies. These notes can be created by toggling the corresponding note button on the lookup menu or by using the respective builtin shortcuts.

• values:
• none (default): create a regular note
• journal: create a journal note (cmd/ctrl + shift + s)
• scratch: create a scratch note (cmd/ctrl + shift + j)

### Creating Notes with a Selection

If you have text highlighted while creating a new note with a lookup, the new note will be created using the text selected. How the text will be used depends on the dendron.defaultLookupCreateBehavior setting.

• values:
• selectionExtract (default): create new note with text from the old note. remove text from the old note
• selection2link: create new empty note and turn selection into a link referencing the old note

### Passing Arguments to Lookup

#### filterType

• controls notes shown for lookup
• options:
• directChildOnly: filter all notes that are not the direct children of the current note

#### selectionType

• controls selection modifier
• options
• selectionExtract: selection is extracted to newly created note (default)
• selection2link: selection is turned into a link to newly created note. note path is set to {current-path}.{slug-of-selection}
• a slug is the human readable portion of an url
• you can control this behavior using dendron.linkSelectAutoTitleBehavior
• type: string
• default: slug
• options: [‘none’, ‘slug’]

Control title behavior when using selection2link with lookup

#### noteType

• controls what sort of note is created
• options
• {none}: create a normal note (default)
• journal: create a journal note
• scratch: create a scratch ntoe:

#### splitType

• if set, open note in a new split
• options:
• horizontal: open in horizontal split

#### noConfirm

• if set, select first option from lookup without confirmation
• type: boolean

#### value

• if set, have a custom value for lookup
• type: string

### Passing Arguments Using Keybindings

You can trigger specific lookups using custom key bindings. For example, The following keybinding will trigger lookup set to creating a journal note and turning a selection into a link.

Dendron uses VSCode keybinding functionality to define its own keybindings.

To update your keybindings, open the command prompt and type Open Keyboard Shortcuts.

If you prefer to work with JSON, you can use Open Keyboard Shortcuts (JSON).

# Tips

• Add: Every command in VSCode can be bound to a keybinding, even if it doesn’t have one
• Reset: If you want to go back to a default binding, reset it
• Remove: If you don’t use an existing binding, you can remove it

{
"command": "dendron.lookup",
"key": "cmd+k j",
"args": {
"noteType": "journal",
}
}


### Deleting Notes

To delete dendron.lookup.hello, use the Cmd+Shift+D shortcut on the note that you want to delete. Alternatively, you can also launch the Command Bar and type Dendron: Delete Node

## Schemas

Dendron also provides lookup for schemas . To lookup a schema, use > Dendron: Lookup Schema or the Cmd+Shift+L (Ctrl+Shift+L on windows and linux) shortcut to bring up the schema lookup.

### Finding Schemas

The process for finding schemas using Dendron is the same as that for finding notes. One lookup to rule them all.

### Creating Schemas

Just like with notes, if you enter the name of a schema that does not exist, Dendron will create it for you.

Specifically, Dendron will create {value}.schema.yml in your vault. At this point, you are free to edit the schema. After you’re satisfied with the result, you’ll need to run > Dendron: Reload Index for it to take affect.

• NOTE: if you get an error after running Reload Index, it is most likely because your YAML is malformed. You can paste it in yaml lint to check that you are using the correct yaml syntax.

### Deleting Schemas

The process for deleting schemas using Dendron is identical to deleting notes.

When working with lookup, users can toggle one of the different menu items on the upper right corner.

These menus are divided into 4 categories:

• filter toggle
• selection toggle
• note toggle
• split toggle

### Filter Toggle

By default, unless you are at the root of your workspace, dendron does a fuzzy search of all notes that match your current hierarchy prefix. This is useful to see your entire sub-tree in one glance but can be overwhelming if you have a lot of notes.

Dendron’s directChildFilter is a toggle that limits lookup to just the next level in the tree. This is useful for exploring your hierarchy one level at a time.

### Selection Toggle

If you have text highlighted while creating a new note with a lookup, the new note will be created using the text selected. How the text will be used depends on the dendron.defaultLookupCreateBehavior setting.

• values:
• selectionExtract (default): create new note with text from the old note. remove text from the old note
• selection2link: create new empty note and turn selection into a link referencing the old note

### Note toggle

Dendron has builtin notion for certain types of notes with pre-defined hierarchies. These notes can be created by toggling the corresponding note button on the lookup menu or by using the respective builtin shortcuts.

• values:
• none (default): create a regular note
• journal: create a journal note (cmd/ctrl + shift + s)
• scratch: create a scratch note (cmd/ctrl + shift + j)

### Split toggle

When opening a note via lookup, you can decide to have the note open in a horizontal split.This works when you’re creating new notes or opening an existing note