Closed breandan closed 6 years ago
None of the selection commands from the Edit menu work with ideavim (extend/select all/etc.), so it's not just you.
Looks like the equivalence of visual mode and selection only works for selections initiated from ideavim's editor pane. Also looks like visual mode in general is fairly buggy (preceding counts don't seem to work right, etc.) so this one may be a hard one to fix.
OK, this is significant: https://youtrack.jetbrains.com/issue/VIM-510. Selection operations and visual mode don't mix unless you're in visual mode before doing the operation in question.
The bad news is that :action AceAction (or more accurately, :\<5 backspaces>action AceAction) doesn't work in visual mode--IdeaVim kicks you out of visual mode before executing the action. And I guess you can't vmap to a non-IdeaVim key, so \
What does work is hitting v to go into visual mode, then hitting C-;. If one uses a shifted tag, it'll extend visual mode to just before the jump target, then you can operate on it as expected with d or whatever.
If one does not use a shifted tag, the behavior is a little weird, though. It doesn't extend visual mode immediately, but the next navigation key will extend visual as if it had. So, if I jump to foo and hit right, everything from the jump origin through the first f will now be selected.
TL;DR: this is plumbing the grey area between IDE and IdeaVim, and there be dragons.
@geoelectric This is really helpful, thanks for investigating.
Turning this over to IdeaVim, please follow VIM-510 for updates.
@vlasovskikh Any chance of using a common editor selection model? This would be great.
@breandan Yes, it's possible, but it would require a medium-to-large refactoring of the Vim Visual Mode emulation. VIM-510 mostly covers it.
Need to investigate why AceJump's Shift selection is not recognized by IdeaVim (ie. why does AceJump's text selection command not work with
d
in Vim's normal mode)? We should be able to select text from the cursor to a location with AceJump and pressd
in Vim to delete.