Skip to content

Instantly share code, notes, and snippets.

@y-yu
Created December 3, 2013 01:25
Show Gist options
  • Save y-yu/7762310 to your computer and use it in GitHub Desktop.
Save y-yu/7762310 to your computer and use it in GitHub Desktop.
TEXTAREA mode key mapping on Vimperator
(function () {
function textareaMap (lhs, rhs) {
let noremap = true,
silent = true,
urls = void 0;
rhs = mappings._expandLeader(rhs);
mappings.addUserMap(
[modes.TEXTAREA],
[lhs],
"User defined mapping",
function (count) {
events.feedkeys((count || "") + rhs, noremap, silent);
},
{
count: true,
rhs: events.canonicalKeys(rhs),
noremap: !!noremap,
silent: silent,
matchingUrls: urls
}
);
}
// for Dvorak
textareaMap("t", "j");
textareaMap("n", "k");
textareaMap("s", "l");
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment