AceJump
AceJump copied to clipboard
Unable to do `df` motion with ideavim
Describe the bug
Unable to do df
motion with ideavim.
To Reproduce Steps to reproduce the behavior:
- Install & Enable the AceJump plugin
- Add the following to .ideavimrc:
" Press `f` to activate AceJump
map f :action AceAction<cr>
" Press `F` to activate Target Mode
map F :action AceTargetAction<cr>
" Press `g` to activate Line Mode
map g :action AceLineAction<cr>
(taken from the readme)
4. Go to a file with some text. Hit df
and see action AceAction
being pasted on the current cursor position
Expected behavior
I expect to be able to use the df[char]
vim motion to delete forward to a given char.
Screenshots
Desktop (please complete the following information):
- OS: macOS Monterey
- IDE and version: PHPStorm 2021.3.2
- AceJump version: 3.8.5
Thank you for reporting. The documentation for IdeaVim bindings could be improved, but I don't think this is a bug with AceJump specifically. If you want to delete to a character using the suggested .ideavimrc
configuration, first type f to activate AceJump, then search for some text. When it comes time to make the final jump, press and hold Shift, then type the tag character to select all text from the current cursor position to that destination. Finally, press x to delete the text. Does that make sense?
Thanks, and yes it makes sense! I just have to retrain my brain to not use df
anymore.
But I still find it odd that the text action AceAction
is pasted at the current cursor position. It looks like it tries to do something, but fails
Yes, that is odd. I can reproduce, but I think it might be an issue for IdeaVim. Perhaps we could suggest better defaults. There are other mappings that only apply in certain modes.
I did implement support (or hack) for supporting IdeaVim with d/c/y
followed by AceJump commands in my fork: https://github.com/chylex/IntelliJ-AceJump/blob/c31ba609099058c3f7fa38255e58b5e40a0817de/src/main/kotlin/org/acejump/vim/AceVimHandler.kt
If there's interest, I can look into adding support into upstream AceJump, though having support from IdeaVim's side sounds like a better idea, so maybe I could look into a PR for IdeaVim first.