Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Add emulation of word motion in Vim(e.g. w, b, e)#75

Merged
pit-ray merged 30 commits intomasterfrom
add-57
Feb 24, 2022
Merged

Add emulation of word motion in Vim(e.g. w, b, e)#75
pit-ray merged 30 commits intomasterfrom
add-57

Conversation

@pit-ray
Copy link
Owner

@pit-ray pit-ray commented Feb 19, 2022

Add word-motion, which behaves almost exactly like the original Vim.

Outline

  • Capture text containing a few words with the clipboard.
  • Break grapheme cluster with ICU to synchronize cursor and string positions. In fact, you can optionally specify whether to split by code points or by grapheme cluster.
  • Then, based on the code points, the punctuation character is determined using an function based on utf_class in Vim.
    (ref. https://github.com/vim/vim/blob/master/src/mbyte.c#L2787-L2903)
  • Move the cursor based on the punctuation.

@pit-ray pit-ray linked an issue Feb 19, 2022 that may be closed by this pull request
@pit-ray pit-ray added the enhancement New feature or request label Feb 19, 2022
@pit-ray pit-ray modified the milestone: 4.4.0 Feb 19, 2022
@pit-ray pit-ray merged commit 71c3260 into master Feb 24, 2022
@pit-ray pit-ray deleted the add-57 branch February 27, 2022 14:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Implement E and e emulation.

1 participant