{"id":14978955,"url":"https://github.com/thlorenz/readline-vim","last_synced_at":"2025-10-13T04:38:08.169Z","repository":{"id":6439424,"uuid":"7678374","full_name":"thlorenz/readline-vim","owner":"thlorenz","description":"Adds vim bindings to nodejs readline.","archived":false,"fork":false,"pushed_at":"2013-10-16T15:07:13.000Z","size":314,"stargazers_count":56,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-03T12:45:06.000Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thlorenz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-18T01:58:56.000Z","updated_at":"2024-04-09T21:51:11.000Z","dependencies_parsed_at":"2022-09-26T22:01:27.484Z","dependency_job_id":null,"html_url":"https://github.com/thlorenz/readline-vim","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/thlorenz/readline-vim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Freadline-vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Freadline-vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Freadline-vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Freadline-vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thlorenz","download_url":"https://codeload.github.com/thlorenz/readline-vim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thlorenz%2Freadline-vim/sbom","scorecard":{"id":881938,"data":{"date":"2025-08-11","repo":{"name":"github.com/thlorenz/readline-vim","commit":"4890a0d6c3b346336a3dc502bda3e43bc219885f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T08:32:42.265Z","repository_id":6439424,"created_at":"2025-08-24T08:32:42.265Z","updated_at":"2025-08-24T08:32:42.265Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273776140,"owners_count":25166024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T13:58:42.883Z","updated_at":"2025-10-13T04:38:03.148Z","avatar_url":"https://github.com/thlorenz.png","language":"JavaScript","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 \u003e \",\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Freadline-vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthlorenz%2Freadline-vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthlorenz%2Freadline-vim/lists"}