helix icon indicating copy to clipboard operation
helix copied to clipboard

Expand selection to whole word when pressing `*`

Open magopian opened this issue 2 years ago • 4 comments
trafficstars

Closes #6045

This is an attempt at adding the functionality discussed in this issue (and earlier on matrix).

I'm open to suggestions, I've barely learned Rust, and it was a long time ago and seldom used it, so i'm very... rusty.

Please let me know if this is useful, relevant, and how it could be improved!

magopian avatar Feb 18 '23 18:02 magopian

Thanks for the feedback, I've updated the keymap.md file accordingly 👍

magopian avatar Feb 18 '23 18:02 magopian

nice improvement. going to test it locally. currently was using this config:

"*" = ["move_prev_word_start", "move_next_word_end", "search_selection", "global_search"]

firstrow avatar Mar 25 '23 16:03 firstrow

I think it makes sense to encapsulate the word between \b to prevent overmatching

ubitux avatar Apr 18 '23 10:04 ubitux

I believe Kakoune also adds \b in some cases with *. I think it would be a nice improvement to move our * closer to Kakoune's behavior - though that should be a follow-up PR

the-mikedavis avatar Feb 10 '24 21:02 the-mikedavis