evil-mc icon indicating copy to clipboard operation
evil-mc copied to clipboard

Add command to make a cursor, select the word below the cursor and goto next

Open pengux opened this issue 8 years ago • 7 comments

In vim-easymotion, when pressing C-n, it will select the word below the cursor, pressing it again will find the next occurrence, selects it and create another cursor. It would be nice to have a command which replicate this behaviour. Below is a screenshot of what to expect when pressing C-n twice on the word dotspacemacs

image

pengux avatar Mar 25 '17 14:03 pengux

Evil-mc works almost the same except you have to select the word first. Otherwise, it uses the whole symbol under cursor when pressing C-n

gabesoft avatar Mar 26 '17 05:03 gabesoft

But currently, the selections are lost when a cursor is made. The vim-easymotion behaviors saves keystrokes as most of the time you still want to have the selection left to either cut/replace. I'm happy to make a PR if you could tell me where in the code to look?

pengux avatar Mar 26 '17 05:03 pengux

That's true it would save 2 keystrokes vb although it would cost 1 if the selection is not needed. Let me think about the best way to implement it. Also, we'll probably want to have an option to keep the old behavior if desired by some people.

gabesoft avatar Mar 26 '17 07:03 gabesoft

It saves another keystroke if it could select the word automatically instead of user has to make a selection beforehand. I'd suggest to create new commands for this so the old behavior is kept. Perhaps something like evil-mc-select-make-word-and-goto-next-match

pengux avatar Mar 26 '17 07:03 pengux

Yeah a new command (and a new shortcut) is probably better

gabesoft avatar Mar 26 '17 07:03 gabesoft

Not sure when I'll have time to look at this. So, if you have time feel free to take a shot at it. I'd probably start in evil-mc-cursor-make.el file

gabesoft avatar Mar 26 '17 18:03 gabesoft

@gabesoft since you mentioned it here, it would be nice to make what is selected by default (symbol, word, etc.)

dieggsy avatar Feb 06 '18 01:02 dieggsy