How can I record a "(" in a macro in vsVim?
Asked Answered
T

1

3

I'm trying to record a macro that will type a small chunk of text that contains a parenthesis "(", whenever I try to play the macro it doesn't type the "();" at the end of the line.

My guess is that parenthesis in a macro may have some special meaning but in my case, I just wanna type in "(".

What's breaking my macro? How can I get the parenthesis to be typed?

(note: I'm using the Visual Studio vsVim plugin)

Edit: I can't remember the exact macro anymore, but it went something along the lines of this:

q a 5 j ^ 2 w i .EndInit(); esc q

It was supposed to append .EndInit(); on every 5th line but the output was just .EndInit.

Note that on other machine without the resharper plugin, this problem doesn't occur!

Tharp answered 30/4, 2015 at 20:25 Comment(5)
What is the macro? ( is not specialNorthcutt
that makes me wonder if visual studio or resharper are "eating" the parenthesis before they get sent to vsVim, I noticed vsVim macros don't work well with visual studio's autocomplete feature (code completed by visual studio is not recorded by vsVim)Tharp
I don't use the plugin does :echo @a return anything? It should be the contents of the macro.Northcutt
I'm not on my working machine anymore, but tried to replicate the issue on my home machine (vsVim without resharper), the issue didn't happen at all and the echo returned the string with parenthesis, seems to be an issue with resharperTharp
@EduardoWada This question requires Visual Studio expertise to answer, and not Vi or Vim expertise; SO is a much better place for this question :-)Posology
D
2

The most likely issue here is that R# is eating the ( keystroke. This means it never makes it to VsVim and hence doesn't get recorded as part of the macro.

The following issue tracks cleaning this up. It would include fixes for R# as well.

https://github.com/jaredpar/VsVim/issues/1393

Daggna answered 2/5, 2015 at 23:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.