0.1.2 • Published 9 years ago

vimkey v0.1.2

Weekly downloads
2
License
-
Repository
-
Last release
9 years ago

Vimkey


NPM version spm version Build status Coveralls status

Vim-like key mapping for the web from Vimlide.

Install

$ spm install vimkey --save

Usage

var Vimkey = require('vimkey');
var LINE_HEIGHT = 100;

var normalMode = new Vimkey(document, {
  countable: true,
});
normalMode.map('<Esc>', function(evt) {
  this.reset();
  evt.stopPropagation();
});
normalMode.map('j', function(evt, count = 1) {
  window.scrollBy(LINE_HEIGHT * count, 0);
  evt.stopPropagation();
});

API

.map(String key, Function handler)

key mapping.

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.0

9 years ago