wincent / scalpel

🔪 Fast within-file word replacement for Vim
MIT License
118 stars 4 forks source link

How to use scalpel with visual mode selection #3

Closed kyhy closed 8 years ago

kyhy commented 8 years ago

How are you suppose to use visual mode selection?

I tried visually selecting a few words then pressing default keybinding . However, it only selects the first word of the selection.

wincent commented 8 years ago

Right. It's intended as a tool to replaces instances of a word, and when you use it inside a visual selection you're replacing instances of the word within the selection.

This imposes some natural limitations. For example, you can't visually select lines 1 through 10 and then move the cursor up to line 5 in order to place the cursor on a word there (because that will change the visual selection to lines 1 through 5).

I'm going to close this for now, but let me know if you have any further questions.

kyhy commented 8 years ago

I see, thank you for the explanation! For variables, I often use '-' to separate words, i.e. some-example-name

is there a way to define what a "word" is? or is it limited by how vim defines as a word object?

wincent commented 8 years ago

It is using <cword>, but we could configure it to use <cWORD>, I guess, or you could change what <cword> targets by setting 'iskeyword'. All of those are documented in the Vim help.