In visual mode, IntelliJ's native "Surround selection on typing" feature is conflicted with Ideavim, how can I fix that #1321
|
In IntelliJ IDEA, I can select text and type a bracket/quote to automatically wrap the selection But these are all not working, how can I fix that? Thanks for help! |
Replies: 1 comment 2 replies
|
I don't think that you can unset handling of keys like this (but I might be wrong). Another approach would be to do surround the "vim way". There is a plugin that does what you describe, though the mapping is a bit different: https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins#surround-adds-provides-mappings-to-easily-delete-change-and-add-surroundings-in-pairs In Visual mode, you can do |
Yeah, you can't unmap these as they aren't maps, but built in Vim commands.
(is a built in motion for Normal and Visual mode, and can't be unmapped.sethandlerdoesn't work either, because that's a mechanism to solve conflicts with IDE shortcuts, and(isn't an IDE shortcut, it's just a character that can be typed.But, there is something you can do.
(is a Vim command in Normal and Visual, but not in Select mode. So you could switch your Visual selection to Select mode (<C-G>) and then type any character as a normal character. Hitting(now would cause the IDE to surround the selection.And if you can do it manually, you can set up a mapping for it too. So you could use something like: