V-Block Multi-line insert

15 views
Skip to first unread message

Marc Jessome

unread,
Oct 3, 2012, 10:59:03 AM10/3/12
to vim...@googlegroups.com
Hello,

It is possible to do a visual block insert into multiple lines, through
<C-v>, select a column spanning the lines you want to edit, then
pressing 'I'. I use this fairly often, but it doesn't seem to work with
deletion.

Example being: <C-v>jjI<Del><Del><Esc>
Which doesn't delete two characters from each line.

Is there any way to get this working with deletes?

I am also curious if it is possible to do a selection that skips lines
so that I could, say, insert the letter 'a' at the beginning of lines
10-15, 18 and 20.

Thanks
Marc

Ben Fritz

unread,
Oct 3, 2012, 11:18:29 AM10/3/12
to vim...@googlegroups.com
On Wednesday, October 3, 2012 9:59:13 AM UTC-5, Marc Jessome wrote:
> Hello,
>
>
>
> It is possible to do a visual block insert into multiple lines, through
>
> <C-v>, select a column spanning the lines you want to edit, then
>
> pressing 'I'. I use this fairly often, but it doesn't seem to work with
>
> deletion.
>
>
>
> Example being: <C-v>jjI<Del><Del><Esc>
>
> Which doesn't delete two characters from each line.
>
> Is there any way to get this working with deletes?
>

Sure, just don't use I:
<C-v>jjlld

>
>
> I am also curious if it is possible to do a selection that skips lines
>
> so that I could, say, insert the letter 'a' at the beginning of lines
>
> 10-15, 18 and 20.
>

Nope.

But there plugins. Here's a couple, there are probably more:

http://www.vim.org/scripts/script.php?script_id=953
https://github.com/felixr/vim-multiedit

Marc Jessome

unread,
Oct 3, 2012, 11:28:19 AM10/3/12
to vim...@googlegroups.com


On 03/10/12 11:18 AM, Ben Fritz wrote:
> On Wednesday, October 3, 2012 9:59:13 AM UTC-5, Marc Jessome wrote:
>> Hello,
>>
>>
>>
>> It is possible to do a visual block insert into multiple lines, through
>>
>> <C-v>, select a column spanning the lines you want to edit, then
>>
>> pressing 'I'. I use this fairly often, but it doesn't seem to work with
>>
>> deletion.
>>
>>
>>
>> Example being:<C-v>jjI<Del><Del><Esc>
>>
>> Which doesn't delete two characters from each line.
>>
>> Is there any way to get this working with deletes?
>>
>
> Sure, just don't use I:
> <C-v>jjlld
>

Of course, not sure why I was over-complicating things here.

>>
>>
>> I am also curious if it is possible to do a selection that skips lines
>>
>> so that I could, say, insert the letter 'a' at the beginning of lines
>>
>> 10-15, 18 and 20.
>>
>
> Nope.
>
> But there plugins. Here's a couple, there are probably more:
>
> http://www.vim.org/scripts/script.php?script_id=953
> https://github.com/felixr/vim-multiedit
>

Will give these a shot, thanks for pointing me in the right direction.

Thanks,
Marc
Reply all
Reply to author
Forward
0 new messages