Hi,
I finally spent some time adding some session related stuff into my
vimrc. It is apparently working OK, but I started noticing some subtle
problems: at least one plugin has stopped working (EnhancedCommentify)
and I noticed also that tab completion (activated by wildmenu option)
seems to have stopped working also.
With EnhancedCommentify, vim is complaining that some variable don't
exist. They are b:xxx variables (local to buffers), so I guessed they
weren't saved? Should I manually save them? Any ideas?
BTW, the relevant part of my vimrc is (copied from vim wiki, can't
remember exactly from where, then adapted to my liking):

set sessionoptions+=winpos
set sessionoptions+=winsize


   augroup sessions
        " Creates a session
        function! MakeSession()
            if (exists("g:session_file") == 0)
                let b:sessiondir = getcwd()
                let b:filename = b:sessiondir . '/session.vim'
            else
                let b:filename = g:session_file
            endif
            if (filereadable(b:filename))
                let b:answer = input("File session.vim already exists,
" .
                        \ "overwrite(y/[n])?")
                if (tolower(b:answer) != 'y')
                    return
                endif
            endif
            exe "mksession! " . b:filename
            let g:session_file = b:filename
        endfunction

        " Updates a session, BUT ONLY IF IT ALREADY EXISTS
        function! UpdateSession()
            if (filereadable(g:session_file))
                exe "mksession! " . g:session_file
            endif
        endfunction

        " Loads a session if it exists
        function! LoadSession()
            let b:sessionfile = getcwd() . "/session.vim"
            if (filereadable(b:sessionfile))
                let answer = input("Restore previously saved session
(y/[n])?")
                if (tolower(answer) == 'y')
                    let g:session_file = b:sessionfile
                    exe 'source ' . b:sessionfile
                endif
            endif
        endfunction

        au VimEnter * :call LoadSession()
        au VimLeave * :call UpdateSession()
        map <leader>m :call MakeSession()<CR>
    augroup END

Thanks in advance,

jorge
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to