Saving Viminfo?

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

Saving Viminfo?

Ven Tadipatri
Hi,
  I found that when I yanked a large number of lines, exited vim and
tried pasting, only the first 50 lines were pasted. I was able to set
the viminfo variable: viminfo='100,<600,s10,h , then yank the lines,
and it worked. However, I don't want to keep setting the viminfo
variable every time I want to yank a large number of lines. For some
reason, when I set the viminfo variable in my .vimrc, it's not picking
it up, and always reverts to the default : "viminfo='100,<50,s10,h".
Is there some way I can set this permanently in some Vim config file?

Thanks,
Ven

--
--
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
|

Re: Saving Viminfo?

Gary Johnson-4
On 2019-01-10, Ven Tadipatri wrote:
> Hi,
>   I found that when I yanked a large number of lines, exited vim and
> tried pasting, only the first 50 lines were pasted. I was able to set
> the viminfo variable: viminfo='100,<600,s10,h , then yank the lines,
> and it worked. However, I don't want to keep setting the viminfo
> variable every time I want to yank a large number of lines. For some
> reason, when I set the viminfo variable in my .vimrc, it's not picking
> it up, and always reverts to the default : "viminfo='100,<50,s10,h".
> Is there some way I can set this permanently in some Vim config file?

I have set 'viminfo' in my vimrc for many years and it works fine.

    set viminfo-=<50    " Remove the default line-count limit.  This
                        " prevented saving large registers, such as
                        " :redir outputs.

What is the command you use to set it?  As soon as you start vim,
what is the result of this command?

    :verbose set viminfo?

Regards,
Gary

--
--
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
|

Re: Saving Viminfo?

Tony Mechelynck
In reply to this post by Ven Tadipatri
On Thu, Jan 10, 2019 at 3:03 PM Ven Tadipatri <[hidden email]> wrote:

>
> Hi,
>   I found that when I yanked a large number of lines, exited vim and
> tried pasting, only the first 50 lines were pasted. I was able to set
> the viminfo variable: viminfo='100,<600,s10,h , then yank the lines,
> and it worked. However, I don't want to keep setting the viminfo
> variable every time I want to yank a large number of lines. For some
> reason, when I set the viminfo variable in my .vimrc, it's not picking
> it up, and always reverts to the default : "viminfo='100,<50,s10,h".
> Is there some way I can set this permanently in some Vim config file?
>
> Thanks,
> Ven

My vimrc includes the following, so set the 'viminfo' option and also
to save the viminfo file when I "save my work" before leaving the
keyboard temporarily for any reason. You may of course pick and
choose. Caveat: all this is trated as a comment in Small and Tiny Vim
builds (which don't have expression evaluation).

if has('viminfo')
  set vi='1000,!,%,c
  " '1000 : save marks for up to 1000 files
  " no f : also save all "file" marks, [0-9A-Z]
  " ! : save variables whose name is /[A-Z][A-Z_]*/
  " % : save and restore the buffer list
  " c : convert the viminfo encoding if necessary
  " no < : save all registers in full
  if has('unix')
    set vi+=r/mnt/
    " save no marks for anything at /mnt/ and below
    " (mount points for removable media)
  endif " +unix
  " use F3 to save all (incl. viminfo if supported)
  map  <F3>         :wa<Bar>wv<CR>
  map! <F3>    <C-O>:wa<Bar>wv<CR>
else
  map  <F3>         :wa<CR>
  map! <F3>    <C-O>:wa<CR>
endif " +viminfo


Best regards,
Tony.

--
--
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.