Re: ViEmu and "Surround With" command

I'm new to ViEmu (and quite new to VI, too), so maybe I'm just overlooking something, but...
I can't find a way to use the "Surround With" command from the VS text editor context menu (CTRL-K-S). The listbox containing the snippets opens, but I'm not able to use e.g. the arrow keys to move within the list of snippets. Anyone can help?

TIA, Phaidros


Re: ViEmu and "Surround With" command

Hello. I haven't ever used it, so it's easy there is some kind of bug. I'll check it and get back to you later today. Thanks!


Re: ViEmu and "Surround With" command

I've checked it... not weird that I didn't know about it, I still use mostly VS.NET 2003, and when I use VS2005, I use C++, where the command is not supported.

The case is similar to what happens with Intellisense autocompletion: for it to work, ViEmu needs to pass through the arrow keys. ViEmu does this when in insert mode, which solves the interaction with Intellisense (and other 3rd party autocompletions). But to have the SurroundWith command work, ViEmu would need to detect that the command has been triggered (and how long it lasts). This is easier said than done smile

Anyway, I will look for a way to make it work and let you know.

Thanks for reporting the wrong behavior!


Re: ViEmu and "Surround With" command

I just wanted to chime in and say that I have the same problem.

I *love* vi/vim although I am by no means a super-power-user, I would say I'm an above-average user.

I use the Surround-With code snippets very heavily, and not being able to use them with ViEmu prevents me from actually using ViEmu!  I really want to use ViEmu!  Please, find a way to fix this, I'd greatly appreciate it.


Re: ViEmu and "Surround With" command


I have just built & uploaded ViEmu, which fixes this:


It's necessary to manually uninstall the previous version of ViEmu before installing this one.

It enters a special 'passthrough' mode when it detects the SurroundWith command, and it leaves the mode as soon as ESC or ENTER are pressed. This lets the 'SurroundWith' interface operate properly.

Please let me know if something else doesn't work fine.


Re: ViEmu and "Surround With" command

Thanks for the update!  I finally had a chance to give it a try. 

It works great if I'm already in insert-mode, but if I'm not in insert mode, it still has issues.

For example:
  1. Press escape
  2. Highlight a block of code, (by using the mouse, or pressing 'v', and then pressing 'j' a couple times.)
  3. Press ctrl-k-s in order to bring up the Surrounds-With intellisense popup
  4. Choose the surrounds-with snippet I desire, and press enter
  5. Stuck.

The snippet successfully expands/executes, but any fields that I'm able to type-into/tab-through when in insert-mode are no inexcessable. I can't enter text because it's not in insert-mode. Pressing 'i' doesn't enter insert mode. Pressing Enter only moves to the next line, instead of finalizing the snippet.  The only way to end the snippet-expansion is to press escape, excepting the default values provided by the snippet.

I hope my rambling explanation makes sense. big_smile


Re: ViEmu and "Surround With" command

Ok... I'm not familiar with the command, so I didn't realize it required entering insert mode afterwards. I will prepare a build that automatically enters insert mode and will wait for your feedback. I'll need 1 or 2 days to get around to it though.



Re: ViEmu and "Surround With" command

I've uploaded which enters insert mode automatically:


Needs a manual uninstall of the previous version. It seems to work fine with the snippet on, using TAB to move from one field to the next, etc... Let me know if something's not fine.


Re: ViEmu and "Surround With" command

Not exactly the same issue, but I really like the Visual Assist "surround selection on ..." features (options->text editor->general), specifically the { version... Is there any way to use these while also using ViEmu?


Re: ViEmu and "Surround With" command

Raoul, I'll have a look at it and let you know whether I can do something about it. I am right working in the final touches for 2.0, but I'll address it afterwards.