Quantcast

How to do block pasting?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to do block pasting?

Hiroshi Iwatani
On my gvim screen, there are two sections on a same column:

abc
def
ghi

rst
uvw
xyz

and I'd like to have two different columns aligned on same lines, like this:

abc  rst
def  uvw
ghi  xyz

Yes, I think I have read all of the related docs available on the net, but they can't help. So I'm going to rely on the old friends here. TIA.





 

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Paul-4
On Sunday, 01 January, 2017 at 09:21:08 GMT, Hiroshi Iwatani wrote:

>On my gvim screen, there are two sections on a same column:
>
>abc
>def
>ghi
>
>rst
>uvw
>xyz
>
>and I'd like to have two different columns aligned on same lines, like this:
>
>abc  rst
>def  uvw
>ghi  xyz

Visual block select (control-v) and yank the second block. Enter two spaces after the c. Either enter normal mode and paste, or control-o and p.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Hiroshi Iwatani
We only get the [p] result as:

abc  rst
uvw
xyz
def
ghi

That is, and has been, our current perpetual problem.

On 2017年01月02日 01:02, Paul wrote:

> On Sunday, 01 January, 2017 at 09:21:08 GMT, Hiroshi Iwatani wrote:
>> On my gvim screen, there are two sections on a same column:
>>
>> abc
>> def
>> ghi
>>
>> rst
>> uvw
>> xyz
>>
>> and I'd like to have two different columns aligned on same lines, like this:
>>
>> abc  rst
>> def  uvw
>> ghi  xyz
>
> Visual block select (control-v) and yank the second block. Enter two spaces after the c. Either enter normal mode and paste, or control-o and p.
>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Aswin S
With cursor on the 'r' of 'rst', do this key sequence:

<ctrl-v>lll jj d gg A <space><space><esc>p

This is same as what Jan said, just putting down the keystrokes.

On Monday, 2 January 2017 04:29:07 UTC+5:30, hiwa  wrote:

> We only get the [p] result as:
>
> abc  rst
> uvw
> xyz
> def
> ghi
>
> That is, and has been, our current perpetual problem.
>
> On 2017年01月02日 01:02, Paul wrote:
> > On Sunday, 01 January, 2017 at 09:21:08 GMT, Hiroshi Iwatani wrote:
> >> On my gvim screen, there are two sections on a same column:
> >>
> >> abc
> >> def
> >> ghi
> >>
> >> rst
> >> uvw
> >> xyz
> >>
> >> and I'd like to have two different columns aligned on same lines, like this:
> >>
> >> abc  rst
> >> def  uvw
> >> ghi  xyz
> >
> > Visual block select (control-v) and yank the second block. Enter two spaces after the c. Either enter normal mode and paste, or control-o and p.
> >
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Pongthep Kulkrisada
In reply to this post by Hiroshi Iwatani
You did something wrong.
Well, you have...

abc
def
ghi

rst
uvw
xyz

In exit mode (escape), move the cursor to 'c'.
Type 'a' to enter insert mode, then type 2 spaces.
Escape again, then move the cursor to 'r'.
ctrl-v to enter visual block mode.
Then type 'l', 'l', 'j', 'j', to cover the block to move.
The current cursor will then move to 'z'.
Type 'd' to delete them.
Then repeating 'k' until the cursor points 'a'.
Then type '$', and finally 'p'.

Hope that helps.

--
Pongthep Kulkrisada
 
"UNIX is basically a simple operating system,
but you have to be a genius to understand the simplicity."
-- Dennis M. Ritchie

* Hiroshi Iwatani ([hidden email]) wrote:

> That is, and has been, our current perpetual problem.
>
> On 2017?01?02? 01:02, Paul wrote:
> > On Sunday, 01 January, 2017 at 09:21:08 GMT, Hiroshi Iwatani wrote:
> > > On my gvim screen, there are two sections on a same column:
> > >
> > > abc
> > > def
> > > ghi
> > >
> > > rst
> > > uvw
> > > xyz
> > >
> > > and I'd like to have two different columns aligned on same lines, like this:
> > >
> > > abc  rst
> > > def  uvw
> > > ghi  xyz
> >
> > Visual block select (control-v) and yank the second block. Enter two spaces after the c. Either enter normal mode and paste, or control-o and p.
> >
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> --- You received this message because you are subscribed to the Google
> Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Hiroshi Iwatani
In reply to this post by Aswin S
Thanks Aswin and Pongthep. I think I was doing the same thing as suggested by using the gvim gui, that is, using a small animal-like good-old hand device and everytime got the funny pasting result by hitting [p].

On the jEdit program which is one of the new generation of the text editors on Linux, you have [rectangular select] and [clipboard extension]>>[vertical paste] menu items under the [[Edit]] primary menu. This "vertical paste" thing did the task I wanted long perfectly.

I shall use the jEdit editor when some table-like editing operation is needed.

Any way, thanks very much for your valuable helps. Thanks again.


On 2017年01月02日 21:05, Aswin S wrote:

> With cursor on the 'r' of 'rst', do this key sequence:
>
> <ctrl-v>lll jj d gg A <space><space><esc>p
>
> This is same as what Jan said, just putting down the keystrokes.
>
> On Monday, 2 January 2017 04:29:07 UTC+5:30, hiwa  wrote:
>> We only get the [p] result as:
>>
>> abc  rst
>> uvw
>> xyz
>> def
>> ghi
>>
>> That is, and has been, our current perpetual problem.
>>
>> On 2017年01月02日 01:02, Paul wrote:
>>> On Sunday, 01 January, 2017 at 09:21:08 GMT, Hiroshi Iwatani wrote:
>>>> On my gvim screen, there are two sections on a same column:
>>>>
>>>> abc
>>>> def
>>>> ghi
>>>>
>>>> rst
>>>> uvw
>>>> xyz
>>>>
>>>> and I'd like to have two different columns aligned on same lines, like this:
>>>>
>>>> abc  rst
>>>> def  uvw
>>>> ghi  xyz
>>>
>>> Visual block select (control-v) and yank the second block. Enter two spaces after the c. Either enter normal mode and paste, or control-o and p.
>>>
>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Ben Fritz
On Tuesday, January 3, 2017 at 6:55:13 AM UTC-6, hiwa wrote:
> Thanks Aswin and Pongthep. I think I was doing the same thing as suggested by using the gvim gui, that is, using a small animal-like good-old hand device and everytime got the funny pasting result by hitting [p].
>
> On the jEdit program which is one of the new generation of the text editors on Linux, you have [rectangular select] and [clipboard extension]>>[vertical paste] menu items under the [[Edit]] primary menu. This "vertical paste" thing did the task I wanted long perfectly.
>
> I shall use the jEdit editor when some table-like editing operation is needed.
>
> Any way, thanks very much for your valuable helps. Thanks again.
>
>

If you were to actually, correctly, use CTRL+V to select the text you copied, then Vim will AUTOMATICALLY do a "vertical paste".

Either you aren't following directions, or you have a mapping interfering. You shouldn't need a different editor to do this. It's built into Vim and has been for years.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Hiroshi Iwatani
Oh Ben, you are right.

This morning I tried to do THE same task by using ONLY vim key commands like [h][j][k][l] for cursor movement, then I got the perfect desired result i.e. a vertical pasting. The lesson I may have learned is "don't use mouse for cursor movement for gvim rectangular operations", and, "You only should use those venerable vim key commands".

I prefer an appropriate set of menu items and mouse operations, though. Gvim must be a GUIed vim.

Thanks, any way.


On 2017年01月03日 23:52, Ben Fritz wrote:

> On Tuesday, January 3, 2017 at 6:55:13 AM UTC-6, hiwa wrote:
>> Thanks Aswin and Pongthep. I think I was doing the same thing as suggested by using the gvim gui, that is, using a small animal-like good-old hand device and everytime got the funny pasting result by hitting [p].
>>
>> On the jEdit program which is one of the new generation of the text editors on Linux, you have [rectangular select] and [clipboard extension]>>[vertical paste] menu items under the [[Edit]] primary menu. This "vertical paste" thing did the task I wanted long perfectly.
>>
>> I shall use the jEdit editor when some table-like editing operation is needed.
>>
>> Any way, thanks very much for your valuable helps. Thanks again.
>>
>>
>
> If you were to actually, correctly, use CTRL+V to select the text you copied, then Vim will AUTOMATICALLY do a "vertical paste".
>
> Either you aren't following directions, or you have a mapping interfering. You shouldn't need a different editor to do this. It's built into Vim and has been for years.
>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

KF Leong-2
On Wednesday, 4 January 2017 06:54:38 UTC+8, hiwa  wrote:

> Oh Ben, you are right.
>
> This morning I tried to do THE same task by using ONLY vim key commands like [h][j][k][l] for cursor movement, then I got the perfect desired result i.e. a vertical pasting. The lesson I may have learned is "don't use mouse for cursor movement for gvim rectangular operations", and, "You only should use those venerable vim key commands".
>
> I prefer an appropriate set of menu items and mouse operations, though. Gvim must be a GUIed vim.
>
> Thanks, any way.
>
>
> On 2017年01月03日 23:52, Ben Fritz wrote:
> > On Tuesday, January 3, 2017 at 6:55:13 AM UTC-6, hiwa wrote:
> >> Thanks Aswin and Pongthep. I think I was doing the same thing as suggested by using the gvim gui, that is, using a small animal-like good-old hand device and everytime got the funny pasting result by hitting [p].
> >>
> >> On the jEdit program which is one of the new generation of the text editors on Linux, you have [rectangular select] and [clipboard extension]>>[vertical paste] menu items under the [[Edit]] primary menu. This "vertical paste" thing did the task I wanted long perfectly.
> >>
> >> I shall use the jEdit editor when some table-like editing operation is needed.
> >>
> >> Any way, thanks very much for your valuable helps. Thanks again.
> >>
> >>
> >
> > If you were to actually, correctly, use CTRL+V to select the text you copied, then Vim will AUTOMATICALLY do a "vertical paste".
> >
> > Either you aren't following directions, or you have a mapping interfering. You shouldn't need a different editor to do this. It's built into Vim and has been for years.
> >
Use Alt-LMB (Left Mouse Button) to do a VISUAL BLOCK selection.
Add two spaces, and do a paste...

HTH

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

kamaraju kusumanchi
On Wed, Jan 4, 2017 at 1:00 AM, KF <[hidden email]> wrote:
>
> Use Alt-LMB (Left Mouse Button) to do a VISUAL BLOCK selection.
> Add two spaces, and do a paste...

Does not seem like a portable solution. For example, in Debian + KDE
setup, <ALT>+<Left Mouse> drags the window as mouse moves along.

--
Kamaraju S Kusumanchi | http://raju.shoutwiki.com/wiki/Blog

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Hiroshi Iwatani
Kamaraju may be right. It doesn't work on my environment which is Linux/Ubuntu too. Did KF mean a Windows environment, or ...?

On 2017年01月05日 11:56, kamaraju kusumanchi wrote:
> On Wed, Jan 4, 2017 at 1:00 AM, KF <[hidden email]> wrote:
>>
>> Use Alt-LMB (Left Mouse Button) to do a VISUAL BLOCK selection.
>> Add two spaces, and do a paste...
>
> Does not seem like a portable solution. For example, in Debian + KDE
> setup, <ALT>+<Left Mouse> drags the window as mouse moves along.
>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

KF Leong-2
On Thursday, 5 January 2017 17:35:56 UTC+8, hiwa  wrote:
> Kamaraju may be right. It doesn't work on my environment which is Linux/Ubuntu too. Did KF mean a Windows environment, or ...?
>

I'm on Windows, maybe this will help for KDE/Genome:

" .vimrc settings...
" Alt-Mouse-Left for block selections
" You need to disable/switch the Alt key for KDE/Gnome (Windowsettings for KDE)
nmap <A-LeftMouse> ms<LeftMouse><C-q>`so
imap <A-LeftMouse> <Esc><C-q>`^ms<Esc>gi<LeftMouse><C-o><C-q>`so
vmap <A-LeftDrag> <LeftDrag>
vmap <A-LeftMouse> <C-q><LeftMouse>msgv`s

Ref: http://code.jity.de/Jack12816/linux-environment/commit/85e397753e5cceb505dfd1f7ccbfe1955fd83c29?view=inline&w=1

HTH

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Ken Takata-2
In reply to this post by Hiroshi Iwatani
Hi hiwa,

2017年1月4日水曜日 7時54分38秒 UTC+9 hiwa:
> Oh Ben, you are right.
>
> This morning I tried to do THE same task by using ONLY vim key commands like [h][j][k][l] for cursor movement, then I got the perfect desired result i.e. a vertical pasting. The lesson I may have learned is "don't use mouse for cursor movement for gvim rectangular operations", and, "You only should use those venerable vim key commands".
>
> I prefer an appropriate set of menu items and mouse operations, though. Gvim must be a GUIed vim.

See ":help gui-mouse-select".
It says "quadruple clicking makes it rectangular block-wise."

Regards,
Ken Takata

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Hiroshi Iwatani
Hi Ken,

Thanks for giving us one of the deepest esoterica of the gvim editor.
But we somehow feel the four consecutive mouse clicks on a same position and in a very short time so horrible that we haven't tried them yet. When a good time should come someday, we'd surely try them, though.

Thanks again.


On 2017年01月07日 03:01, Ken Takata wrote:

> Hi hiwa,
>
> 2017年1月4日水曜日 7時54分38秒 UTC+9 hiwa:
>> Oh Ben, you are right.
>>
>> This morning I tried to do THE same task by using ONLY vim key commands like [h][j][k][l] for cursor movement, then I got the perfect desired result i.e. a vertical pasting. The lesson I may have learned is "don't use mouse for cursor movement for gvim rectangular operations", and, "You only should use those venerable vim key commands".
>>
>> I prefer an appropriate set of menu items and mouse operations, though. Gvim must be a GUIed vim.
>
> See ":help gui-mouse-select".
> It says "quadruple clicking makes it rectangular block-wise."
>
> Regards,
> Ken Takata
>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Ryan Nabinger
In reply to this post by Hiroshi Iwatani
A quick note:

I find P more useful than p because of columns' typical left-alignment and my desire to not mangle the tailend of my paste destination.

Also, 1v is very useful when dealing with blocks (:he visual-start), especially when transposing blocks / overwriting blocks.



On Sunday, January 1, 2017 at 1:21:44 AM UTC-8, hiwa wrote:

> On my gvim screen, there are two sections on a same column:
>
> abc
> def
> ghi
>
> rst
> uvw
> xyz
>
> and I'd like to have two different columns aligned on same lines, like this:
>
> abc  rst
> def  uvw
> ghi  xyz
>
> Yes, I think I have read all of the related docs available on the net, but they can't help. So I'm going to rely on the old friends here. TIA.
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to do block pasting?

Hiroshi Iwatani
Thanks. I'll try them.

On 2017年01月23日 09:16, Ryan Nabinger wrote:
> A quick note:
>
> I find P more useful than p because of columns' typical left-alignment and my desire to not mangle the tailend of my paste destination.
>
> Also, 1v is very useful when dealing with blocks (:he visual-start), especially when transposing blocks / overwriting blocks.
>

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...