Register size

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Register size

Anatoli Sakhnik-2
Hello, vim users!
Can anyone tell me how big a vim register is? It's very unpleasant,
when I yank some piece of text in the source and can paste only part
of it. Is there a restriction?
No word about the subject neither in the documentation nor in the web.
-- Anatoli Sakhnik
Reply | Threaded
Open this post in threaded view
|

Re: Register size

Eric Arnold-3
On 6/21/06, Anatoli Sakhnik <[hidden email]> wrote:
> Hello, vim users!
> Can anyone tell me how big a vim register is? It's very unpleasant,
> when I yank some piece of text in the source and can paste only part
> of it. Is there a restriction?
> No word about the subject neither in the documentation nor in the web.
> -- Anatoli Sakhnik
>

I don't know of a limit within normal uses (i.e. 100K or so).  How
long is the text you are trying to yank?
Reply | Threaded
Open this post in threaded view
|

Re: Register size

Anatoli Sakhnik-2
The effect isn't regular, and thus bothers me very surprisingly.
Actually, I yanked more than 70 lines (it wrote me on the status bar),
but could paste only 50. I've been trying to reproduce this appearence
last five minutes, but unsuccessful.
-- Anatoli Sakhnik
On 21/06/06, Eric Arnold <[hidden email]> wrote:
>
> I don't know of a limit within normal uses (i.e. 100K or so).  How
> long is the text you are trying to yank?
>
Reply | Threaded
Open this post in threaded view
|

Re: Register size

Mathias Michaelis
In reply to this post by Anatoli Sakhnik-2
Anatoli

> Can anyone tell me how big a vim register is?
>
I can't. With HUGE (g)vim-7.0.22 on Windows XP I have experienced no
problem when yanking 100MB of text (except of the business of my
hard drive).

> It's very unpleasant, when I yank some piece of text in the
> source and can paste only part of it. Is there a restriction?
>
Perhaps this depends on the version, on special characters you yank,
on the Operating System etc. But I don't know.

With best regards

Mathias
Reply | Threaded
Open this post in threaded view
|

Re: Register size

Matthew Winn
In reply to this post by Anatoli Sakhnik-2
On Wed, Jun 21, 2006 at 12:48:48PM +0300, Anatoli Sakhnik wrote:
> Can anyone tell me how big a vim register is? It's very unpleasant,
> when I yank some piece of text in the source and can paste only part
> of it. Is there a restriction?

I'm not aware of any restriction, providing you remain within Vim when
moving text around.  If you quit Vim and restart it on a different file
then only part of the register will be saved.  See ":help 'viminfo'".

--
Matthew Winn ([hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: Register size

Tim Chase-2
In reply to this post by Eric Arnold-3
> I don't know of a limit within normal uses (i.e. 100K or so).  How
> long is the text you are trying to yank?

I can't say I've hit any abnormal limits either, and I've
yanked/pasted some pretty long texts from log-file dumps.

If you need to read in a huge quantity of data, you can save that
data to a file, and then use

        :r filename.txt

to read in the data if you're having clipboard problems.

If you've got absolutely gargantuan data that blows vim's limits
(":help limits"), you can use a stream editor like sed which will
process the file(s) a line at a time:

        sed '25r filename.txt' source.txt > result.txt

to put the contents of 'filename.txt' after (or is it
before...I'd have to experiment) line 25 of source.txt and save
the result as result.txt

If you need to put it after a particular regexp line (assuming
there's only one match, unless you want to read filename.txt into
the file multiple times), you can just use

        sed '/regexp/r filename.txt' source.txt > result.txt

There are some stunts one can perform to read filename.txt only
after the first or last instance of "regexp".  I have a solution
for the former...reading after the last match of "regexp" is a
bit trickier.

Just a few thoughts...

-tim



Reply | Threaded
Open this post in threaded view
|

Re: Register size

Anatoli Sakhnik-2
Let's just wait a while until I encounter the problem again. I think
there's "an unexpected feature" either in the win32 version of the vim
or in one of plugins I use.
-- Sakhnik

On 21/06/06, Tim Chase <[hidden email]> wrote:
>
> I can't say I've hit any abnormal limits either, and I've
> yanked/pasted some pretty long texts from log-file dumps.
>
> Just a few thoughts...
>
> -tim
Reply | Threaded
Open this post in threaded view
|

Re: Register size

Anatoli Sakhnik-2
In reply to this post by Matthew Winn
This surely can be a true scenario! I'll keep it in mind next time.

On 21/06/06, Matthew Winn <[hidden email]> wrote:
>
> If you quit Vim and restart it on a different file
> then only part of the register will be saved.  See ":help 'viminfo'".
>
Reply | Threaded
Open this post in threaded view
|

Re: Register size

Mark Woodward-4
In reply to this post by Anatoli Sakhnik-2
Hi Anatoli,

On Wed, 21 Jun 2006 12:48:48 +0300
"Anatoli Sakhnik" <[hidden email]> wrote:

> Hello, vim users!
> Can anyone tell me how big a vim register is? It's very unpleasant,
> when I yank some piece of text in the source and can paste only part
> of it. Is there a restriction?
> No word about the subject neither in the documentation nor in the web.
> -- Anatoli Sakhnik

How are you yanking the text? Are you using visual mode? Are you
scrolling after you've made the selection and before you yank?

Here at least, if I select with the mouse and then scroll, the selection
changes if the cursor moves from its original position (which it will
if you select/scroll more than 1 screen of text).

PS - I dont know how long your lines are but vim can handle a lot more
than 70 lines ;-)

--
Mark