Closed ghost closed 3 years ago
I'm afraid that Ex commands are hard-coded and can't be customized.
https://github.com/inkdropapp/inkdrop-vim/blob/master/src/vim.js#L958
Is there any alternatives to put some global object that is customizable through a cson file like keymaps?
You can write init.js
like so:
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() })
})
})
It worked! Thanks
I wanna create some ex commands to inkdrop commands like :f to core:find-global as I use in vim.