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

feat: new "subword" text object #12026

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

nikitarevenco
Copy link

@nikitarevenco nikitarevenco commented Nov 7, 2024

this is a new text object which operates on parts of snake_case, kebab-case, camelCase, PascalCase and /path/case

It's a subword, so it's mapped to s

Below is a table showcasing various use-cases of this new text object. * is just an indicator for where the cursor is and is not part of the text

mis selects an inner subword, mas selects an outer subword which includes the delimiter. d deletes the selection.

before inner (misd) outer (masd
snake_case_lon*g snake_case_ snake_case
snake_ca*se_long snake__long snake_long
snake__ca*se__longier snake____long snake__long
snake__case__long*ier snake__case__ snake__case
c*amelCaseLong camelCase CaseLong
camelCa*seLong camelLong camelLong
camelCAseNotRE*Ally camelCAseNot camelCAseNot
camelCA*seNotREAlly camelNotREAlly camelNotREAlly
snake_Ri*ding_a_Camel_Case snake__a_Camel_Case snake_a_CamelCase
sn*ake_Riding_a_Camel_Case _Riding_a_Camel_Case Riding_a_Camel_Case
P*ascalCaseLong CaseLong CaseLong
tast*y-kebab-case -kebab-case kebab-case
tasty-kebi*ab-case tasty--case tasty-case
path/som*ewhere/../case path//../case path/../case
../.*./path/case/ ..//path/case ../path/case
../path/case/som*ewhere ../path/case/ ../path/case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant