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

Move cursor next/prev custom options like we have for delete and backspace. (enhancement) #27

Open
j-a-s-o-n-g opened this issue Jan 5, 2022 · 2 comments

Comments

@j-a-s-o-n-g
Copy link

j-a-s-o-n-g commented Jan 5, 2022

I'm aware of all the camelhumps modes in IntelliJ where they treat camelcase and snakecase as different words, but hyphen words are always treated as different words and there's currently no way around this AFAIK.

I would like to have a selection mode with the same regex pattern for "next/prev word" so I can use both \w and "-".

Test cases: | = cursor, [is final selection]

|this word test random
|thisIsAlsoAWord test random
|This_is_a_Word
|this_is_a_word
|this-word.extension

Becomes:

[this] word test random
[thisIsAlsoAWord] test random
[This_is_a_Word]
[this_is_a_word]
[this-word].extension

The options don't have to be so elaborate for this, if you want to just throw in a keymap for:

  • "Move caret Next Word (and hyphens)"
  • "Move caret Previous Word (and hyphens)"
  • "Move caret Next Word (and hyphens) with Selection"
  • "Move caret Previous Word (and hyphens) with Selection"

hard coded to work like the examples above, that would be great!

@krasa
Copy link

krasa commented Jan 16, 2022

Relates to krasa/StringManipulation#165

@vsch
Copy link
Owner

vsch commented Mar 9, 2023

The customized word next/prev start/end/ customized does have some flexibility. You can configure them to only treat space delimited ranges as one word but that would include any delimiters other than spaces so abc.def would also be considered a word.

Adding a regex like the backspace/delete is an idea. I did not include it because I wasn't sure anyone would want to go that far at customizing it.

Screenshot_CustomizedWord

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

No branches or pull requests

3 participants