:help :mksession states:
> 10. If a file exists with the same name as the Session file, but ending in
>    "x.vim" (for eXtra), executes that as well.  You can use *x.vim files to
>    specify additional settings and actions associated with a given Session,
>    such as creating menu items in the GUI version.

This is achieved by adding the following lines to the session file:

let s:sx = expand("<sfile>:p:r")."x.vim"
if file_readable(s:sx)
  exe "source " . s:sx
endif

However, a problem arises when the path of the session file contains a
whitespace character. To fix this, the contents of the session file
should be:

let s:sx = expand("<sfile>:p:r")."x.vim"
if file_readable(s:sx)
  exe "source " . fnameescape(s:sx)
endif

The following patch makes Vim generate the latter form of the session
file:

Index: src/ex_docmd.c
===================================================================
--- src/ex_docmd.c      (revision 1289)
+++ src/ex_docmd.c      (working copy)
@@ -10106,7 +10106,7 @@
      */
     if (put_line(fd, "let s:sx = expand(\"<sfile>:p:r\").\"x.vim\"") == FAIL
            || put_line(fd, "if file_readable(s:sx)") == FAIL
-           || put_line(fd, "  exe \"source \" . s:sx") == FAIL
+           || put_line(fd, "  exe \"source \" . fnameescape(s:sx)") == FAIL
            || put_line(fd, "endif") == FAIL)
        return FAIL;

-- 
Cheers,
Lech

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

Raspunde prin e-mail lui