{"_id":"readline-vim","_rev":"35-84fe1ee7abf12336af0a0dfc021b3501","name":"readline-vim","description":"Adds vim bindings to nodejs readline.","dist-tags":{"latest":"0.3.2"},"versions":{"0.1.0":{"name":"readline-vim","version":"0.1.0","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"test":"node-trap test/**/*.js && node-trap test/*.js"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"trap":"git://github.com/thlorenz/trap.git#ok"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim');\nvar repl = require('repl');\n\nvar r = repl.start();\n\n// pass the readline component of the repl in order to add vim bindings to it\nrlv(r.rli);\n```\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [History](#history)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the usual side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `cc`, `C` change line\n- `db`: delete word left\n- `dw`: delete word right\n- `dd`, `D` delete line\n- `x` delete right\n- `X` delete left\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n","_id":"readline-vim@0.1.0","dist":{"shasum":"7ca3946024547dc042ee9576374e3be86a5edfc6","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.1.0.tgz","integrity":"sha512-+rIbAIxPmZSEa/9/8JuiU58gqrQvGpSvK/MxYc6w80sIU6ka8rFkv8S4ZIrJHrts42T5wVQjMNnwlP9u8jtCKg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAtkj/vl2qpDqsHk2RsnbceDZUZelGeCXs03wl+APncJAiAW08gHIOk1ZURIGGKXtDANAZ3TnFMNh2KIpaRuSykyRA=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{}},"0.1.1":{"name":"readline-vim","version":"0.1.1","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"trap":"git://github.com/thlorenz/trap.git#ok"},"dependencies":{"tap":"~0.3.3"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim');\nvar repl = require('repl');\n\nvar r = repl.start();\n\n// pass the readline component of the repl in order to add vim bindings to it\nrlv(r.rli);\n```\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [History](#history)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`, `C` change line\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`, `D` delete line\n\n- `x` delete right\n- `X` delete left\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n","_id":"readline-vim@0.1.1","dist":{"shasum":"2fad34b9e10c66471f109216f83fbe5c87a12ced","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.1.1.tgz","integrity":"sha512-bungA+05MDVx8P8HVSmm3NiQf/yxTy8EJ8nybaipufbWTDBwEy9YWrOTVr8m8Lvt+Yqacc2JAXaDGqFkJWauRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB9gWnjvzlYBRagGoxNfK4F8FZflLt4qVWPqNiJSYX3wAiEA7eY2JzWVMjzMF+m5nUauOJpfqhdbRzuaS66GJq8V5iI="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{}},"0.2.0":{"name":"readline-vim","version":"0.2.0","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"demo":"node ./examples/repl","test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"trap":"git://github.com/thlorenz/trap.git#ok","proxyquire":"~0.4.0","sinon":"~1.5.2"},"dependencies":{"tap":"~0.4.0","stringify-key":"~0.1.2","parse-key":"~0.1.1"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim')\n  , repl = require('repl');\n\nvar r = repl.start({\n    prompt: \"vim repl > \",\n    input: process.stdin,\n    output: process.stdout\n  });\n\n// pass the readline component of the repl in order to add vim bindings to it\nvar vim = rlv(r.rli)\n  , map = vim.map;\n\n// Add mappings\n\n// [insert mode] allow switching to normal mode by typing 'jk' quickly \nmap.insert('jk', 'esc');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-k', 'ctrl-p');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-space', 'ctrl-n');\n\n// [normal mode] go backward in history via space bar\nmap.normal('space', 'k');\n\n// [normal mode] go forward in history via space bar when ctrl is pressed \nmap.normal('ctrl-space', 'j');\n```\n\nRun it via: `npm run demo`\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [History](#history)\n- [Mappings](#mappings)\n  - [Immediate Mappings](#immediate-mappings)\n  - [Sequence Mappings](#sequence-mappings)\n  - [Inspecting Mappings](#inspecting-mappings)\n- [Events](#events)\n- [Forcing the Readline into a Mode](#forcing-the-readline-into-a-mode)\n- [Examples](#examples)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`, `C` change line\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`, `D` delete line\n\n- `x` delete right\n- `X` delete left\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n## Mappings\n\n### Immediate Mappings\n\nImmediate mappings execute immediately whe a key (possibly with modifiers) is pressed.\n\nThey can be applied in insert and normal mode.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// emit [esc] when [ctrl-space] is pressed to switch to normal mode\nmap.insert('ctrl-space', 'esc');\n\n// emit [k] when [space] is pressed to go backward in history\nmap.normal('space', 'k');\n```\n\n### Sequence Mappings\n\nSequence mappings are a number of keys **without modifiers** pressed quickly after another.\n\nThey can be applied to **insert mode only**.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// map [jk] pressed in quick succession to [esc] to switch to normal mode\nmap.insert('jk', 'esc');\n```\n\nThe interval allowed between keys in order to count as a sequence can be configured by setting `vim.threshold`, the\ndefault is `200 milliseconds`.\n\n### Inspecting Mappings\n\nYou can inspect your mappings by navigating/printing the `vim.map.mappings` object.\n\n## Events\n\nThe following events are emitted to allow reacting to state changes:\n\n- `normal` when mode changes to normal\n- `insert` when mode changes to insert\n- `write` when a key is written to the underlying `readline` (i.e. it wasn't handled by `readline-vim` and therefore\n  passed through\n\nThese events are exposed via `vim.events`, so to subscribe to normal mode changes you would do:\n\n```js\nvim.events.on('normal', function () {\n  // do something here to react\n});\n```\n\n## Forcing the Readline into a Mode\n\nYou can cause the `readline` to change to a particular mode and pass a `Boolean` to indicate if that mode change should\nbe kept a secret (i.e. no event is emitted).\n\n```js\nvim.forceInsert();      // changes mode to insert and emits 'insert' event\nvim.forceNormal(true);  // changes mode to normal, but emits no event\n```\n\n## Examples\n\n- [simple readline](https://github.com/thlorenz/readline-vim/blob/master/examples/readline.js)\n- [repl](https://github.com/thlorenz/readline-vim/blob/master/examples/repl.js)\n","_id":"readline-vim@0.2.0","dist":{"shasum":"4062bf5e4261ada45e32d181a105d07d6d3ec1e7","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.2.0.tgz","integrity":"sha512-bJfNlHxtanCTbARtZahz6mT7GR6kmlv8eH5e5Rpe7QB/OfusgflQkdgd4lUq9eNaoGfSpaV2wwJET6XtbeQ2Hg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIrl5HcbYU/oqoCXIxU328w9dqEx2S/atNDwAr6y2EfQIgJy9Kh2uJd5hToppP43aTbRzkNaAXtKKYOEhHutDbc3g="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{}},"0.2.1":{"name":"readline-vim","version":"0.2.1","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"demo":"node ./examples/repl","test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"trap":"git://github.com/thlorenz/trap.git#ok","proxyquire":"~0.4.0","sinon":"~1.5.2","tap":"~0.4.0"},"dependencies":{"stringify-key":"~0.1.2","parse-key":"~0.1.1"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim')\n  , repl = require('repl');\n\nvar r = repl.start({\n    prompt: \"vim repl > \",\n    input: process.stdin,\n    output: process.stdout\n  });\n\n// pass the readline component of the repl in order to add vim bindings to it\nvar vim = rlv(r.rli)\n  , map = vim.map;\n\n// Add mappings\n\n// [insert mode] allow switching to normal mode by typing 'jk' quickly \nmap.insert('jk', 'esc');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-k', 'ctrl-p');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-space', 'ctrl-n');\n\n// [normal mode] go backward in history via space bar\nmap.normal('space', 'k');\n\n// [normal mode] go forward in history via space bar when ctrl is pressed \nmap.normal('ctrl-space', 'j');\n```\n\nRun it via: `npm run demo`\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [History](#history)\n- [Mappings](#mappings)\n  - [Immediate Mappings](#immediate-mappings)\n  - [Sequence Mappings](#sequence-mappings)\n  - [Inspecting Mappings](#inspecting-mappings)\n- [Events](#events)\n- [Forcing the Readline into a Mode](#forcing-the-readline-into-a-mode)\n- [Examples](#examples)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`, `C` change line\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`, `D` delete line\n\n- `x` delete right\n- `X` delete left\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n## Mappings\n\n### Immediate Mappings\n\nImmediate mappings execute immediately whe a key (possibly with modifiers) is pressed.\n\nThey can be applied in insert and normal mode.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// emit [esc] when [ctrl-space] is pressed to switch to normal mode\nmap.insert('ctrl-space', 'esc');\n\n// emit [k] when [space] is pressed to go backward in history\nmap.normal('space', 'k');\n```\n\n### Sequence Mappings\n\nSequence mappings are a number of keys **without modifiers** pressed quickly after another.\n\nThey can be applied to **insert mode only**.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// map [jk] pressed in quick succession to [esc] to switch to normal mode\nmap.insert('jk', 'esc');\n```\n\nThe interval allowed between keys in order to count as a sequence can be configured by setting `vim.threshold`, the\ndefault is `200 milliseconds`.\n\n### Inspecting Mappings\n\nYou can inspect your mappings by navigating/printing the `vim.map.mappings` object.\n\n## Events\n\nThe following events are emitted to allow reacting to state changes:\n\n- `normal` when mode changes to normal\n- `insert` when mode changes to insert\n- `write` when a key is written to the underlying `readline` (i.e. it wasn't handled by `readline-vim` and therefore\n  passed through\n\nThese events are exposed via `vim.events`, so to subscribe to normal mode changes you would do:\n\n```js\nvim.events.on('normal', function () {\n  // do something here to react\n});\n```\n\n## Forcing the Readline into a Mode\n\nYou can cause the `readline` to change to a particular mode and pass a `Boolean` to indicate if that mode change should\nbe kept a secret (i.e. no event is emitted).\n\n```js\nvim.forceInsert();      // changes mode to insert and emits 'insert' event\nvim.forceNormal(true);  // changes mode to normal, but emits no event\n```\n\n## Examples\n\n- [simple readline](https://github.com/thlorenz/readline-vim/blob/master/examples/readline.js)\n- [repl](https://github.com/thlorenz/readline-vim/blob/master/examples/repl.js)\n","_id":"readline-vim@0.2.1","dist":{"shasum":"23f3a6961b42acc438e41059a03776c50269f3c4","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.2.1.tgz","integrity":"sha512-Pd9/mIsENCfZK+WDoGy+s2Fdxyd5V3yYO0goM4pQSc1GE1FT/sr8VKDk/ozzIHO2fJ6cEa2YgJ9PUOsoqtAPqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCV3jyhYyKnXzJEGx2Qc9PS8OSi9cQm/jp4oRROSR7GXwIhANVYzhrGMsFz8wqoNCKFV9IY7x/8UCT46rJwXE9J/xQl"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{}},"0.2.2":{"name":"readline-vim","version":"0.2.2","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"demo":"node ./examples/repl","test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"proxyquire":"~0.4.0","sinon":"~1.5.2","readline-testharness":"~0.1.1","tap":"~0.4.0"},"dependencies":{"stringify-key":"~0.1.2","parse-key":"~0.1.1"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim')\n  , repl = require('repl');\n\nvar r = repl.start({\n    prompt: \"vim repl > \",\n    input: process.stdin,\n    output: process.stdout\n  });\n\n// pass the readline component of the repl in order to add vim bindings to it\nvar vim = rlv(r.rli)\n  , map = vim.map;\n\n// Add mappings\n\n// [insert mode] allow switching to normal mode by typing 'jk' quickly \nmap.insert('jk', 'esc');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-k', 'ctrl-p');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-space', 'ctrl-n');\n\n// [normal mode] go backward in history via space bar\nmap.normal('space', 'k');\n\n// [normal mode] go forward in history via space bar when ctrl is pressed \nmap.normal('ctrl-space', 'j');\n```\n\nRun it via: `npm run demo`\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [History](#history)\n- [Mappings](#mappings)\n  - [Immediate Mappings](#immediate-mappings)\n  - [Sequence Mappings](#sequence-mappings)\n  - [Inspecting Mappings](#inspecting-mappings)\n- [Events](#events)\n- [Forcing the Readline into a Mode](#forcing-the-readline-into-a-mode)\n- [Examples](#examples)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`, `C` change line\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`, `D` delete line\n\n- `x` delete right\n- `X` delete left\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n## Mappings\n\n### Immediate Mappings\n\nImmediate mappings execute immediately whe a key (possibly with modifiers) is pressed.\n\nThey can be applied in insert and normal mode.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// emit [esc] when [ctrl-space] is pressed to switch to normal mode\nmap.insert('ctrl-space', 'esc');\n\n// emit [k] when [space] is pressed to go backward in history\nmap.normal('space', 'k');\n```\n\n### Sequence Mappings\n\nSequence mappings are a number of keys **without modifiers** pressed quickly after another.\n\nThey can be applied to **insert mode only**.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// map [jk] pressed in quick succession to [esc] to switch to normal mode\nmap.insert('jk', 'esc');\n```\n\nThe interval allowed between keys in order to count as a sequence can be configured by setting `vim.threshold`, the\ndefault is `200 milliseconds`.\n\n### Inspecting Mappings\n\nYou can inspect your mappings by navigating/printing the `vim.map.mappings` object.\n\n## Events\n\nThe following events are emitted to allow reacting to state changes:\n\n- `normal` when mode changes to normal\n- `insert` when mode changes to insert\n- `write` when a key is written to the underlying `readline` (i.e. it wasn't handled by `readline-vim` and therefore\n  passed through\n\nThese events are exposed via `vim.events`, so to subscribe to normal mode changes you would do:\n\n```js\nvim.events.on('normal', function () {\n  // do something here to react\n});\n```\n\n## Forcing the Readline into a Mode\n\nYou can cause the `readline` to change to a particular mode and pass a `Boolean` to indicate if that mode change should\nbe kept a secret (i.e. no event is emitted).\n\n```js\nvim.forceInsert();      // changes mode to insert and emits 'insert' event\nvim.forceNormal(true);  // changes mode to normal, but emits no event\n```\n\n## Examples\n\n- [simple readline](https://github.com/thlorenz/readline-vim/blob/master/examples/readline.js)\n- [repl](https://github.com/thlorenz/readline-vim/blob/master/examples/repl.js)\n","_id":"readline-vim@0.2.2","dist":{"shasum":"0d187085c96ba079bd91db41a82934d3c21d5d2e","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.2.2.tgz","integrity":"sha512-IUy/4jXtsJEN62Ac+FfzjMxqspv7tVVEkDFa1brBo1feowSW8q1+44Q28O9A87MpGWsNbKHvUZQhEt3L9FtX4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE0K0saHDF6HYthUKDxFqi4J+DytE1yVguePKhFBgEmfAiEAtFZWEFuGjW+Fte489SYdq4zGK0GHWhEHpoP6SlBoimE="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{}},"0.2.3":{"name":"readline-vim","version":"0.2.3","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"demo":"node ./examples/repl","test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"proxyquire":"~0.4.0","sinon":"~1.5.2","readline-testharness":"~0.1.2","tap":"~0.4.0"},"dependencies":{"stringify-key":"~0.1.2","parse-key":"~0.1.1"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim')\n  , repl = require('repl');\n\nvar r = repl.start({\n    prompt: \"vim repl > \",\n    input: process.stdin,\n    output: process.stdout\n  });\n\n// pass the readline component of the repl in order to add vim bindings to it\nvar vim = rlv(r.rli)\n  , map = vim.map;\n\n// Add mappings\n\n// [insert mode] allow switching to normal mode by typing 'jk' quickly \nmap.insert('jk', 'esc');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-k', 'ctrl-p');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-space', 'ctrl-n');\n\n// [normal mode] go backward in history via space bar\nmap.normal('space', 'k');\n\n// [normal mode] go forward in history via space bar when ctrl is pressed \nmap.normal('ctrl-space', 'j');\n```\n\nRun it via: `npm run demo`\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [History](#history)\n- [Mappings](#mappings)\n  - [Immediate Mappings](#immediate-mappings)\n  - [Sequence Mappings](#sequence-mappings)\n  - [Inspecting Mappings](#inspecting-mappings)\n- [Events](#events)\n- [Forcing the Readline into a Mode](#forcing-the-readline-into-a-mode)\n- [Examples](#examples)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`, `C` change line\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`, `D` delete line\n\n- `x` delete right\n- `X` delete left\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n## Mappings\n\n### Immediate Mappings\n\nImmediate mappings execute immediately whe a key (possibly with modifiers) is pressed.\n\nThey can be applied in insert and normal mode.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// emit [esc] when [ctrl-space] is pressed to switch to normal mode\nmap.insert('ctrl-space', 'esc');\n\n// emit [k] when [space] is pressed to go backward in history\nmap.normal('space', 'k');\n```\n\n### Sequence Mappings\n\nSequence mappings are a number of keys **without modifiers** pressed quickly after another.\n\nThey can be applied to **insert mode only**.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// map [jk] pressed in quick succession to [esc] to switch to normal mode\nmap.insert('jk', 'esc');\n```\n\nThe interval allowed between keys in order to count as a sequence can be configured by setting `vim.threshold`, the\ndefault is `200 milliseconds`.\n\n### Inspecting Mappings\n\nYou can inspect your mappings by navigating/printing the `vim.map.mappings` object.\n\n## Events\n\nThe following events are emitted to allow reacting to state changes:\n\n- `normal` when mode changes to normal\n- `insert` when mode changes to insert\n- `write` when a key is written to the underlying `readline` (i.e. it wasn't handled by `readline-vim` and therefore\n  passed through\n\nThese events are exposed via `vim.events`, so to subscribe to normal mode changes you would do:\n\n```js\nvim.events.on('normal', function () {\n  // do something here to react\n});\n```\n\n## Forcing the Readline into a Mode\n\nYou can cause the `readline` to change to a particular mode and pass a `Boolean` to indicate if that mode change should\nbe kept a secret (i.e. no event is emitted).\n\n```js\nvim.forceInsert();      // changes mode to insert and emits 'insert' event\nvim.forceNormal(true);  // changes mode to normal, but emits no event\n```\n\n## Examples\n\n- [simple readline](https://github.com/thlorenz/readline-vim/blob/master/examples/readline.js)\n- [repl](https://github.com/thlorenz/readline-vim/blob/master/examples/repl.js)\n","_id":"readline-vim@0.2.3","dist":{"shasum":"7a82da62f3cd5f7b5ca9465a7ad7538c147f04c7","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.2.3.tgz","integrity":"sha512-Re0ilxD+UwbZXjZg5Yj/6Ncx7P93xG4ImpKk/J+jRe8wzKyqJZJenHhu1sB0e06enaPf3qVPdFEVYvemP78MEw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCphUoNqPAOkUeRS9ZvxebV9VJGwdrWJprL5Nu4YafonAIgM4PjK6k3nQkC/BArXyR0qYKrj4cOMCrus8jvaGh7aCs="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"directories":{}},"0.2.4":{"name":"readline-vim","version":"0.2.4","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"demo":"node ./examples/repl","test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"proxyquire":"~0.4.0","sinon":"~1.5.2","readline-testharness":"~0.1.2","tap":"~0.4.0"},"dependencies":{"stringify-key":"~0.1.2","parse-key":"~0.1.1"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim')\n  , repl = require('repl');\n\nvar r = repl.start({\n    prompt: \"vim repl > \",\n    input: process.stdin,\n    output: process.stdout\n  });\n\n// pass the readline component of the repl in order to add vim bindings to it\nvar vim = rlv(r.rli)\n  , map = vim.map;\n\n// Add mappings\n\n// [insert mode] allow switching to normal mode by typing 'jk' quickly \nmap.insert('jk', 'esc');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-k', 'ctrl-p');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-space', 'ctrl-n');\n\n// [normal mode] go backward in history via space bar\nmap.normal('space', 'k');\n\n// [normal mode] go forward in history via space bar when ctrl is pressed \nmap.normal('ctrl-space', 'j');\n```\n\nRun it via: `npm run demo`\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [Replacements](#replacements)\n    - [History](#history)\n- [Mappings](#mappings)\n  - [Immediate Mappings](#immediate-mappings)\n  - [Sequence Mappings](#sequence-mappings)\n  - [Inspecting Mappings](#inspecting-mappings)\n- [Events](#events)\n- [Forcing the Readline into a Mode](#forcing-the-readline-into-a-mode)\n- [Examples](#examples)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`, `C` change line\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`, `D` delete line\n\n- `x` delete right\n- `X` delete left\n\n#### Replacement\n\n- `r` followed by letter replaces letter under the cursor with the given letter (i.e. `rx`)\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n## Mappings\n\n### Immediate Mappings\n\nImmediate mappings execute immediately whe a key (possibly with modifiers) is pressed.\n\nThey can be applied in insert and normal mode.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// emit [esc] when [ctrl-space] is pressed to switch to normal mode\nmap.insert('ctrl-space', 'esc');\n\n// emit [k] when [space] is pressed to go backward in history\nmap.normal('space', 'k');\n```\n\n### Sequence Mappings\n\nSequence mappings are a number of keys **without modifiers** pressed quickly after another.\n\nThey can be applied to **insert mode only**.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// map [jk] pressed in quick succession to [esc] to switch to normal mode\nmap.insert('jk', 'esc');\n```\n\nThe interval allowed between keys in order to count as a sequence can be configured by setting `vim.threshold`, the\ndefault is `200 milliseconds`.\n\n### Inspecting Mappings\n\nYou can inspect your mappings by navigating/printing the `vim.map.mappings` object.\n\n## Events\n\nThe following events are emitted to allow reacting to state changes:\n\n- `normal` when mode changes to normal\n- `insert` when mode changes to insert\n- `write` when a key is written to the underlying `readline` (i.e. it wasn't handled by `readline-vim` and therefore\n  passed through\n\nThese events are exposed via `vim.events`, so to subscribe to normal mode changes you would do:\n\n```js\nvim.events.on('normal', function () {\n  // do something here to react\n});\n```\n\n## Forcing the Readline into a Mode\n\nYou can cause the `readline` to change to a particular mode and pass a `Boolean` to indicate if that mode change should\nbe kept a secret (i.e. no event is emitted).\n\n```js\nvim.forceInsert();      // changes mode to insert and emits 'insert' event\nvim.forceNormal(true);  // changes mode to normal, but emits no event\n```\n\n## Examples\n\n- [simple readline](https://github.com/thlorenz/readline-vim/blob/master/examples/readline.js)\n- [repl](https://github.com/thlorenz/readline-vim/blob/master/examples/repl.js)\n","_id":"readline-vim@0.2.4","dist":{"shasum":"99b4e9b3205c23122a73ba96136e599a7d0e5c91","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.2.4.tgz","integrity":"sha512-V7Ub4cgAlzFmg8yg45UNBLM/aaWX/+LYvNy+C+4aqihfzGV2LKQ5XZU99tXJHFHIdm71HaWt8bu46OypfmFszw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxUT6ExNTb2uF5B9ezu+1m3LDrfL0dH2HKO8VKM+rRtgIhAP8Ka5a5wMpbU/6YVO4mdBdPp9dfOfjgfwlVTbvfOzK+"}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}]},"0.3.0":{"name":"readline-vim","version":"0.3.0","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"demo":"node ./examples/repl","test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"proxyquire":"~0.4.0","sinon":"~1.5.2","tap":"~0.4.0","readline-testharness":"~0.3.0"},"dependencies":{"stringify-key":"~0.1.2","parse-key":"~0.2.0"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim')\n  , repl = require('repl');\n\nvar r = repl.start({\n    prompt: \"vim repl > \",\n    input: process.stdin,\n    output: process.stdout\n  });\n\n// pass the readline component of the repl in order to add vim bindings to it\nvar vim = rlv(r.rli)\n  , map = vim.map;\n\n// Add mappings\n\n// [insert mode] allow switching to normal mode by typing 'jk' quickly \nmap.insert('jk', 'esc');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-k', 'ctrl-p');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-space', 'ctrl-n');\n\n// [normal mode] go backward in history via space bar\nmap.normal('space', 'k');\n\n// [normal mode] go forward in history via space bar when ctrl is pressed \nmap.normal('ctrl-space', 'j');\n```\n\nRun it via: `npm run demo`\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [Replacements](#replacements)\n    - [History](#history)\n- [Mappings](#mappings)\n  - [Immediate Mappings](#immediate-mappings)\n  - [Sequence Mappings](#sequence-mappings)\n  - [Inspecting Mappings](#inspecting-mappings)\n- [Events](#events)\n- [Forcing the Readline into a Mode](#forcing-the-readline-into-a-mode)\n- [Examples](#examples)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n- `f`, `F`, `t`, `T` followed by letter moves cursor to or up to the given letter\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`, `C` change line\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`, `D` delete line\n\n- `x` delete right\n- `X` delete left\n\n#### Replacement\n\n- `r` followed by letter replaces letter under the cursor with the given letter (i.e. `rx`)\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n## Mappings\n\n### Immediate Mappings\n\nImmediate mappings execute immediately whe a key (possibly with modifiers) is pressed.\n\nThey can be applied in insert and normal mode.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// emit [esc] when [ctrl-space] is pressed to switch to normal mode\nmap.insert('ctrl-space', 'esc');\n\n// emit [k] when [space] is pressed to go backward in history\nmap.normal('space', 'k');\n```\n\n### Sequence Mappings\n\nSequence mappings are a number of keys **without modifiers** pressed quickly after another.\n\nThey can be applied to **insert mode only**.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// map [jk] pressed in quick succession to [esc] to switch to normal mode\nmap.insert('jk', 'esc');\n```\n\nThe interval allowed between keys in order to count as a sequence can be configured by setting `vim.threshold`, the\ndefault is `200 milliseconds`.\n\n### Inspecting Mappings\n\nYou can inspect your mappings by navigating/printing the `vim.map.mappings` object.\n\n## Events\n\nThe following events are emitted to allow reacting to state changes:\n\n- `normal` when mode changes to normal\n- `insert` when mode changes to insert\n- `write` when a key is written to the underlying `readline` (i.e. it wasn't handled by `readline-vim` and therefore\n  passed through\n\nThese events are exposed via `vim.events`, so to subscribe to normal mode changes you would do:\n\n```js\nvim.events.on('normal', function () {\n  // do something here to react\n});\n```\n\n## Forcing the Readline into a Mode\n\nYou can cause the `readline` to change to a particular mode and pass a `Boolean` to indicate if that mode change should\nbe kept a secret (i.e. no event is emitted).\n\n```js\nvim.forceInsert();      // changes mode to insert and emits 'insert' event\nvim.forceNormal(true);  // changes mode to normal, but emits no event\n```\n\n## Examples\n\n- [simple readline](https://github.com/thlorenz/readline-vim/blob/master/examples/readline.js)\n- [repl](https://github.com/thlorenz/readline-vim/blob/master/examples/repl.js)\n","_id":"readline-vim@0.3.0","dist":{"shasum":"972f03cea5f116435639261714a2854e9f3d3611","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.3.0.tgz","integrity":"sha512-/6GOdyQkCFuTj5qmGs1sp2w/6WR8XCsYeR8dRjBFFnkpBZoLrzMHUy856dD8htcfkQJqZVBs6vwG+2v6lKF2AQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxiUJO+AMPCXaXPhvR9Hu+E+koendOEoGh15EMcTcI6wIgXwRnRR0zhb1vc4WutQm5tpZ9b596ytW89TG4p3jAZLI="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}]},"0.3.1":{"name":"readline-vim","version":"0.3.1","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"demo":"node ./examples/repl","test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"proxyquire":"~0.4.0","sinon":"~1.5.2","tap":"~0.4.0","readline-testharness":"~0.3.0"},"dependencies":{"stringify-key":"~0.1.2","parse-key":"~0.2.0"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim')\n  , repl = require('repl');\n\nvar r = repl.start({\n    prompt: \"vim repl > \",\n    input: process.stdin,\n    output: process.stdout\n  });\n\n// pass the readline component of the repl in order to add vim bindings to it\nvar vim = rlv(r.rli)\n  , map = vim.map;\n\n// Add mappings\n\n// [insert mode] allow switching to normal mode by typing 'jk' quickly \nmap.insert('jk', 'esc');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-k', 'ctrl-p');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-space', 'ctrl-n');\n\n// [normal mode] go backward in history via space bar\nmap.normal('space', 'k');\n\n// [normal mode] go forward in history via space bar when ctrl is pressed \nmap.normal('ctrl-space', 'j');\n```\n\nRun it via: `npm run demo`\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [Replacements](#replacements)\n    - [History](#history)\n- [Mappings](#mappings)\n  - [Immediate Mappings](#immediate-mappings)\n  - [Sequence Mappings](#sequence-mappings)\n  - [Inspecting Mappings](#inspecting-mappings)\n- [Events](#events)\n- [Forcing the Readline into a Mode](#forcing-the-readline-into-a-mode)\n- [Examples](#examples)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n- `f`, `F`, `t`, `T` followed by letter moves cursor to or up to the given letter\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`, `C` change line\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`, `D` delete line\n\n- `x` delete right\n- `X` delete left\n\n#### Replacement\n\n- `r` followed by letter replaces letter under the cursor with the given letter (i.e. `rx`)\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n## Mappings\n\n### Immediate Mappings\n\nImmediate mappings execute immediately whe a key (possibly with modifiers) is pressed.\n\nThey can be applied in insert and normal mode.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// emit [esc] when [ctrl-space] is pressed to switch to normal mode\nmap.insert('ctrl-space', 'esc');\n\n// emit [k] when [space] is pressed to go backward in history\nmap.normal('space', 'k');\n```\n\n### Sequence Mappings\n\nSequence mappings are a number of keys **without modifiers** pressed quickly after another.\n\nThey can be applied to **insert mode only**.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// map [jk] pressed in quick succession to [esc] to switch to normal mode\nmap.insert('jk', 'esc');\n```\n\nThe interval allowed between keys in order to count as a sequence can be configured by setting `vim.threshold`, the\ndefault is `200 milliseconds`.\n\n### Inspecting Mappings\n\nYou can inspect your mappings by navigating/printing the `vim.map.mappings` object.\n\n## Events\n\nThe following events are emitted to allow reacting to state changes:\n\n- `normal` when mode changes to normal\n- `insert` when mode changes to insert\n- `write` when a key is written to the underlying `readline` (i.e. it wasn't handled by `readline-vim` and therefore\n  passed through\n\nThese events are exposed via `vim.events`, so to subscribe to normal mode changes you would do:\n\n```js\nvim.events.on('normal', function () {\n  // do something here to react\n});\n```\n\n## Forcing the Readline into a Mode\n\nYou can cause the `readline` to change to a particular mode and pass a `Boolean` to indicate if that mode change should\nbe kept a secret (i.e. no event is emitted).\n\n```js\nvim.forceInsert();      // changes mode to insert and emits 'insert' event\nvim.forceNormal(true);  // changes mode to normal, but emits no event\n```\n\n## Examples\n\n- [simple readline](https://github.com/thlorenz/readline-vim/blob/master/examples/readline.js)\n- [repl](https://github.com/thlorenz/readline-vim/blob/master/examples/repl.js)\n","bugs":{"url":"https://github.com/thlorenz/readline-vim/issues"},"_id":"readline-vim@0.3.1","dist":{"shasum":"d5349e3f1d05ea482e0e8b7369a1162e0f74d091","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.3.1.tgz","integrity":"sha512-snfsEHER6A9VppVI6XMu5efouQ/vpSLod/Q3KMUAxicEvhiC27GRmy2ottdisq05vVen+610dQiGgwv3yzDFJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDwVEhqLvFpNBEH9xx+NfbJ+NP4ntkc9CAiZXdnEC/JxAiEAt2RNbfoFiErJB6QVtZhuk0aHZ1muk44J9Bh2qTM6Wsw="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}]},"0.3.2":{"name":"readline-vim","version":"0.3.2","description":"Adds vim bindings to nodejs readline.","main":"readline-vim.js","scripts":{"demo":"node ./examples/repl","test":"tap test"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"},"keywords":["readline","vim","shortcuts","console","keyboard","keys"],"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"license":"MIT","readmeFilename":"README.md","gitHead":"26f68bc9dc257f5f511165d0949dc97a73b7625d","devDependencies":{"proxyquire":"~0.4.0","sinon":"~1.5.2","tap":"~0.4.0","readline-testharness":"~0.3.0"},"dependencies":{"stringify-key":"~0.1.2","parse-key":"~0.2.0"},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim')\n  , repl = require('repl');\n\nvar r = repl.start({\n    prompt: \"vim repl > \",\n    input: process.stdin,\n    output: process.stdout\n  });\n\n// pass the readline component of the repl in order to add vim bindings to it\nvar vim = rlv(r.rli)\n  , map = vim.map;\n\n// Add mappings\n\n// [insert mode] allow switching to normal mode by typing 'jk' quickly \nmap.insert('jk', 'esc');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-k', 'ctrl-p');\n\n// [insert mode] go backward in history via 'ctrl-k' \nmap.insert('ctrl-space', 'ctrl-n');\n\n// [normal mode] go backward in history via space bar\nmap.normal('space', 'k');\n\n// [normal mode] go forward in history via space bar when ctrl is pressed \nmap.normal('ctrl-space', 'j');\n```\n\nRun it via: `npm run demo`\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [Replacements](#replacements)\n    - [History](#history)\n- [Mappings](#mappings)\n  - [Immediate Mappings](#immediate-mappings)\n  - [Sequence Mappings](#sequence-mappings)\n  - [Inspecting Mappings](#inspecting-mappings)\n- [Events](#events)\n- [Forcing the Readline into a Mode](#forcing-the-readline-into-a-mode)\n- [Examples](#examples)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the expected side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n- `f`, `F`, `t`, `T` followed by letter moves cursor to or up to the given letter\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `ch`: change left\n- `cl`: change right\n- `cc`: change line\n- `C` : change line right\n\n- `db`: delete word left\n- `dw`: delete word right\n- `dh`: delete left\n- `dl`: delete right\n- `dd`: delete line\n- `D` : delete line right\n\n- `x` delete right\n- `X` delete left\n\n#### Replacement\n\n- `r` followed by letter replaces letter under the cursor with the given letter (i.e. `rx`)\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n## Mappings\n\n### Immediate Mappings\n\nImmediate mappings execute immediately whe a key (possibly with modifiers) is pressed.\n\nThey can be applied in insert and normal mode.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// emit [esc] when [ctrl-space] is pressed to switch to normal mode\nmap.insert('ctrl-space', 'esc');\n\n// emit [k] when [space] is pressed to go backward in history\nmap.normal('space', 'k');\n```\n\n### Sequence Mappings\n\nSequence mappings are a number of keys **without modifiers** pressed quickly after another.\n\nThey can be applied to **insert mode only**.\n\nAssuming we defined `vim` and `map` as outlined in the [usage examle](#usage).\n\n```js\n// map [jk] pressed in quick succession to [esc] to switch to normal mode\nmap.insert('jk', 'esc');\n```\n\nThe interval allowed between keys in order to count as a sequence can be configured by setting `vim.threshold`, the\ndefault is `200 milliseconds`.\n\n### Inspecting Mappings\n\nYou can inspect your mappings by navigating/printing the `vim.map.mappings` object.\n\n## Events\n\nThe following events are emitted to allow reacting to state changes:\n\n- `normal` when mode changes to normal\n- `insert` when mode changes to insert\n- `write` when a key is written to the underlying `readline` (i.e. it wasn't handled by `readline-vim` and therefore\n  passed through\n\nThese events are exposed via `vim.events`, so to subscribe to normal mode changes you would do:\n\n```js\nvim.events.on('normal', function () {\n  // do something here to react\n});\n```\n\n## Forcing the Readline into a Mode\n\nYou can cause the `readline` to change to a particular mode and pass a `Boolean` to indicate if that mode change should\nbe kept a secret (i.e. no event is emitted).\n\n```js\nvim.forceInsert();      // changes mode to insert and emits 'insert' event\nvim.forceNormal(true);  // changes mode to normal, but emits no event\n```\n\n## Examples\n\n- [simple readline](https://github.com/thlorenz/readline-vim/blob/master/examples/readline.js)\n- [repl](https://github.com/thlorenz/readline-vim/blob/master/examples/repl.js)\n","bugs":{"url":"https://github.com/thlorenz/readline-vim/issues"},"_id":"readline-vim@0.3.2","dist":{"shasum":"bf34c1f506805b40c0e1fff380ba633fa5162dbd","tarball":"https://registry.npmjs.org/readline-vim/-/readline-vim-0.3.2.tgz","integrity":"sha512-W6biFzE8OyT3dARR1AJT0xmCRAcOcZA/NVd9OTavYSin50sDWzz5uGl9MdtSj6R1WOp84XCtf446jMaUxZvbiA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRl4UXXVxS0lh+aGo7pXvCLYKKGAHyjcK4ScehM11TMQIhANJvJ5DX8k6ytH3wiTkNPXaE858LP0H++66gbSOgnSj3"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"thlorenz","email":"thlorenz@gmx.de"},"maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}]}},"readme":"# readline-vim [![build status](https://secure.travis-ci.org/thlorenz/readline-vim.png)](http://next.travis-ci.org/thlorenz/readline-vim)\n\nAdds vim bindings to nodejs readline.\n\n## Installation\n\n    npm install readline-vim\n\n## Usage\n\n**Repl Example:**\n```js\nvar rlv = require('readline-vim');\nvar repl = require('repl');\n\nvar r = repl.start();\n\n// pass the readline component of the repl in order to add vim bindings to it\nrlv(r.rli);\n```\n\n**Table of Contents**  *generated with [DocToc](http://doctoc.herokuapp.com/)*\n\n- [Vim Bindings](#vim-bindings)\n  - [Insert Mode](#insert-mode)\n  - [Normal Mode](#normal-mode)\n    - [Movements](#movements)\n    - [Movements combined with Actions](#movements-combined-with-actions)\n    - [History](#history)\n\n## Vim Bindings\n\nA subset of vim keybindings is supported by `readline-vim`:\n\n### Insert Mode\n\n- `Esc`, `Ctrl-[`: normal mode\n\n### Normal Mode\n\n- `i`, `I`, `a`, `A`: insert mode with the usual side effects\n\n#### Movements\n\n- `h` cursor left\n- `l` cursor right\n- `w` word right\n- `b` word left\n- `0` beginning of line\n- `$` end of line\n\n#### Movements combined with Actions\n\n- `cb`: change word left\n- `cw`: change word right\n- `cc`, `C` change line\n- `db`: delete word left\n- `dw`: delete word right\n- `dd`, `D` delete line\n- `x` delete right\n- `X` delete left\n\n#### History\n\n- `k` go back in history\n- `j` go forward in history\n\n","maintainers":[{"name":"thlorenz","email":"thlorenz@gmx.de"}],"time":{"modified":"2022-06-26T09:18:19.656Z","created":"2013-01-18T04:31:51.234Z","0.1.0":"2013-01-18T04:31:52.282Z","0.1.1":"2013-01-19T21:50:24.795Z","0.2.0":"2013-01-25T03:52:46.110Z","0.2.1":"2013-01-26T03:15:48.680Z","0.2.2":"2013-01-29T03:39:25.829Z","0.2.3":"2013-01-29T04:33:42.718Z","0.2.4":"2013-01-31T02:27:01.203Z","0.3.0":"2013-02-02T21:15:52.280Z","0.3.1":"2013-10-09T16:03:09.281Z","0.3.2":"2013-10-16T15:07:15.935Z"},"author":{"name":"Thorsten Lorenz","email":"thlorenz@gmx.de","url":"thlorenz.com"},"repository":{"type":"git","url":"git://github.com/thlorenz/readline-vim.git"}}