Skip to content

Migrate your settings from 0.9.74 to 1.0

brook hong edited this page Dec 29, 2021 · 11 revisions

Due to the refactoring, there is some necessary update in your setting snippets, if you use APIs such as map / mapkey etc, which have been put under a global object api such as api.map / api.mapkey. For example, to use mapkey, we need code as below

api.mapkey('<Ctrl-y>', 'Show me the money', function() {
    api.Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).');
});

You could also add below code at the very beginning of your snippets, which will free you from changing your original snippets.

const {
    aceVimMap,
    mapkey,
    imap,
    imapkey,
    getClickableElements,
    vmapkey,
    map,
    unmap,
    cmap,
    addSearchAlias,
    removeSearchAlias,
    tabOpenLink,
    readText,
    Clipboard,
    Front,
    Hints,
    Visual,
    RUNTIME
} = api;

Of course, you could exclude the unwanted APIs by deleting corresponding lines.

Here is the API doc.

Some other breaking changes:

  • addSearchAliasX was replaced with addSearchAlias.
Clone this wiki locally