Re: Saving global variables in session files

2010-11-18 Thread Tim Johnson
* Tom Link micat...@gmail.com [101117 21:30]:
    :) but you're not off the hook yet. Anyone have a better way or
    any caveats?
 
 Two alternatives come to mind:
 
 Under the assumption that your sessions correspond to projects, you
 could use the localvimrc[1] plugin (or something similar) to set the
 variables to project-specific values. Such plugins load a project-
 specific viml file, e.g. /path/to/project/.lvimrc.
 
 You could define a SessionLoadPost autocommand that does something.
 The session is saved in v:this_session.
 
 Regards,
 Tom
 
 
 [1] http://www.vim.org/scripts/script.php?script_id=441
  Thanks Tom. Good tips and looks like a great plugin.
  cheers
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

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


Saving global variables in session files

2010-11-17 Thread Tim Johnson
Using vim 7.2 on ubuntu 10.04, huge version.

If I execute the following:
:let g:viewFolder = /path/to/project/application/views 
and save the session, I note that the value of
g:viewFolder is not stored in the session file.

What else do I need to do?
-
NOTE: the reason for this need is as follows:
-
I would like to create a series of global variables that
would be set to different values in different sessions and stored
in the session file for each session.

Examples:
g:viewFolder = /path/to/project/application/views
g:modelFolder = /path/to/project/application/models
g:controllerFolder = /path/to/project/application/controllers
This has a potential for a wide range of applications, such as
 open file selection dialog for views folder 
browse confirm e g:viewFolder 
 etc. 

thanks
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

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


Re: Saving global variables in session files

2010-11-17 Thread Tim Johnson
* Tim Johnson t...@johnsons-web.com [101117 15:36]:
 Using vim 7.2 on ubuntu 10.04, huge version.
 
 If I execute the following:
 :let g:viewFolder = /path/to/project/application/views 
 and save the session, I note that the value of
 g:viewFolder is not stored in the session file.
 
 What else do I need to do?
 -
 NOTE: the reason for this need is as follows:
 -
 I would like to create a series of global variables that
 would be set to different values in different sessions and stored
 in the session file for each session.
 
  Doing my own research: ...
  from http://www.adp-gmbh.ch/vim/vars.html
  I deduced to do the following:
  :set sessionoptions+=globals 
  :let g:ViewFolder = /path/to/project/application/views 
   Note the capital 'V'
  and save the session.
  I now see that 'ViewFolder' is saved in the session file
  and has a value when the session file is sourced.

  :) but you're not off the hook yet. Anyone have a better way or
  any caveats?
  thanks
  tim

 Examples:
 g:viewFolder = /path/to/project/application/views
 g:modelFolder = /path/to/project/application/models
 g:controllerFolder = /path/to/project/application/controllers
 This has a potential for a wide range of applications, such as
  open file selection dialog for views folder 
 browse confirm e g:viewFolder 
  etc. 

-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

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


Re: Saving global variables in session files

2010-11-17 Thread Tom Link
   :) but you're not off the hook yet. Anyone have a better way or
   any caveats?

Two alternatives come to mind:

Under the assumption that your sessions correspond to projects, you
could use the localvimrc[1] plugin (or something similar) to set the
variables to project-specific values. Such plugins load a project-
specific viml file, e.g. /path/to/project/.lvimrc.

You could define a SessionLoadPost autocommand that does something.
The session is saved in v:this_session.

Regards,
Tom


[1] http://www.vim.org/scripts/script.php?script_id=441

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