diff --git a/help.js b/help.js index d9bcacd..d296818 100644 --- a/help.js +++ b/help.js @@ -16,4 +16,10 @@ module.exports.categories = { proxy: 13, misc: 14, insertMode: 15, + vim: { + normal: 16, + insert: 17, + visual: 18, + command: 19, + }, } diff --git a/util.js b/util.js index 84ea83b..f5f01f8 100644 --- a/util.js +++ b/util.js @@ -102,7 +102,19 @@ util.processMaps = (maps, aliases, siteleader) => { const fullDescription = `#${category} ${description}` if (mapObj.map !== undefined) { - map(alias, mapObj.map) + if (Object.values(categories.vim).includes(mapObj.category)) { + aceVimMap(alias, mapObj.map, { + [categories.vim.normal]: "normal", + [categories.vim.insert]: "insert", + [categories.vim.command]: "command", + }[mapObj.category]) + } + const method = { + [categories.omnibar]: cmap, + [categories.insertMode]: imap, + [categories.visualMode]: vmap, + }[mapObj.category] || map + method(alias, mapObj.map) } else { mapkey(key, fullDescription, callback, opts) }