inkdropapp / inkdrop-vim

Provides Vim modal control for Inkdrop, blending the best of Vim and Inkdrop
https://www.inkdrop.app/
MIT License
101 stars 9 forks source link

vim keybindings plugin for Inkdrop

Provides Vim modal control for Inkdrop, blending the best of Vim and Inkdrop.

Features

Install

ipm install vim

Key customizations

Default vim keymaps are defined here and you can override them in your keymap.cson file.

CSS selectors for each mode:

You can check current keybindings on the Keybindings pane on preferences window:

Preferences

Ex Commands

:w, :write

Saves current note immediately to the disk.

:next, :n

Opens next note on the note list.

:prev

Opens previous note on the note list.

:preview, :p

Toggles HMTL preview.

:side-by-side, :side

Toggles side-by-side mode.

Define custom Ex commands

You can extend Ex commands by writing init.js. The following example defines :find command:

inkdrop.onEditorLoad(() => {
  var CodeMirror = require('codemirror')
  CodeMirror.Vim.defineEx('find', 'f', (cm, event) => {
    inkdrop.commands.dispatch(document.body, 'core:find-global')
    if (event.argString)
      inkdrop.commands.dispatch(document.body, 'core:search-notes', {
        keyword: event.argString.trim()
      })
  })
})

Options

options

Seamlessly jump to note title

Whether moving focus seamlessly from the editor to the note title bar by vim:move-up command

Changelog

See the GitHub releases for an overview of what changed in each update. See CHANGELOG.md for older releases.