Created
December 3, 2013 01:25
-
-
Save y-yu/7762310 to your computer and use it in GitHub Desktop.
TEXTAREA mode key mapping on Vimperator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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