List of commands

Inkdrop provides a bunch of commands to allow you to associate arbitrary interactions with the features. You can bind them with keystrokes, menu and context menu from plugins, the init file or keymap config file. Note that some commands like core:open-note require parameters so you have to invoke them programmatically with CommandRegistry like so:

inkdrop.commands.dispatch(document.body, 'core:open-note', {
  noteId: 'note:uugSvPq5r'
})

Table of Contents


Application commands

Special commands that run in the main process to control the Inkdrop app. To invoke them, do like so:

import { ipcRenderer } from 'electron'
ipcRenderer.send('command', 'application:about', {})

application:about

Shows a dialog about Inkdrop.

application:bring-all-windows-to-frontmacOS only

Arranges windows listed in the Window menu in front of all other windows.

application:check-for-update

Checks for available app updates.

application:cycle-through-windowsmacOS only

Cycles through open Inkdrop windows.

application:hidemacOS only

Hides Inkdrop windows.

application:hide-other-applicationsmacOS only

Hides all apps, except Inkdrop.

application:inspect

Shows a Developer Tools and inspects an element.

application:logout

Logs out from the currently authenticated account.

application:minimizemacOS only

Minimizes Inkdrop application.

application:open-preferences

Opens up the preference window.

application:open-website

Opens up the Inkdrop website.

application:open-website-signup

Opens up the Inkdrop sign-up page.

application:quit

Quits the app.

application:report-issue

Opens up the Inkdrop forum.

application:show-credits

Opens up the list of software licenses.

application:unhide-all-applicationsmacOS only

Unhides all apps, including Inkdrop.

application:view-help

Opens up the user manual.

application:view-api-doc

Opens up the API documentation website.

application:zoommacOS only

Toggles the size and location of the window between its standard state and its user state.

application:sync-db

Perform data sync from the last checkpointer.

application:quick-note

Create a note and show it in a separate window.


Core commands

core:activate-packagein body

Activates the named package.

    Arguments
  • Name
    name
    Type
    string
    Required
    Description

    The package name.

core:activate-themesin body

Re-applies the currently selected UI and syntax themes.

core:choose-templatein body

Opens the template picker to apply a template to the current note. Only available when the editing note is empty and is not in Templates or Trash.

core:copyin body

Copy the selected text to clipboard.

core:copy-imagein body

Copy the target element's image to clipboard.

Copy links to notes as Markdown links. By default, copy currently selected on the note list.

    Arguments
  • Name
    noteId
    Type
    string|array
    Description

    (Optional) The ID(s) of the note(s) to process.

core:copy-note-uriin body

Copy inkdrop:// URIs to notes. By default, copy currently selected on the note list.

    Arguments
  • Name
    noteId
    Type
    string|array
    Description

    (Optional) The ID(s) of the note(s) to process.

Copy the link address of an <a> element under the event target in the preview pane.

core:copy-preview-selectionin body

Copy the currently selected text in the preview pane to the clipboard.

core:copy-note-idin body

Copies the IDs of the selected notes to the clipboard, one per line.

    Arguments
  • Name
    noteId
    Type
    string | string[]
    Description

    The note ID(s) to copy. Defaults to the notes selected on the note list bar.

core:copy-notebook-idin body

Copies a notebook ID to the clipboard.

    Arguments
  • Name
    bookId
    Type
    string
    Description

    The notebook ID to copy. Defaults to the target element's data-bookid, then to the notebook targeted by the context menu.

core:copy-tag-idin body

Copies a tag ID to the clipboard.

    Arguments
  • Name
    tagId
    Type
    string
    Description

    The tag ID to copy. Defaults to the target element's data-tagid, then to the tag targeted by the context menu.

core:cutin body

Delete the selected text and copy it to clipboard.

core:deactivate-packagein body

Deactivates the named package, if it is active.

    Arguments
  • Name
    name
    Type
    string
    Required
    Description

    The package name.

core:delete-notein body

Move notes currently selected on the note list to trash. If the notes are already in trash, they will be permanently deleted.

core:delete-notebook

core:delete-tag

core:duplicate-notein body

Duplicates notes currently selected on the note list.

core:emphasizein .cm-editor

Emphasize currently selected text.

core:empty-trashin body

Empties trash.

core:filter-notesin body

Filters current note list items with given keywords.

    Arguments
  • Name
    keyword
    Type
    string
    Required
    Description

    The keywords to filter.

core:filter-by-tagin body

Adds a filter condition with specified tag.

    Arguments
  • Name
    tagId
    Type
    string
    Required
    Description

    The ID of the tag to filter by.

core:findin body

Activates the search bar.

core:find-focusin body

Moves focus to the search bar.

core:find-clearin body

Clears the search bar text.

core:find-globalin body

Moves focus to the search bar and switch the search scope to global.

    Arguments
  • Name
    focus
    Type
    boolean
    Description

    Whether to move focus to the search bar. Default: true.

core:focus-nextin body

Moves focus to the next focusable UI component.

core:focus-note-list-barin body

Moves focus to the note list bar.

core:focus-previousin body

Moves focus to the previous focusable UI component.

core:indentin .cm-editor

Indents the selected line(s).

core:insert-code-blockin .cm-editor

Inserts a code block.

core:insert-horizontal-rulein .cm-editor

Inserts a horizontal rule: * * *.

Inserts a link.

core:insert-imagein .cm-editor

Shows a file picker and inserts the selected image into the editor at the cursor position.

core:move-notebook

core:move-to-notebook

core:navigatein body

Moves through the note open history in the given direction. Dispatches core:navigate-back or core:navigate-forward accordingly.

    Arguments
  • Name
    direction
    Type
    string
    Required
    Description

    Either "back" or "forward". Default: "back"

core:navigate-backin body

Moves backward through the note open history.

core:navigate-forwardin body

Moves forward through the note open history.

core:new-notein body

Creates a new note and open it in the editor.

    Arguments
  • Name
    bookId
    Type
    string
    Description

    (Optional) The notebook ID to create the note in.

core:new-note-in-separate-windowin body

Creates a new note in a separate window. Uses the currently selected notebook if applicable.

core:new-note-from-selectionin body

Creates a new note from the selected text on the editor.

Creates a new note from a link that targets an unresolved note in the preview pane.

    Arguments
  • Name
    title
    Type
    string
    Required
    Description

    The title of the new note (also used as the link label).

  • Name
    line
    Type
    number
    Required
    Description

    The line of the editor where the link appears.

  • Name
    newWindow
    Type
    boolean
    Description

    Whether to open the new note in a separate window.

core:new-notebookin body

Shows up a dialog for creating a new notebook.

    Arguments
  • Name
    parentBookId
    Type
    string
    Description

    A parent notebook ID. If undefined, a notebook will be created under the root. Default: undefined

core:note-list-show-all-notesin body

Lists all notes on the note list bar.

    Arguments
  • Name
    selectFirstNote
    Type
    boolean
    Description

    Whether to select the first note or not. Default: true

core:note-list-show-notes-in-templatesin body

Lists note templates on the note list bar, and closes the currently open note.

    Arguments
  • Name
    callback
    Type
    function
    Description

    Invoked after the note list has finished reloading.

core:note-list-show-notes-in-trashin body

Lists notes in the trash on the note list bar.

    Arguments
  • Name
    selectFirstNote
    Type
    boolean
    Description

    Whether to select the first note or not. Default: true

core:note-list-show-notes-in-bookin body

List notes in specified notebook on the note list bar

    Arguments
  • Name
    bookId
    Type
    string
    Required
    Description

    The notebook ID

  • Name
    tagId
    Type
    string
    Description

    The tag ID to filter items

  • Name
    status
    Type
    NoteStatus
    Description

    The note status which should be one of:"none" or "active" or "onHold" or "completed" or "dropped"

  • Name
    selectFirstNote
    Type
    boolean
    Description

    Whether to select the first note or not. Default: true

  • Name
    includeChildren
    Type
    boolean
    Description

    Whether to include the notes in the child notebooks. Default: false

core:note-list-show-notes-with-tagin body

List notes with specified tag on the note list bar

    Arguments
  • Name
    tagId
    Type
    string
    Required
    Description

    The tag ID.

  • Name
    selectFirstNote
    Type
    boolean
    Description

    Whether to select the first note or not. Default: true.

core:note-list-show-notes-with-statusin body

List notes with specified note status on the note list bar

    Arguments
  • Name
    status
    Type
    NoteStatus
    Required
    Description

    The note status which should be one of: "none" or "active" or "onHold" or "completed" or "dropped".

  • Name
    selectFirstNote
    Type
    boolean
    Description

    Whether to select the first note or not. Default: true.

core:note-tags-bar-item-list-unselectin .note-tags-bar-item-list

Unselect items on the note tags bar.

core:note-tags-bar-item-list-select-previn .note-tags-bar-item-list

Select the previous item on the note tags bar.

core:note-tags-bar-item-list-select-nextin .note-tags-bar-item-list

Select the next item on the note tags bar.

core:note-tags-bar-item-list-remove-item-beforein .note-tags-bar-item-list

Remove the selected item and select its previous item on the note tags bar.

core:note-tags-bar-item-list-remove-itemin .note-tags-bar-item-list

Remove the target item on the note tags bar.

    Arguments
  • Name
    tagId
    Type
    string
    Description

    (Optional) The tag ID to remove.

core:open-first-notein body

Opens the first note of the note list bar in the editor.

core:open-next-notein body

Opens the next note of currently selected note on the note list bar.

core:open-prev-notein body

Opens the previous note of currently selected note on the note list bar.

core:close-notein body

Closes the currently editing note.

core:open-notein body

Opens a note with specified note ID.

    Arguments
  • Name
    noteId
    Type
    string
    Required
    Description

    The ID of the note to open.

  • Name
    revision
    Type
    string
    Description

    (Optional) Open the specific revision of the note.

  • Name
    selectInNoteListBar
    Type
    boolean
    Description

    Whether to select the correspond note in the note list bar. Default: true.

  • Name
    pushState
    Type
    boolean
    Description

    Remember it in the navigation history. Default: true.

  • Name
    newWindow
    Type
    boolean
    Description

    Whether to open the note in a separate window. Default: false.

  • Name
    viewMode
    Type
    EditorViewMode
    Description

    The editor view mode to switch to after opening. One of "edit", "preview", or "sidebyside".

  • Name
    focus
    Type
    boolean
    Description

    Whether to focus the editor after opening. Default: false.

core:open-note-in-separate-windowin body

Opens notes in separate windows. By default, opens notes selected on the note list bar.

    Arguments
  • Name
    noteId
    Type
    string|array
    Description

    (Optional) The ID(s) of the note(s) to open.

core:open-tag-settingsin body

Opens up the settings window for the tag with specified ID.

    Arguments
  • Name
    tagId
    Type
    string
    Description

    The ID of the tag to set.

core:open-templatein body

Opens a note template in the editor. A template that already exists in the database is opened like a normal note; an official template that has not been saved yet is loaded into the editor unsaved.

    Arguments
  • Name
    template
    Type
    Note
    Required
    Description

    The template note to open.

core:pastein body

Pastes a text from clipboard.

core:paste-as-plain-textin body

Pastes a text from clipboard as plain text.

core:pin-note-to-topin body

Pin or unpin notes to the top of the note list. By default, applies to notes currently selected on the note list.

    Arguments
  • Name
    noteId
    Type
    string|array
    Description

    (Optional) The ID(s) of the note(s) to pin or unpin.

  • Name
    pinned
    Type
    boolean
    Description

    (Optional) The desired pinned state. If omitted, toggles the current state of the first target note.

core:popup-app-menuin body

Shows the application menu as a popup context menu (useful on Windows / Linux where the menu bar is hidden).

core:redoin body

Redoes the last undone change.

core:reload-packagein body

Unloads and re-loads the named package, if it is loaded.

    Arguments
  • Name
    name
    Type
    string
    Required
    Description

    The package name.

core:rename-notebook

core:save-imagein body

Saves the target element's image to disk.

core:save-notein body

Saves the currently editing note to the local database.

core:select-allin body

Select all text.

core:search-notesin body

Search notes globally with given keywords.

    Arguments
  • Name
    keyword
    Type
    string
    Required
    Description

    The keywords to search.

core:share-notein body

Shows up a dialog for sharing note with specified ID.

    Arguments
  • Name
    noteId
    Type
    string
    Required
    Description

    The ID of the note to be shared.

core:show-note-revisionsin body

Shows up a dialog for viewing note change history with specified ID.

    Arguments
  • Name
    noteId
    Type
    string
    Required
    Description

    The ID of the note to view its revision history.

core:show-editor-action-menuin body

Opens the editor's action menu below the header button, with the per-note actions (move, duplicate, copy link, pin, revisions, share, delete).

core:show-image-viewerin body

Opens the full-screen image viewer for the given image.

    Arguments
  • Name
    src
    Type
    string
    Required
    Description

    The image URL or URI to display.

  • Name
    alt
    Type
    string
    Description

    The alt text to show as a caption.

core:strikethroughin .cm-editor

Toggles strikethrough to the selected text.

core:strongin .cm-editor

Toggles strong emphasis to the selected text.

core:toggle-blockquotein .cm-editor

Toggles blockquote to the selected lines.

core:toggle-bulleted-listin .cm-editor

Toggles bulleted list to the selected lines.

core:toggle-heading-1in .cm-editor

Toggles h1 heading to the selected lines.

core:toggle-heading-2in .cm-editor

Toggles h2 heading to the selected lines.

core:toggle-heading-3in .cm-editor

Toggles h3 heading to the selected lines.

core:toggle-heading-4in .cm-editor

Toggles h4 heading to the selected lines.

core:toggle-heading-biggerin .cm-editor

Decreases heading level of the selected lines.

core:toggle-heading-smallerin .cm-editor

Increases heading level of the selected lines.

core:toggle-numbered-listin .cm-editor

Toggles ordered list to the selected lines.

core:toggle-task-listin .cm-editor

Toggles task list to the selected lines.

core:toggle-inline-codein .cm-editor

Toggles inline code block to the selected text.

    Arguments
  • Name
    selectionOnly
    Type
    boolean
    Description

    Whether to limit the toggle to the current selection only.

core:toggle-inline-mark-tagin .cm-editor

Toggles an inline <mark> tag around the selected text.

core:undoin .cm-editor

Undoes the last change.

core:unindentin .cm-editor

Unindents the current lines.

core:unload-packagein body

Unloads the named package from memory, if it is loaded.

    Arguments
  • Name
    name
    Type
    string
    Required
    Description

    The package name.

core:insert-alertin .cm-editor

Inserts an alert block with the specified type.

    Arguments
  • Name
    type
    Type
    string
    Required
    Description

    The type of the alert block. It should be one of "NOTE", "TIP", "IMPORTANT", "WARNING", or "CAUTION".

core:insert-alert-notein .cm-editor

Inserts a note alert block.

core:insert-alert-tipin .cm-editor

Inserts a tip alert block.

core:insert-alert-importantin .cm-editor

Inserts an important alert block.

core:insert-alert-warningin .cm-editor

Inserts a warning alert block.

core:insert-alert-cautionin .cm-editor

Inserts a caution alert block.


Telescope commands

Telescope is the quick finder for commands, notebooks, tags, and more.

core:toggle-telescopein body

Opens Telescope if it is closed, or closes it if it is open.

core:show-telescopein body

Opens Telescope.

    Arguments
  • Name
    scopedSourceId
    Type
    string
    Description

    (Optional) Restrict the search to a specific source (e.g. commands, notebooks, tags).

  • Name
    scopedWorkspaceId
    Type
    string|null
    Description

    (Optional) Restrict the search to a specific workspace.

  • Name
    initialSelectedItemId
    Type
    string|null
    Description

    (Optional) The initially selected item.

  • Name
    cancelBehavior
    Type
    string
    Description

    (Optional) Behavior when canceling, e.g. "close".

core:close-telescopein body

Closes Telescope.

core:telescope-clear-queryin body

Clears the Telescope query input.

core:telescope-clear-active-sourcein body

Clears the active scoped source in Telescope.

core:telescope-commandsin body

Opens Telescope scoped to the commands source.

core:telescope-notebooksin body

Opens Telescope scoped to the notebooks source.

core:telescope-tagsin body

Opens Telescope scoped to the tags source.


core:sidebar-focusin body

Moves focus to the side bar.

core:sidebar-select-next-itemin body

Select the next item of the side bar menu.

core:sidebar-select-prev-itemin body

Select the previous item of the side bar menu.

core:sidebar-select-itemin body

Activate the currently selected item.

core:sidebar-disclose-itemin body

Toggle the disclosure (expand/collapse) of the currently selected item.

core:sidebar-expand-itemin body

Expand the currently selected item.

core:sidebar-collapse-itemin body

Collapse the currently selected item.

core:sidebar-scroll-to-selectionin body

Scrolls the side bar to the currently selected item.

core:sidebar-open-workspace-menuin body

Open the workspace menu for a notebook.

    Arguments
  • Name
    bookId
    Type
    string
    Description

    (Optional) The notebook ID. If omitted, opens the current workspace.

  • Name
    selectFirstNote
    Type
    boolean
    Description

    Whether to select the first note in the workspace. Default: true.

core:sidebar-hide-workspace-menuin body

Hide the workspace menu.

core:sidebar-workspace-go-upin body

Navigate one level up in the workspace menu.


Editor commands

editor:clear-findin body

Clears the text in the editor search bar.

    Arguments
  • Name
    focus
    Type
    boolean
    Description

    Whether to keep the search bar focused after clearing.

editor:toggle-regexin .cm-editor

Toggles regex matching in the editor search bar.

editor:toggle-case-sensitivein .cm-editor

Toggles case-sensitive matching in the editor search bar.

editor:change-note-status-nonein body

Set the note status of the editing note to None.

editor:change-note-status-activein body

Set the note status of the editing note to Active.

editor:change-note-status-onholdin body

Set the note status of the editing note to OnHold.

editor:change-note-status-completedin body

Set the note status of the editing note to Completed.

editor:change-note-status-droppedin body

Set the note status of the editing note to Dropped.

editor:copy-line-upin .cm-editor

Duplicates the selected lines upward, keeping the selection in the top copy.

editor:copy-line-downin .cm-editor

Duplicates the selected lines downward, keeping the selection in the bottom copy.

editor:delete-char-afterin .cm-editor

Deletes the char after the cursor.

editor:delete-char-beforein .cm-editor

Deletes the char before the cursor.

editor:delete-group-afterin .cm-editor

Deletes the text group after the cursor.

editor:delete-group-beforein .cm-editor

Deletes the text group before the cursor.

editor:delete-linein .cm-editor

Deletes the line.

editor:delete-word-afterin .cm-editor

Deletes the word after the cursor.

editor:delete-word-beforein .cm-editor

Deletes the word before the cursor.

editor:delete-wrapped-line-leftin .cm-editor

Deletes the wrapped line left.

editor:delete-wrapped-line-rightin .cm-editor

Deletes the wrapped line right.

editor:upcase-at-cursorin .cm-editor

Uppercases the selection, or the word at the cursor when nothing is selected.

editor:downcase-at-cursorin .cm-editor

Lowercases the selection, or the word at the cursor when nothing is selected.

editor:edit-with-aiin .cm-editor

Opens the AI inline assistant to edit the currently selected text. Does nothing if there is no selection.

editor:trigger-nesin .cm-editor

Requests a Next Edit Suggestion at the cursor. Suggestions are rendered as dim ghost text and can also be triggered automatically after an idle pause, depending on the ai.nextEditSuggestions config.

editor:accept-nesin .cm-editor

Accepts the visible Next Edit Suggestion, inserting the ghost text as a single undoable edit. Does nothing and lets the keystroke fall through when no suggestion is visible.

editor:dismiss-nesin .cm-editor

Dismisses the visible Next Edit Suggestion.

editor:findin body

Toggles the editor search bar.

editor:find-nextin body

Locates the next item in the editor that matches criteria.

editor:find-previn body

Locates the previous item in the editor that matches criteria.

editor:find-textin body

Finds given text in the editor.

    Arguments
  • Name
    text
    Type
    string
    Required
    Description

    The text to find.

  • Name
    parseAsQuery
    Type
    boolean
    Description

    Whether to parse the text as a search query (with operators).

editor:find-underin .cm-editor

Selects the next occurrence of the selection, or of the word at the cursor when nothing is selected, wrapping around the end of the note.

editor:find-under-previousin .cm-editor

Selects the previous occurrence of the selection, or of the word at the cursor when nothing is selected, wrapping around the start of the note.

editor:focusin body

Focuses to the MDE or preview pane depending on the editor mode.

editor:focus-mdein body

Moves focus to the MDE.

editor:focus-previewin body

Moves focus to the preview pane.

editor:go-char-leftin .cm-editor

Moves the cursor to one character left.

editor:go-char-rightin .cm-editor

Moves the cursor to one character right.

editor:go-doc-endin .cm-editor

Moves the cursor to the end of the document.

editor:go-doc-startin .cm-editor

Moves the cursor to the start of the document.

editor:go-group-leftin .cm-editor

Moves the cursor to one group left.

editor:go-group-rightin .cm-editor

Moves the cursor to one group right.

editor:go-line-downin .cm-editor

Moves the cursor to one line down.

editor:go-line-endin .cm-editor

Moves the cursor to the line end.

editor:go-line-leftin .cm-editor

Moves the cursor to the line left.

editor:go-line-rightin .cm-editor

Moves the cursor to the line right.

editor:go-line-startin .cm-editor

Moves the cursor to the line start.

editor:go-line-upin .cm-editor

Moves the cursor to one line up.

editor:go-matching-bracketin .cm-editor

Moves the cursor to the bracket matching the one it is on.

editor:go-page-downin .cm-editor

Moves the cursor to one page down.

editor:go-page-upin .cm-editor

Moves the cursor to one page up.

editor:go-subword-leftin .cm-editor

Moves the cursor one group or camel-case subword backward.

editor:go-subword-rightin .cm-editor

Moves the cursor one group or camel-case subword forward.

editor:go-syntax-leftin .cm-editor

Moves the cursor one syntax node to the left.

editor:go-syntax-rightin .cm-editor

Moves the cursor one syntax node to the right.

editor:select-char-leftin .cm-editor

Extends the selection by one character to the left.

editor:select-char-rightin .cm-editor

Extends the selection by one character to the right.

editor:select-syntax-leftin .cm-editor

Extends the selection one syntax node to the left.

editor:select-syntax-rightin .cm-editor

Extends the selection one syntax node to the right.

editor:select-subword-leftin .cm-editor

Moves the selection head one group or camel-case subword backward.

editor:select-subword-rightin .cm-editor

Moves the selection head one group or camel-case subword forward.

editor:select-group-leftin .cm-editor

Extends the selection by one group to the left.

editor:select-group-rightin .cm-editor

Extends the selection by one group to the right.

editor:select-line-upin .cm-editor

Extends the selection one line up.

editor:select-line-downin .cm-editor

Extends the selection one line down.

editor:select-line-startin .cm-editor

Extends the selection to the line start.

editor:select-line-endin .cm-editor

Extends the selection to the line end.

editor:select-line-leftin .cm-editor

Extends the selection to the line boundary on the left.

editor:select-line-rightin .cm-editor

Extends the selection to the line boundary on the right.

editor:select-page-upin .cm-editor

Extends the selection one page up.

editor:select-page-downin .cm-editor

Extends the selection one page down.

editor:select-doc-startin .cm-editor

Extends the selection to the start of the document.

editor:select-doc-endin .cm-editor

Extends the selection to the end of the document.

editor:select-linein .cm-editor

Expands the selection to cover entire lines.

editor:select-parent-syntaxin .cm-editor

Expands the selection to the next larger syntactic construct.

editor:select-matching-bracketin .cm-editor

Extends the selection to the bracket matching the one the selection head is on.

editor:select-next-occurrencein .cm-editor

Adds a selection at the next occurrence of the selected text, or selects the word at the cursor when the selection is empty.

editor:select-selection-matchesin .cm-editor

Selects all instances of the currently selected text.

editor:skip-and-select-next-occurrencein .cm-editor

Moves the selection on to the next occurrence instead of adding it, dropping the range it searched from. With nothing selected, the first press only expands the selection to the word at the cursor.

editor:split-selection-by-linein .cm-editor

Replaces every selection range with one range per line it covers.

editor:move-line-upin .cm-editor

Moves the current line(s) up.

editor:move-line-downin .cm-editor

Moves the current line(s) down.

editor:indentin .cm-editor

Indents the currently selected line(s).

editor:indent-lessin .cm-editor

Unindents the currently selected line(s).

editor:indent-morein .cm-editor

Indents one more the currently selected line(s).

editor:insert-blank-linein .cm-editor

Creates a blank, indented line below the current line.

editor:insert-line-beforein .cm-editor

Opens an indented blank line above the line at the cursor and moves the cursor onto it — the upward counterpart of editor:insert-blank-line.

editor:insert-imagesin body

Inserts image files at the cursor to the editing note.

Opens the "Insert a link" dialog, pre-filled with the given title and URL, and inserts [title](url) at the cursor. Not registered while the session is read-only.

    Arguments
  • Name
    title
    Type
    string
    Description

    The link title to pre-fill.

  • Name
    url
    Type
    string
    Description

    The URL to pre-fill. When given, the URL field is selected instead of the title field.

editor:resize-image-autoin .cm-editor

Restores the image at the cursor to its natural size, by removing the w: and h: tokens from its alt text. Does nothing when the cursor is not inside an image.

editor:resize-image-smallin .cm-editor

Resizes the image at the cursor to 30% width.

editor:resize-image-halfin .cm-editor

Resizes the image at the cursor to 50% width.

editor:resize-image-fullin .cm-editor

Resizes the image at the cursor to 100% width.

    Arguments
  • Name
    pos
    Type
    object
    Description

    Position to insert with the following keys:

    • Name
      ch
      Type
      number
      Description

      Character position.

    • Name
      line
      Type
      number
      Description

      Line position.

  • Name
    files
    Type
    FileList|array
    Description

    FileList, or an Array of File or NativeImage to insert.

You can override the default file drop handler like so:

Example

const mde = inkdrop.getActiveEditorOrThrowError()
inkdrop.commands.add(mde.wrapper.wrapper, {
  'editor:insert-images': e => {
    const { files, pos } = e
    // Do something

    // prevent the default behavior
    e.stopPropagation()
  }
})

editor:join-linesin .cm-editor

Joins the lines each selection range covers into a single line, separated by one space and dropping the indentation of the absorbed lines. An empty selection joins the line at the cursor with the one below it.

editor:jump-to-linein .cm-editor

Toggles a dialog which allows you to jump to the line at the specified number.

editor:kill-linein .cm-editor

Deletes from the cursor to the end of the line.

editor:new-linein .cm-editor

Inserts a plain new line at the cursor without continuing any Markdown markup.

editor:new-line-continue-markupin .cm-editor

Inserts a new line and continues the current Markdown markup — list markers, ordered-list numbers, task list checkboxes, and blockquotes — then indents to match the surrounding block.

editor:open-linein .cm-editor

Inserts a new line above the cursor.

editor:redo-selectionin .cm-editor

Redoes the last selection.

editor:replacein body

Initiates the replace sequence in the editor.

editor:replace-nextin .cm-editor

Replaces the next occurrence in the editor.

editor:replace-allin .cm-editor

Replaces all occurrences in the editor.

editor:replace-selectionin .cm-editor

Replaces selected text with the given text.

    Arguments
  • Name
    text
    Type
    string
    Description

    String, the text to replace.

editor:save-editor-scroll

editor:save-preview-scroll

editor:scroll-line-upin .cm-editor

Scrolls the viewport up by one line, leaving the cursor where it is.

editor:scroll-line-downin .cm-editor

Scrolls the viewport down by one line, leaving the cursor where it is.

editor:show-in-centerin .cm-editor

Scrolls the line with the cursor on it to the vertical center of the viewport.

editor:sort-linesin .cm-editor

Sorts the lines covered by each selection range alphabetically. Ranges covering fewer than two lines are left alone, so an empty selection never rewrites the note.

editor:reverse-sort-linesin .cm-editor

Sorts the selected lines in reverse alphabetical order.

editor:sort-lines-insensitivein .cm-editor

Sorts the selected lines alphabetically, ignoring case. Lines that differ only in case keep a stable order between themselves.

editor:reverse-sort-lines-insensitivein .cm-editor

Sorts the selected lines in reverse alphabetical order, ignoring case.

editor:scroll-editor-to-linein body

Scrolls the editor to the given line.

    Arguments
  • Name
    line
    Type
    number
    Description

    Number, the destination line number.

editor:scroll-preview-to-linein body

Scrolls the preview to the given line.

    Arguments
  • Name
    line
    Type
    number
    Description

    Number, the destination line number.

editor:select-allin .cm-editor

Selects all text in the editor.

editor:select-lines-downwardin .cm-editor

Adds a cursor downward.

editor:select-lines-upwardin .cm-editor

Adds a cursor upward.

editor:single-selectionin .cm-editor

Removes all cursors except the primary one.

editor:sync-editor-scrollin body

Syncs the scroll position of the editor with the same position of the preview pane.

editor:sync-preview-scrollin body

Syncs the scroll position of the preview pane with the same position of the editor.

editor:focus-titlein body

Moves focus to the title input bar of the editor.

editor:focus-and-go-doc-startin body

Focuses the editor and moves the cursor to the start of the document.

editor:move-focus-to-nextin body

Moves focus from the title input bar to the next editable area.

editor:insert-textin body

Inserts the given text at the current cursor position.

    Arguments
  • Name
    text
    Type
    string
    Required
    Description

    The text to insert.

  • Name
    selection
    Type
    object
    Description

    (Optional) Selection to set after insertion, with anchor (number) and optional head (number) offsets from the insertion position.

Opens the URL at the cursor in the default browser.

Copies the URL at the cursor to the clipboard.

editor:paste-urlin .cm-editor

Pastes a URL at the cursor. If text is selected, wraps it as a Markdown link.

    Arguments
  • Name
    url
    Type
    string
    Required
    Description

    The URL to paste.

editor:start-completionin .cm-editor

Manually triggers the autocompletion popup.

editor:accept-completionin .cm-editor

Accepts the currently highlighted completion suggestion.

editor:close-completionin .cm-editor

Closes the autocompletion popup.

editor:move-completion-selection-upin .cm-editor

Moves the highlighted completion suggestion up.

editor:move-completion-selection-downin .cm-editor

Moves the highlighted completion suggestion down.

editor:move-completion-selection-page-upin .cm-editor

Moves the highlighted completion suggestion up by a page.

editor:move-completion-selection-page-downin .cm-editor

Moves the highlighted completion suggestion down by a page.

editor:refreshin body

Requests the editor to recompute its measurements (after layout changes).

editor:set-docin body

Replaces the entire editor content with the given body.

    Arguments
  • Name
    body
    Type
    string
    Required
    Description

    The new document body.

editor:toggle-commentin .cm-editor

Comments or uncomments the selection, using line comments when the language provides them and block comments otherwise. In Markdown text this produces an HTML comment (<!-- -->), since Markdown defines only block comment tokens.

editor:toggle-line-commentin .cm-editor

Comments or uncomments the selection using line comments. This only takes effect inside a fenced code block whose language provides line comment tokens — in Markdown text it does nothing.

editor:toggle-line-numbersin body

Toggles line numbers in the editor.

editor:toggle-line-wrappingin body

Toggles soft line wrapping in the editor.

editor:toggle-readable-line-lengthin body

Toggles a maximum readable line length in the editor.

editor:toggle-limit-max-widthin body

Toggles whether the editor limits its maximum content width.

editor:add-code-languagein body

Registers a code language with the Markdown editor for fenced-code syntax highlighting.

    Arguments
  • Name
    lang
    Type
    LanguageDescription
    Required
    Description

    A CodeMirror LanguageDescription instance.

editor:remove-code-languagein body

Removes a previously registered code language.

    Arguments
  • Name
    name
    Type
    string
    Required
    Description

    The name of the language to remove.

editor:add-extensionin body

Adds a CodeMirror extension to the editor.

    Arguments
  • Name
    extension
    Type
    Extension
    Required
    Description

    A CodeMirror Extension.

editor:remove-extensionin body

Removes a previously added CodeMirror extension.

    Arguments
  • Name
    extension
    Type
    Extension
    Required
    Description

    The extension to remove.

editor:add-markdown-extensionin body

Adds a Lezer Markdown extension to the parser.

    Arguments
  • Name
    extension
    Type
    MarkdownExtension
    Required
    Description

    A Lezer MarkdownExtension.

editor:remove-markdown-extensionin body

Removes a previously added Markdown extension.

    Arguments
  • Name
    extension
    Type
    MarkdownExtension
    Required
    Description

    The extension to remove.

editor:add-slash-commandsin body

Registers additional items for the slash-command menu.

    Arguments
  • Name
    commands
    Type
    SlashCommandList
    Required
    Description

    The slash commands to add.

editor:remove-slash-commandsin body

Unregisters previously added slash-command items.

    Arguments
  • Name
    commands
    Type
    SlashCommandList
    Required
    Description

    The slash commands to remove.

editor:new-table-row-and-continuein .cm-editor

Inserts a new row in the table at the cursor and continues editing.

editor:move-to-next-table-cellin .cm-editor

Moves the cursor to the next cell of the table at the cursor.

editor:move-to-previous-table-cellin .cm-editor

Moves the cursor to the previous cell of the table at the cursor.

editor:toggle-task-listin .cm-editor

Toggles task list to the current selections.

editor:transpose-charsin .cm-editor

Transposes characters at the cursor.

editor:undo-selectionin .cm-editor

Undoes the last selection.

editor:unindentin .cm-editor

Unindents the current lines.

editor:show-notes-in-book-of-editing-notein body

Display notes in a notebook of the currently editing note on the note list bar.

editor:go-to-workspace-of-editing-notein body

Switches to the workspace of the notebook of the currently editing note.


AI commands

Commands for managing the AI inline assistant. These are global commands you typically invoke programmatically (for example, from a plugin) to customize the built-in prompt presets shown when editing the selection with AI.

ai:add-inline-assistant-prompt-presetsin body

Adds prompt presets to the AI inline assistant. A preset whose ID matches an existing one replaces it; the rest are appended to the list.

    Arguments
  • Name
    presets
    Type
    array
    Required
    Description

    An array of preset objects, each with the following keys:

    • Name
      id
      Type
      string
      Required
      Description

      A unique identifier for the preset.

    • Name
      label
      Type
      string
      Required
      Description

      The label shown in the preset list.

    • Name
      prompt
      Type
      string
      Required
      Description

      The prompt sent to the AI when the preset is selected.

ai:remove-inline-assistant-prompt-presetsin body

Removes prompt presets from the AI inline assistant by ID.

    Arguments
  • Name
    ids
    Type
    array
    Required
    Description

    The IDs of the presets to remove.


Table editor commands

These commands operate while the cursor is inside a Markdown table.

table-editor:select-cellin .cm-editor

Selects the contents of the current cell.

table-editor:next-cellin .cm-editor

Moves to the next cell.

table-editor:previous-cellin .cm-editor

Moves to the previous cell.

table-editor:next-rowin .cm-editor

Moves to the next row.

table-editor:escapein .cm-editor

Exits the table editing mode.

table-editor:move-leftin .cm-editor

Moves one cell to the left.

table-editor:move-rightin .cm-editor

Moves one cell to the right.

table-editor:move-upin .cm-editor

Moves one cell up.

table-editor:move-downin .cm-editor

Moves one cell down.

table-editor:align-leftin .cm-editor

Aligns the current column to the left.

table-editor:align-rightin .cm-editor

Aligns the current column to the right.

table-editor:align-centerin .cm-editor

Aligns the current column to the center.

table-editor:align-nonein .cm-editor

Removes column alignment.

table-editor:move-row-upin .cm-editor

Moves the current row up.

table-editor:move-row-downin .cm-editor

Moves the current row down.

table-editor:move-column-leftin .cm-editor

Moves the current column to the left.

table-editor:move-column-rightin .cm-editor

Moves the current column to the right.

table-editor:delete-columnin .cm-editor

Deletes the current column.

table-editor:delete-rowin .cm-editor

Deletes the current row.

table-editor:insert-columnin .cm-editor

Inserts a new column.

table-editor:insert-rowin .cm-editor

Inserts a new row.

table-editor:formatin .cm-editor

Reformats the current table.

table-editor:format-allin .cm-editor

Reformats all tables in the note.


Export commands

export-as-html:selectionsin body

Exports the selected notes on the note list bar as HTML to disk. Exporting more than one note prompts for a destination directory; exporting exactly one opens a save dialog.

    Arguments
  • Name
    noteId
    Type
    string
    Description

    The note to export. Defaults to the notes selected on the note list bar, then to the editing note.

export-as-html:notebookin body

Prompts for a directory and exports every note in a notebook, and its child notebooks, as HTML.

    Arguments
  • Name
    bookId
    Type
    string
    Description

    The notebook to export. Defaults to the notebook targeted by the context menu.

export-as-html:copyin body

Copies a note to the clipboard as full templated HTML, with images inlined as data URIs.

    Arguments
  • Name
    noteId
    Type
    string
    Description

    The note to copy. Defaults to the first note selected on the note list bar.

export-as-html:copy-simplein body

Copies a note to the clipboard as stripped-down HTML, without the document template.

    Arguments
  • Name
    noteId
    Type
    string
    Description

    The note to copy. Defaults to the first note selected on the note list bar.

export-as-markdown:allin body

Exports all notes as Markdown to disk.

export-as-markdown:selectionsin body

Exports the selected notes on the note list bar as Markdown, along with their attachments. Exporting more than one note prompts for a destination directory; exporting exactly one opens a save dialog.

    Arguments
  • Name
    noteId
    Type
    string
    Description

    The note to export. Defaults to the notes selected on the note list bar, then to the editing note.

export-as-markdown:notebookin body

Prompts for a directory and exports every note in a notebook, and its child notebooks, as Markdown.

    Arguments
  • Name
    bookId
    Type
    string
    Description

    The notebook to export. Defaults to the notebook targeted by the context menu.

export-print:export-as-pdfin body

Exports the editing note as PDF to disk.

export-print:printin body

Prints the editing note.


Import commands

import-html:import-from-filein body

Imports a note from a HTML file.

import-markdown:import-from-filein body

Opens the Markdown import wizard, which scans the chosen files or directory and imports them into a notebook you pick.


View commands

view:sort-by-title-in-ascin body

Sorts the note list by title in ascending order.

view:sort-by-title-in-descin body

Sorts the note list by title in descending order.

view:sort-by-date-created-in-ascin body

Sorts the note list by date created in ascending order.

view:sort-by-date-created-in-descin body

Sorts the note list by date created in descending order.

view:sort-by-date-updated-in-ascin body

Sorts the note list by date updated in ascending order.

view:sort-by-date-updated-in-descin body

Sorts the note list by date updated in descending order.

view:show-editorin body

Shows the editor pane.

view:show-previewin body

Shows the preview pane.

view:show-side-by-sidein body

Shows the editor and preview side by side.

view:toggle-distraction-freein body

Toggles distraction-free mode.

view:toggle-previewin body

Toggles the preview pane.

view:toggle-side-by-sidein body

Toggles the side-by-side mode.

view:toggle-sidebarin body

Toggles the side bar.


Window commands

window:closein body

Closes the window.

window:decrease-font-sizein body

Decreases the font size in the editor.

window:increase-font-sizein body

Increases the font size in the editor.

window:new-inkdrop-windowin body

Opens up a new window.

window:reloadin body

Reloads the window.

window:toggle-dev-toolsin body

Toggles the Developer Tools window.

window:toggle-full-screenin body

Toggles full screen mode.

window:toggle-menu-barin bodyWindows / Linux only

Toggles the core.autoHideMenuBar config, which hides or shows the menu bar. When the menu bar is hidden it can be revealed temporarily by pressing the Alt key.


Special commands

The following commands are special for controlling the key event handler.

native!

Triggers the default behavior of the key event.

unset!

Unbinds the existing keybinding.

abort!

Prevents the default behavior of the key event. It calls preventDefault on the event object.

Can you help us improve the docs? 🙏

The source of these docs is here on GitHub. If you see a way these docs can be improved, please fork us!