{"id":22825390,"url":"https://github.com/crabdancing/vscode-kakoune-fork","last_synced_at":"2026-01-30T20:02:00.823Z","repository":{"id":82553588,"uuid":"598314734","full_name":"crabdancing/vscode-kakoune-fork","owner":"crabdancing","description":"patching vscode kakoune plugin to have Helix-like keybindings","archived":false,"fork":false,"pushed_at":"2023-02-06T21:11:31.000Z","size":387,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-12T15:53:49.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ReScript","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/crabdancing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-02-06T21:11:06.000Z","updated_at":"2023-06-09T19:15:29.000Z","dependencies_parsed_at":"2023-03-12T16:09:27.469Z","dependency_job_id":null,"html_url":"https://github.com/crabdancing/vscode-kakoune-fork","commit_stats":null,"previous_names":["a7287/vscode-kakoune-fork"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crabdancing/vscode-kakoune-fork","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fvscode-kakoune-fork","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fvscode-kakoune-fork/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fvscode-kakoune-fork/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fvscode-kakoune-fork/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crabdancing","download_url":"https://codeload.github.com/crabdancing/vscode-kakoune-fork/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crabdancing%2Fvscode-kakoune-fork/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28918235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T19:10:10.838Z","status":"ssl_error","status_checked_at":"2026-01-30T19:06:40.573Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-12-12T17:10:36.277Z","updated_at":"2026-01-30T20:02:00.802Z","avatar_url":"https://github.com/crabdancing.png","language":"ReScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kakoune mode\n_Please send bug reports and feature requests to the [mailing list](https://lists.sr.ht/~reykjalin/vscode-kakoune) via [~reykjalin/vscode-kakoune@lists.sr.ht](mailto:~reykjalin/vscode-kakoune@lists.sr.ht)._\n\n`vscode-kakoune` emulates the input behavior of the [Kakoune](https://kakoune.org) text editor.\n\n# Table of Contents\n\n- [Kakoune mode](#kakoune-mode)\n- [Table of Contents](#table-of-contents)\n- [Keymappings](#keymappings)\n  - [Enter insert mode](#enter-insert-mode)\n  - [Movements and selections](#movements-and-selections)\n  - [Goto mode](#goto-mode)\n  - [Editing the file](#editing-the-file)\n  - [Searching for things to select](#searching-for-things-to-select)\n- [Differences between Kakoune and this plugin](#differences-between-kakoune-and-this-plugin)\n- [Motivation](#motivation)\n- [Why Reason?](#why-reason)\n- [Build instructions](#build-instructions)\n  - [Script to paste into your shell of choice](#script-to-paste-into-your-shell-of-choice)\n- [Current functionality](#current-functionality)\n- [Upcoming functionality](#upcoming-functionality)\n\n# Keymappings\n\nThis plugin emulates modal editing, and will start in normal mode.\nYou can not type in normal mode, until you [enter insert mode](#enter-insert-mode)\n\n## Enter insert mode\n\n| Key | Effect                                                                                               |\n| --: | :--------------------------------------------------------------------------------------------------- |\n| `i` | Moves the cursor to the beginning of the selection and enters insert mode                            |\n| `I` | Moves the cursor to the start of the line and enters insert mode                                     |\n| `a` | Moves the cursor to the end of the selection and enters insert mode                                  |\n| `A` | Moves the cursor to the end of the line and enters insert mode                                       |\n| `o` | Creates a new empty line below the current selection, moves the cursor there, and enters insert mode |\n| `O` | Creates a new empty line above the current selection, moves the cursor there, and enters insert mode |\n| `r` | Enters insert mode without clearing the current selections                                           |\n| `c` | Clears the current selection and enters insert mode                                                  |\n\n## Movements and selections\n\n|       Key | Effect                                                                                                                          |\n| --------: | :------------------------------------------------------------------------------------------------------------------------------ |\n|       `w` | Select the word to the right                                                                                                    |\n|       `W` | Extend selection one word to the right                                                                                          |\n|       `b` | Select the word to the left                                                                                                     |\n|       `B` | Extend selection one word to the left                                                                                           |\n|       `h` | Move caret left                                                                                                                 |\n|       `H` | Extend selection one character to the right                                                                                     |\n|       `j` | Move caret down                                                                                                                 |\n|       `J` | Extend selection to the character below the caret                                                                               |\n|       `k` | Move caret up                                                                                                                   |\n|       `K` | Extend selection to the character above the caret                                                                               |\n|       `l` | Move caret right                                                                                                                |\n|       `L` | Extend selection one character to the left                                                                                      |\n|       `x` | Select the line the current selection is in. If a full line is currently selected, selects the line below the current selection |\n|       `X` | Extend the selection to include the line below the current selection                                                            |\n|       `C` | Extend the selection one line down                                                                                              |\n|       `g` | Enter [goto mode](#goto-mode)                                                                                                   |\n| `\u003cspace\u003e` | Cancel all selections except the primary selection                                                                              |\n|       `;` | Reduce all selections to just the cursor                                                                                        |\n|       `f` | Move the selection from the cursor on to the next instance of the provided character                                            |\n|       `F` | Extend the selection from the cursor on to the next instance of the provided character                                          |\n|       `t` | Move the selection from the cursor to the next instance of the provided character                                               |\n|       `T` | Extend the selection from the cursor to the next instance of the provided character                                             |\n\n## Goto mode\n\nWhen in goto mode you can quickly jump around the file.\nPressing any button (even if it's not part of goto mode) will put you back in normal mode.\n\n| Key | Effect                                     |\n| --: | :----------------------------------------- |\n| `h` | Move caret to the start of the line        |\n| `H` | Extend selection to the start of the line  |\n| `j` | Move caret to the bottom of the file       |\n| `J` | Extend selection to the bottom of the file |\n| `k` | Move caret to the start of the file        |\n| `K` | Extend selection to the start of the file  |\n| `l` | Move caret to the end of the line          |\n| `L` | Extend selection to the end of the line    |\n\n## Editing the file\n\n| Key | Effect                                                 |\n| --: | :----------------------------------------------------- |\n| `d` | Cuts the current selections                            |\n| `y` | Copies the current selections                          |\n| `p` | Pastes from the clipboard after the current selection  |\n| `P` | Pastes from the clipboard before the current selection |\n| `u` | Undo                                                   |\n| `U` | Redo                                                   |\n| `\u003e` | Increase indentation                                   |\n| `\u003c` | Decrease indentation                                   |\n\n## Searching for things to select\n\n| Key | Effect                                                                             |\n| --: | :--------------------------------------------------------------------------------- |\n| `s` | Regex search the current selections and select every instance of text that matches |\n| `/` | Regex search the whole file and select every instance of text that matches         |\n\n# Differences between Kakoune and this plugin\n\nThe goal is not to emulate Kakoune perfectly, but to emulate Kakoune using VSCode's default-ish behaviors.\nThis is mostly done to make my life easy when implementing any features; I try to use VSCode's built in movements, selections, etc. instead of implementing my own.\nDoing has several benefits:\n\n1. The code is easier to understand.\n1. There is _way_ less code.\n1. There will be fewer bugs.\n\nOf course the downside is that VSCode will be some sort of mish-mash between Kakoune and VSCode functionality, and there **will be inconsitencies**.\n\nAll of that said I'm very open to implementing some custom functionality if there is a valid reason to do so, e.g. if some very useful Kakoune feature would not work using VSCode functionality.\n\nJust to make it easier to figure out what's actually different, here's a table with the documented differences:\n\n|               Command | vscode-kakoune                                                     | Kakoune                                                                         |\n| --------------------: | :----------------------------------------------------------------- | :------------------------------------------------------------------------------ |\n|       `h`/`j`/`k`/`l` | Moves the _cursor_ left/down/up/right.                             | Selects one character left/down/up/right.                                       |\n|                   `p` | Pastes after the current selections. Does not restore selections.  | Pastes after the current selections without affecting them.                     |\n|                   `P` | Pastes before the current selections. Does not restore selections. | Pastes before the current selections without affecting them.                    |\n|                   `d` | Deletes and copies all selections.                                 | Deletes all selections, but only copies the first.                              |\n| `jk` (in insert mode) | Exits insert mode.                                                 | N/A                                                                             |\n|                   `r` | Enters insert mode without clearing the selection.                 | Replaces every character in the selection with the character pressed after `r`. |\n\n# Motivation\n\nI've been [trying to find a good code editor](https://thorlaksson.com/post/its-2019-why-dont-we-have-good-code-editors) for day to day use and haven't really been able to find one.\nVSCode provides the best overall experience, but I want a modal editor so I need to rely on extensions.\nCurrently I use the Vim extension for VSCode to simulate Vim, but I like the Kakoune way of doing things so much better.\nSince there's no proper Kakoune mode plugin I decided I might as well just work on it myself!\n\n# Why Reason?\n\nI've been wanting to learn a functional language for a long time and while working on this project I came across [Reason](https://reasonml.github.io/) and [Fable](https://fable.io/).\nReason allows you to compile OCaml to JavaScript, and Fable compiles F# to JavaScript.\nBoth languages looked like good candidates, and at first I decided to go with F# because I liked the structure and syntax of the language more than OCaml and Reason.\n\nHowever, after using Fable for a bit, I felt that the documentation was [a bit lacking](https://thorlaksson.com/post/calling-fable-from-typescript), and the JavaScript interoperability—while usable—isn't great.\nSo I tried to use Reason, and I find the JavaScript interop much more user friendly and terse.\nThe codebase in Reason is a bit smaller, mostly thanks to less glue code for JavaScript interop.\n\nThe Reason tooling is also much better.\nThe F# tooling for VSCode can feel a bit slow, often taking ~1sec to think for auto-completions and types, and you need to compile manually (or use a watcher) while developing.\nThe Reason tooling is relatively fast, auto-completions come in instantly, and the toolchain is fast enough to **recompile automatically after every save, without needing to run a watcher**, which is an immense productivity boost.\n\nMy reason for looking into these 2 frameworks is that I wanted to use a functional language for features such as pattern matching, currying, and pipes (`|\u003e` and `-\u003e` in Reason).\nI think there are many functions that can be made simpler and smaller by using these constructs and unfortunately JavaScript isn't optimal for this; it's more difficult to write functional code in JavaScript than it is to write imperative code.\n\nType safety is also a big consideration, although you do get that with TypeScript, just not to the same extent.\nJavaScript/TypeScript concepts like `undefined`, `null`, and `any` make the type system more complicated than I'd like it to be.\n\n**There are some downsides to this**, particularly in the form of glue code.\nThe best example is probably `src/VSCode.re` where I've mapped the part of the VSCode API I use to Reason types.\nMost of this code still looks like Reason, which was not the case with F#.\n\n# Build instructions\n\nYou'll need to have `npm` or `yarn` installed.\n\n## Script to paste into your shell of choice\n\n```sh\nnpm install\nnpm run build\n```\n\n# Current functionality\n\n- Basic movements and selections via `w`/`b`, `h`/`j`/`k`/`l`.\n- Basic selections extensions via `W`/`B`, `H`/`J`/`K`/`L`.\n- Basic goto commands via `gh`, `gj`, `gk`, `gl`.\n- Basic goto selections via `Gh`, `Gj`, `Gk`, `Gl`.\n- Enter insert mode with `i`, `I`, `r`, `o`, `O`, and `A`.\n- Copy/cut/paste via `y`/`d`/`p`.\n- Select and edit multiple selections with a regex via `s` and `/`.\n\n# Upcoming functionality\n\n1. Repeat previous command via `.`.\n1. (Maybe) Make some indication of what mode you're in?\n1. (Maybe) Don't overwrite selection in insert mode.\n1. (Maybe) Handle pasting the same as Kakoune does.\n1. (Maybe) Handle replace mode the same as Kakoune.\n1. (Maybe) `:` commands, e.g. `:w` for saving, etc.\n   - Show pop up (Ctrl+P like menu) during search and `:` commands.\n     - Show suggestions from the Kakoune clippy in pop up.\n1. (Maybe) Record macros.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrabdancing%2Fvscode-kakoune-fork","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrabdancing%2Fvscode-kakoune-fork","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrabdancing%2Fvscode-kakoune-fork/lists"}