Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[VIM] Visual mode vs inserting

0 views
Skip to first unread message

Andrzej Wasowski

unread,
Apr 16, 2002, 6:44:46 AM4/16/02
to
I am often annoyed with Cut&paste machinery of visual mode. Suppose I
highlite an intended C block in visual mode and I want to passte it
somewhere else. Visual mode is perfect bcs of the nice rectangle selection.

But there two problems:

1. how to cut not only the selected recangle but also the lines
containing it? (so the whole block is deleted from the file but only its
rectangle shape is put in clipboard)? (I normally use x or del).

2. How can I paste the block at selected indentation level but in newly
created lines? (so the recangle is pasted but the surrounding text is
not moved/overlapped) (I normally use p or P).

Behaviour of p and x in visual mode is very nice for many purposes but
in this specific case (reorganizing block of codes) can sometimes be
annoying. Is there any other set of commands / mode I should use?

andrzej


MoonJihad

unread,
Apr 16, 2002, 12:20:32 PM4/16/02
to
On Tue, 16 Apr 2002 12:44:46 +0200, Andrzej Wasowski
<andrzej_wasowskiF...@yahoo.com> wrote:

>1. how to cut not only the selected recangle but also the lines
>containing it? (so the whole block is deleted from the file but only its
>rectangle shape is put in clipboard)? (I normally use x or del).

Are you in visual mode(v) or visual block mode(Ctrl+v)?

>2. How can I paste the block at selected indentation level but in newly
>created lines? (so the recangle is pasted but the surrounding text is
>not moved/overlapped) (I normally use p or P).

You could try re-indenting your code using =.

-MoonJihad

0 new messages