Skip to content

Migrate your settings from 0.9.74 to 1.0

Kid edited this page Jun 1, 2022 · 11 revisions

Due to code changes to improve maintainability, it is necessary to update your settings.

APIs such as map / mapkey, have been put under a global object api such as api.map / api.mapkey. For example, to use mapkey, we now need to 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).');
});

previously the code does not need the api keyword,

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,
    unmapAllExcept,
    vunmap,
    cmap,
    addSearchAlias,
    removeSearchAlias,
    tabOpenLink,
    readText,
    Clipboard,
    Front,
    Hints,
    Visual,
    RUNTIME
} = api;

Please refer to the full list of API functions. Any function that you are using has to be included in the code above. Else, you will have to call it via api.<function_name>(), instead of just <function_name>().

eg. If you forgot to include unmapAllExcept, and call it without the api keyword prefix, you will face this error,

[SurfingKeys] Error found in settings: ReferenceError: unmapAllExcept is not defined

Some other breaking changes:

  • addSearchAliasX was replaced with addSearchAlias.
  • Hints.numericHints = true; was replaced with Hints.setNumeric().
  • Hints.characters = "abcd"; was replaced with Hints.setCharacters("abcd").
  • settings.blacklistPattern was replaced with settings.blocklistPattern.
Clone this wiki locally