Inserting on alternate lines?

14 views
Skip to first unread message

Lifepillar

unread,
Jun 2, 2022, 7:58:40 AMJun 2
to vim...@googlegroups.com
This morning I made a vertical selection with CTRL-V and typed (too)
quickly to prepend a quote to the selected lines. I got something like
this:

"...
...
"...
...
"...
...

For the life of me (pun intended), I cannot do it again. How is it
possible to insert text on alternate lines?

Thanks,
Life.

Tim Chase

unread,
Jun 2, 2022, 8:37:01 AMJun 2
to Lifepillar, vim...@googlegroups.com
Were they long lines that were wrapped?

:set nu list

1 one one one one one one one one
one one one one one one one one$
2 two two two two two two two two
two two two two two two two two$

Using a visual-block selection at the beginning of each line and
using insert at the beginning (`:help v_I`) will put them at the
beginning of each actual line, not the second (wrapped) part of each
line.

There are other ways to insert on alternate lines, but they tend to
require much more intentionality and you'd know you were doing it. :-)

-tim




Lifepillar

unread,
Jun 2, 2022, 3:24:47 PMJun 2
to vim...@googlegroups.com
On 2022-06-02, Tim Chase <v...@tim.thechases.com> wrote:
> On 2022-06-02 11:58, Lifepillar wrote:
>> This morning I made a vertical selection with CTRL-V and typed (too)
>> quickly to prepend a quote to the selected lines. I got something
>> like this:
>>
>> "...
>> ...
>> "...
>> ...
>> "...
>> ...
>>
>> For the life of me (pun intended), I cannot do it again. How is it
>> possible to insert text on alternate lines?
>
> Were they long lines that were wrapped?

Either that or a weird glitch in my terminal. Or a hallucination. I went
through the undo file and I couldn't find that change: all the lines
were quoted. Thanks for taking the time to answer!

🤷
Life.

Reply all
Reply to author
Forward
0 new messages