Tuesday, January 24, 2012

Re: private vim info file

On Wed, January 25, 2012 6:46 am, sinbad wrote:
> i want to store certain variables in to a viminfo file, but
> i don't want to depend on the behavior of viminfo, for
> example, i had this variable which will be used to store
> some information while working on a c file and when
> i had opened a new empty c file and closed it, the
> earlier variable stored in viminfo file was wiped out.

What did you do? Did you close vim so the viminfo file was
written? Please tell us what you did and what you expect. If it
was a global variable and your 'viminfo' setting contained the '!'
flag, then vim should include the variable in the 'viminfo' file.

> so, i am planning to use a private vim info file and
> let my functions read and write, is it possible are there
> any built-in functions available, it will be helpful if you
> can point me into the right direction.

You can always do the file handling yourself:
:sp MyViminfoFile.vim
:%d _
:put =printf(\"let %s=%s\", 'g:MyVariable', string(g:MyVariable))
:w
and later:
:so MyViminfoFile.vim
That should work.

You might also want to look into the :mksession command (:h mks)

regards,
Christian

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

No comments: