Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 30 commits into from Feb 24, 2022
Merged

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

merged 30 commits into from Feb 24, 2022

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 join this conversation on GitHub. Already have an account? Sign in to comment
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