Re: Saving netrw hide list to session file
- * Charles Campbell <Charles.E.Campbell@...> [110630 11:18]:
> Tim Johnson wrote:Thank you for the quick reply.
> >Using vim 7.2 on ubuntu 10.04, huge version.
> >I make use of Dr. Campbell's netrw browse window, which has the
> >ctrl-h feature that allows me to edit the hide list.
> >The hide list is associated with g:netrw_list_hide. I would like to
> >be able to save that variable to my session file. However, when I
> >save the session, I do not see that the g:netrw_list_hide is saved.
> >In fact g:netrw_list_hide is not even defined until netrw is first
> >Is it possible to save g:netrw_list_hide?
> From the vim manual, under :help mks...Understood.
> 2. Restores global variables that start with an uppercase letter and containI put let g:Netrw_list_hide= g:netrw_list_hide into
> at least one lowercase letter, if 'sessionoptions' contains "globals".
> So, unfortunately, g:netrw_list_hide does not satisfy that constraint.
> I checked into whether this process could be automated;
> unfortunately, there does not appear to be a SessionWritePre autocmd
> event. If there was, something like
> au SessionWritePre * let g:Netrw_list_hide= g:netrw_list_hide
the 'wrapper' function that saves the session.
"" Save session after confirmation
let g:Netrw_list_hide = g:netrw_list_hide
let res = input("Save Session: [" . v:this_session ."] (Y/N)")
if res == "y"
exe ':call AutoSaveVimSesn()'
"" Global variable saved
> au SessionLoadPost * let g:netrw_list_hide= g:Netrw_list_hideAnd the line above in my .vimrc
> might work.And now it works!
Thanks for the solution.
tim at johnsons-web dot com or akwebsoft dot 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