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: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:quit

Quits the app.

application:report-issue

Opens up the Inkdrop forum.

application:show-credits

Opens up the list of software licenses.

application:show-and-focus-main-window

Show and focus Inkdrop main window.

application:toggle-main-window

Toggle Inkdrop main window.

application:unhide-all-applicationsmacOS only

Unhides all apps, including Inkdrop.

application:view-help

Opens up the 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:sync-db-full

Perform data sync from the beginning.

application:quick-note

Create a note and show it in a separate window.


Core commands

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:cutin body

Delete the selected text and copy it to clipboard.

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 .mde-cm-wrapper

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

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.

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 .mde-cm-wrapper

Indents the selected line(s).

core:insert-code-blockin .mde-cm-wrapper

Inserts a code block.

core:insert-horizontal-rulein .mde-cm-wrapper

Inserts a horizontal rule: * * *.

Inserts a link.

core:move-notebook

core:move-to-notebook

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.

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-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-list-show-notes-in-book-of-editing-notein body

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

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-select-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-select-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: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
    selectInNoteListBar
    Type
    boolean
    Description

    Whether to select the correspond note in the note list bar.

  • Name
    pushState
    Type
    boolean
    Description

    Remember it in the navigation history.

  • Name
    newWindow
    Type
    boolean
    Description

    Whether to open the note in a separate window.

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-prev-notein body

Opens the previous 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: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:pastein body

Pastes a text from clipboard.

core:paste-as-plain-textin body

Pastes a text from clipboard as plain text.

core:redoin body

Redoes the last undone change.

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:sidebar-focusin body

Moves focus to the side bar.

core:sidebar-select-next-itemin body

Select next item of the side bar menu.

core:sidebar-select-prev-itemin body

Select previous item of the side bar menu.

core:strikethroughin .mde-cm-wrapper

Toggles strikethrough to the selected text.

core:strongin .mde-cm-wrapper

Toggles strong emphasis to the selected text.

core:toggle-blockquotein .mde-cm-wrapper

Toggles blockquote to the selected lines.

core:toggle-bulleted-listin .mde-cm-wrapper

Toggles bulleted list to the selected lines.

core:toggle-heading-1in .mde-cm-wrapper

Toggles h1 heading to the selected lines.

core:toggle-heading-2in .mde-cm-wrapper

Toggles h2 heading to the selected lines.

core:toggle-heading-3in .mde-cm-wrapper

Toggles h3 heading to the selected lines.

core:toggle-heading-4in .mde-cm-wrapper

Toggles h4 heading to the selected lines.

core:toggle-heading-biggerin .mde-cm-wrapper

Decreases heading level of the selected lines.

core:toggle-heading-smallerin .mde-cm-wrapper

Increases heading level of the selected lines.

core:toggle-numbered-listin .mde-cm-wrapper

Toggles ordered list to the selected lines.

core:toggle-task-listin .mde-cm-wrapper

Toggles task list to the selected lines.

core:undoin .mde-cm-wrapper

Undoes the last change.

core:unindentin .mde-cm-wrapper

Unindents the current lines.


Editor commands

editor:clear-findin body

Clears the text 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:delete-char-afterin .mde-cm-wrapper

Deletes the char after the cursor.

editor:delete-char-beforein .mde-cm-wrapper

Deletes the char before the cursor.

editor:delete-group-afterin .mde-cm-wrapper

Deletes the text group after the cursor.

editor:delete-group-beforein .mde-cm-wrapper

Deletes the text group before the cursor.

editor:delete-linein .mde-cm-wrapper

Deletes the line.

editor:delete-word-afterin .mde-cm-wrapper

Deletes the word after the cursor.

editor:delete-word-beforein .mde-cm-wrapper

Deletes the word before the cursor.

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

Deletes the wrapped line left.

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

Deletes the wrapped line right.

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
    Description

    String, the text to find.

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 .mde-cm-wrapper

Moves the cursor to one character left.

editor:go-char-rightin .mde-cm-wrapper

Moves the cursor to one character right.

editor:go-doc-endin .mde-cm-wrapper

Moves the cursor to the end of the document.

editor:go-doc-startin .mde-cm-wrapper

Moves the cursor to the start of the document.

editor:go-group-leftin .mde-cm-wrapper

Moves the cursor to one group left.

editor:go-group-rightin .mde-cm-wrapper

Moves the cursor to one group right.

editor:go-line-downin .mde-cm-wrapper

Moves the cursor to one line down.

editor:go-line-endin .mde-cm-wrapper

Moves the cursor to the line end.

editor:go-line-leftin .mde-cm-wrapper

Moves the cursor to the line left.

editor:go-line-rightin .mde-cm-wrapper

Moves the cursor to the line right.

editor:go-line-startin .mde-cm-wrapper

Moves the cursor to the line start.

editor:go-line-upin .mde-cm-wrapper

Moves the cursor to one line up.

editor:go-page-downin .mde-cm-wrapper

Moves the cursor to one page down.

editor:go-page-upin .mde-cm-wrapper

Moves the cursor to one page up.

editor:go-word-leftin .mde-cm-wrapper

Moves the cursor to one word left.

editor:go-word-rightin .mde-cm-wrapper

Moves the cursor to one word right.

editor:indentin .mde-cm-wrapper

Indents the currently selected line(s).

editor:indent-lessin .mde-cm-wrapper

Unindents the currently selected line(s).

editor:indent-morein .mde-cm-wrapper

Indents one more the currently selected line(s).

editor:insert-imagesin .mde-cm-wrapper

Inserts image files at the cursor to the editing note.

    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:jump-to-linein .mde-cm-wrapper

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

editor:kill-linein .mde-cm-wrapper

Deletes the line at the cursor.

editor:new-linein .mde-cm-wrapper

Inserts a new line below the cursor.

editor:open-linein .mde-cm-wrapper

Inserts a new line above the cursor.

editor:redo-selectionin .mde-cm-wrapper

Redoes the last selection.

editor:replacein body

Initiates the replace sequence in the editor.

editor:replace-selectionin .mde-cm-wrapper

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-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 .mde-cm-wrapper

Selects all text in the editor.

editor:select-lines-downwardin .mde-cm-wrapper

Adds a cursor downward.

editor:select-lines-upwardin .mde-cm-wrapper

Adds a cursor upward.

editor:single-selectionin .mde-cm-wrapper

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:toggle-overwritein .mde-cm-wrapper

Toggles overwrite mode.

editor:toggle-task-listin .mde-cm-wrapper

Toggles task list to the current selections.

editor:transpose-charsin .mde-cm-wrapper

Transposes characters at the cursor.

editor:undo-selectionin .mde-cm-wrapper

Undoes the last selection.

editor:unindentin .mde-cm-wrapper

Unindents the current lines.

core:toggle-editor-drawerin body

Toggle editor drawer.

core:show-editor-drawerin body

Show editor drawer.

core:close-editor-drawerin body

Hide editor drawer.


Export commands

export-as-html:exportin body

Exports selected notes on the note list bar as HTML to disk.

export-as-markdown:allin body

Exports all notes as Markdown to disk.

export-as-markdown:singlein body

Exports the editing note as Markdown to disk.

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.


View commands

view:sort-by-date-createdin body

Sorts the note list by date created.

view:sort-by-date-updatedin body

Sorts the note list by date updated.

view:sort-by-titlein body

Sorts the note list by title.

view:sort-in-ascendingin body

Sorts the note list in ascending order.

view:sort-in-descendingin body

Sorts the note list in descending order.

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:install-shell-commandsin body

Installs ipm command to your system.

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.

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!