vim: is there a way to C-V a text object?

26 views
Skip to first unread message

ping

unread,
Nov 19, 2012, 5:03:26 PM11/19/12
to vim...@googlegroups.com
looks currently "C-v i/a p" is same as "v i/a p" for a paragraph...

Tim Chase

unread,
Nov 19, 2012, 5:08:02 PM11/19/12
to vim...@googlegroups.com, ping
On 11/19/12 16:03, ping wrote:
> looks currently "C-v i/a p" is same as "v i/a p" for a paragraph...

Does the following do what you want?

v i/a p C-v

which should select the paragraph characterwise, then turn it into a
visual-block.

-tim



ping

unread,
Nov 19, 2012, 5:15:56 PM11/19/12
to Tim Chase, vim...@googlegroups.com
I don't understand...what is that "vs" do?

v i/a p     : I visually select the whole paragraph, so far OK
v           : I turn to visual block, but only select the column where my cursor is
s           : it looks my cursor goes to command line now? strange... how to proceed?


On 11/19/2012 05:08 PM, Tim Chase wrote:
On 11/19/12 16:03, ping wrote:
looks currently "C-v i/a p" is same as "v i/a p" for a paragraph...
Does the following do what you want?

  v i/a p C-vs

which should select the paragraph characterwise, then turn it into a
visual-block.

-tim




ping

unread,
Nov 19, 2012, 5:19:37 PM11/19/12
to Tim Chase, vim...@googlegroups.com
I guess you mean:

v i/a p Ctrl-v$

?

that works, a bit too much strokes though...

thanks.

ping

unread,
Nov 19, 2012, 5:23:04 PM11/19/12
to Tim Chase, vim...@googlegroups.com
sorry, that doesn't even work well...
it only assume you 1st move your cursor to the 1st column, otherwise
only "half" block of paragraph got selected.

still need some help here...

Paul

unread,
Nov 19, 2012, 5:58:34 PM11/19/12
to vim...@googlegroups.com
On Monday, 19 November, 2012 at 22:23:04 GMT, ping wrote:
>>I guess you mean:
>>
>>v i/a p Ctrl-v$
>>
>>?
>>
>>that works, a bit too much strokes though...
>
>sorry, that doesn't even work well...
>it only assume you 1st move your cursor to the 1st column, otherwise
>only "half" block of paragraph got selected.
>
>still need some help here...

0vip<c-v>$

--

.

Tim Chase

unread,
Nov 19, 2012, 8:09:02 PM11/19/12
to ping, vim...@googlegroups.com
On 11/19/12 16:15, ping wrote:
> I don't understand...what is that "vs" do?
>
> v i/a p : I visually select the whole paragraph, so far OK
> v : I turn to visual block, but only select the column where
> my cursor is
> s : it looks my cursor goes to command line now? strange...
> how to proceed?
>
>
> On 11/19/2012 05:08 PM, Tim Chase wrote:
>> On 11/19/12 16:03, ping wrote:
>>> looks currently "C-v i/a p" is same as "v i/a p" for a paragraph...
>> Does the following do what you want?
>>
>> v i/a p C-vs

Sorry, the "s" was a fat-fingered accident. Should just have just been

v i/a p C-v

which will do what I think you want (since the only description you
gave was "a way to C-V a text object").

If you want something other than that, you'll have to describe what
you want more clearly.

-tim


stosss

unread,
Nov 19, 2012, 8:18:32 PM11/19/12
to vim...@googlegroups.com
Tim,

Notice your first reply does not have the s. How it got there for ping
is very strange.

Christian Brabandt

unread,
Nov 20, 2012, 2:28:37 AM11/20/12
to vim...@googlegroups.com
On Mon, November 19, 2012 23:03, ping wrote:
> looks currently "C-v i/a p" is same as "v i/a p" for a paragraph...

I don't understand. Can you please explain, what you are trying to do?
I am not sure <Ctrl-V> and paragraph actually makes sense here.

regards,
Christian

ping

unread,
Nov 20, 2012, 7:32:14 AM11/20/12
to vim...@googlegroups.com, Christian Brabandt
it makes sense, at least for me, in the case that I want to paste a new column.

say I have my text like this:

    interfac
     qos-pro
     encapsu
     ip desc
     ip sa-v
     ip addr
     no ip r

    e seria
    file "I
    lation
    ription
    alidate
    ess 65.
    edirect

how do I move the 2nd paragraph and clue it to the 1st?

currently manually I can only copy it like this:

go to 2nd P and put my cursor exactly at left-up corner letter "e"
c-v and move down to left-bottom corner letter "e"
$
y

that said,  0vip<c-v>$ OR ^vip<c-v>$ , or using } only works if the text object happen to start from 1st column.
in case of indented Paragraph, there seems no way to change the highlighted columns (to make it start from 1st column e instead of all) once selected via "v a p".


=======================
and b.t.w, your NrrwRgn is nice!

ping

unread,
Nov 25, 2012, 9:33:36 PM11/25/12
to vim...@googlegroups.com, Christian Brabandt
FYI finally I defined a new map like this:

nn ,v {+vip<c-v>$

and it works well.


Reply all
Reply to author
Forward
0 new messages