Re: Selecting a block

public class MyClass
   public class MyMethod()
       // I am here

Is there a way to select everything in MyMethod()?




Re: Selecting a block

Place your cursor in the opening curly bracket and press vi{, this will select the inner text block of your method, if you want to select the entire method, including the declaration and the curly brackets, put your cursor anywhere on the line public class MyMethod() and press Vj%  or 0vj% .




Re: Selecting a block

cms, thanks for providing the explanation - shane, cms's explanation is perfect.

Just to extend it a tiny little bit, you can use 'iB' and 'aB' as alternative spellings of 'i{' and 'a{' ('i}' and 'a}' also work).




Re: Selecting a block

EDIT: Looks like you already addressed this in another thread which I happened to find after posting this. I'll leave my post, but consider my question answered smile

Just to add on this without creating a new thread, is it possible to do: vi" or ci" in viEmu?
I've tried it, but it doesn't work. I'm sure you know what it does, but just to be sure we're on the same page.

Using vi" would select everything that's within the string "" block that you're in.

This is particularly useful for editing strings inside a method call:

Console.WriteLine("I am here " + "I am there");

Using ci" inside the 'I am here' string block, I could edit just that string portion of that line, without affecting "I am there".

Also, the addition of vit, or cit, would be tremendously helpful for when working in XML..
vit would select the text between XML element nodes.

Last edited by perryjh (2008-03-26 08:29:54)


Re: Selecting a block

Hi Perry,

Indeed, text object motions ('i', 'a') with a <'> or <"> argument are not implemented. I'm planning to implement a probably basic version for ViEmu 2.2, which will help in more cases. tag-based 'it' is more complex, but I'll have a look too.

I totally understand the wish for having all of them.


  - Jon