Hello,
Le mardi 4 mars 2014 10:54:15 UTC+1, Anton Bobrov a écrit :
> > 'viewdir' $XDG_CACHE_HOME/vim/view
>
> My precious views are treated as "user specific non-essential data files".
> Sweet.
You're right, 'viewdir' must be based on XDG_CONFIG_HOME
instead of XDG_CACHE_HOME. I've fixed it in the revised patch.
jfb
--
--
You received this message from the "vim_dev" 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
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff -r 10d35c8b50e3 runtime/doc/gui.txt
--- a/runtime/doc/gui.txt Mon Feb 24 03:32:00 2014 +0100
+++ b/runtime/doc/gui.txt Tue Mar 04 21:05:17 2014 +0100
@@ -1,4 +1,4 @@
-*gui.txt* For Vim version 7.4. Last change: 2013 Jun 12
+*gui.txt* For Vim version 7.4. Last change: 2014 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -66,7 +66,9 @@
- If the GVIMINIT environment variable exists and is not empty, it is
executed as an Ex command.
- If the user gvimrc file exists, it is sourced. The name of this file is
- normally "$HOME/.gvimrc". You can check this with ":version".
+ normally "$HOME/.gvimrc"; with |+xdg_basedir| feature, the name
+ "$XDG_CONFIG_HOME/vim/gvimrc" is also checked (first). You can verify
+ this with ":version".
- For Win32, when $HOME is not set, "$VIM\_gvimrc" is used.
- When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice
versa.
diff -r 10d35c8b50e3 runtime/doc/options.txt
--- a/runtime/doc/options.txt Mon Feb 24 03:32:00 2014 +0100
+++ b/runtime/doc/options.txt Tue Mar 04 21:05:17 2014 +0100
@@ -987,8 +987,9 @@
*'backupdir'* *'bdir'*
'backupdir' 'bdir' string (default for Amiga: ".,t:",
- for MS-DOS and Win32: ".,$TEMP,c:/tmp,c:/temp"
- for Unix: ".,~/tmp,~/")
+ for MS-DOS and Win32: ".,$TEMP,c:/tmp,c:/temp",
+ for Unix: ".,~/tmp,~/", with |+xdg_basedir|:
+ ".,$XDG_CACHE_HOME/vim,~/,/tmp")
global
{not in Vi}
List of directories for the backup file, separated with commas.
@@ -2477,8 +2478,9 @@
*'directory'* *'dir'*
'directory' 'dir' string (default for Amiga: ".,t:",
- for MS-DOS and Win32: ".,$TEMP,c:\tmp,c:\temp"
- for Unix: ".,~/tmp,/var/tmp,/tmp")
+ for MS-DOS and Win32: ".,$TEMP,c:\tmp,c:\temp",
+ for Unix: ".,~/tmp,/var/tmp,/tmp", with |+xdg_basedir|:
+ ".,$XDG_CACHE_HOME/vim,~/tmp,/var/tmp,/tmp")
global
List of directory names for the swap file, separated with commas.
- The swap file will be created in the first directory where this is
@@ -5728,6 +5730,12 @@
$VIMRUNTIME,
$VIM/vimfiles/after,
$HOME/.vim/after"
+ Unix with |+xdg_basedir|:
+ "$XDG_CONFIG_HOME/vim,
+ $VIM/vimfiles,
+ $VIMRUNTIME,
+ $VIM/vimfiles/after,
+ $XDG_CONFIG_HOME/vim/after"
Amiga: "home:vimfiles,
$VIM/vimfiles,
$VIMRUNTIME,
@@ -7694,9 +7702,10 @@
*'viewdir'* *'vdir'*
'viewdir' 'vdir' string (default for Amiga, MS-DOS, OS/2 and Win32:
"$VIM/vimfiles/view",
- for Unix: "~/.vim/view",
- for Macintosh: "$VIM:vimfiles:view"
- for VMS: "sys$login:vimfiles/view"
+ for Unix: "~/.vim/view", with |+xdg_basedir|:
+ "$XDG_CONFIG_HOME/vim/view",
+ for Macintosh: "$VIM:vimfiles:view",
+ for VMS: "sys$login:vimfiles/view",
for RiscOS: "Choices:vimfiles/view")
global
{not in Vi}
diff -r 10d35c8b50e3 runtime/doc/os_unix.txt
--- a/runtime/doc/os_unix.txt Mon Feb 24 03:32:00 2014 +0100
+++ b/runtime/doc/os_unix.txt Tue Mar 04 21:05:17 2014 +0100
@@ -1,4 +1,4 @@
-*os_unix.txt* For Vim version 7.4. Last change: 2005 Mar 29
+*os_unix.txt* For Vim version 7.4. Last change: 2014 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -57,4 +57,40 @@
The file "tools/vim132" is a shell script that can be used to put Vim in 132
column mode on a vt100 and lookalikes.
+ *xdg_basedir* *$XDG_CACHE_HOME* *$XDG_CONFIG_HOME* *$XDG_DATA_HOME*
+When |+xdg_basedir| feature is enabled, Vim is compiled with XDG Base Directory
+specification support. This means that:
+
+ 1. The XDG environment variables mentionned above (names in XDG_*) are
+ handled by Vim in a special way. If they aren't defined or are empty,
+ Vim expands them with their default value (as in XDG specification):
+
+ VARIABLE DEFAULT VALUE~
+ $XDG_CACHE_HOME $HOME/.cache
+ $XDG_CONFIG_HOME $HOME/.config
+ $XDG_DATA_HOME $HOME/.local/share
+
+ 2. The following options have their default value changed with respect
+ to their non-XDG Unix counterparts:
+
+ OPTION DEFAULT VALUE~
+ 'backupdir' .,$XDG_CACHE_HOME/vim,~/,/tmp
+ 'directory' .,$XDG_CACHE_HOME/vim,~/tmp,/var/tmp,/tmp
+ 'runtimepath' $XDG_CONFIG_HOME/vim,$VIM,$VIMRUNTIME,
+ $VIM/after,$XDG_CONFIG_HOME/vim/after
+ 'viewdir' $XDG_CONFIG_HOME/vim/view
+
+ 3. For each list of candidate user configuration files, a name is added
+ at first place:
+
+ WHAT PREPENDED NAME~
+ |vimrc| $XDG_CONFIG_HOME/vim/vimrc
+ |gvimrc| $XDG_CONFIG_HOME/vim/gvimrc
+
+ 4. The default viminfo file name (see |viminfo-file-name|) is changed
+ to "$XDG_CACHE_HOME/vim/viminfo".
+
+See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+for more details.
+
vim:tw=78:ts=8:ft=help:norl:
diff -r 10d35c8b50e3 runtime/doc/starting.txt
--- a/runtime/doc/starting.txt Mon Feb 24 03:32:00 2014 +0100
+++ b/runtime/doc/starting.txt Tue Mar 04 21:05:17 2014 +0100
@@ -1,4 +1,4 @@
-*starting.txt* For Vim version 7.4. Last change: 2013 Jul 20
+*starting.txt* For Vim version 7.4. Last change: 2014 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -758,7 +758,9 @@
name. Also see |vimrc-intro|.
Places for your personal initializations:
- Unix $HOME/.vimrc or $HOME/.vim/vimrc
+ Unix $HOME/.vimrc or $HOME/.vim/vimrc;
+ with |+xdg_basedir| feature, it can also be
+ $XDG_CONFIG_HOME/vim/vimrc (first place)
OS/2 $HOME/.vimrc, $HOME/vimfiles/vimrc
or $VIM/.vimrc (or _vimrc)
MS-Windows $HOME/_vimrc, $HOME/vimfiles/vimrc
@@ -769,9 +771,13 @@
The files are searched in the order specified above and only the first
one that is found is read.
- RECOMMENDATION: Put all your Vim configuration stuff in the
- $HOME/.vim/ directory ($HOME/vimfiles/ for MS-Windows). That makes it
- easy to copy it to another system.
+ RECOMMENDATION: Put all your Vim configuration stuff in the preferred
+ directory. That makes it easy to copy it to another system.
+ The preferred directory is:
+ Unix $HOME/.vim, or better with |+xdg_basedir|
+ feature: $XDG_CONFIG_HOME/vim/vimrc
+ Ms-Windows $HOME/vimfiles
+ OS/2 $HOME/vimfiles
If Vim was started with "-u filename", the file "filename" is used.
All following initializations until 4. are skipped. $MYVIMRC is not
@@ -802,6 +808,7 @@
- The environment variable VIMINIT (see also |compatible-default|) (*)
The value of $VIMINIT is used as an Ex command line.
- The user vimrc file(s):
+ "$XDG_CONFIG_HOME/vim/vimrc" (for Unix with |+xdg_basedir|)
"$HOME/.vimrc" (for Unix and OS/2) (*)
"$HOME/.vim/vimrc" (for Unix and OS/2) (*)
"s:.vimrc" (for Amiga) (*)
@@ -899,6 +906,7 @@
Create a vimrc file to set the default settings and mappings for all your edit
sessions. Put it in a place so that it will be found by 3b:
~/.vimrc (Unix and OS/2)
+ $XDG_CONFIG_HOME/vim/vimrc (Unix with |+xdg_basedir|)
s:.vimrc (Amiga)
$VIM\_vimrc (MS-DOS and Win32)
Note that creating a vimrc file will cause the 'compatible' option to be off
@@ -1436,10 +1444,10 @@
VIMINFO FILE NAME *viminfo-file-name*
- The default name of the viminfo file is "$HOME/.viminfo" for Unix and OS/2,
- "s:.viminfo" for Amiga, "$HOME\_viminfo" for MS-DOS and Win32. For the last
- two, when $HOME is not set, "$VIM\_viminfo" is used. When $VIM is also not
- set, "c:\_viminfo" is used. For OS/2 "$VIM/.viminfo" is used when $HOME is
- not set and $VIM is set.
+ "$XDG_CACHE_HOME/vim/viminfo" for Unix with |+xdg_basedir|, "s:.viminfo" for
+ Amiga, "$HOME\_viminfo" for MS-DOS and Win32. For the last two, when $HOME
+ is not set, "$VIM\_viminfo" is used. When $VIM is also not set, "c:\_viminfo"
+ is used. For OS/2 "$VIM/.viminfo" is used when $HOME is not set and $VIM is set.
- The 'n' flag in the 'viminfo' option can be used to specify another viminfo
file name |'viminfo'|.
- The "-i" Vim argument can be used to set another file name, |-i|. When the
diff -r 10d35c8b50e3 runtime/doc/various.txt
--- a/runtime/doc/various.txt Mon Feb 24 03:32:00 2014 +0100
+++ b/runtime/doc/various.txt Tue Mar 04 21:05:17 2014 +0100
@@ -1,4 +1,4 @@
-*various.txt* For Vim version 7.4. Last change: 2013 May 18
+*various.txt* For Vim version 7.4. Last change: 2014 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -426,6 +426,7 @@
S *+windows* more than one window
m *+writebackup* |'writebackup'| is default on
m *+xim* X input method |xim|
+m *+xdg_basedir* XDG Base Directory specification support |xdg_basedir|
*+xfontset* X fontset support |xfontset|
*+xpm* pixmap support
m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support|
diff -r 10d35c8b50e3 src/config.h.in
--- a/src/config.h.in Mon Feb 24 03:32:00 2014 +0100
+++ b/src/config.h.in Tue Mar 04 21:05:17 2014 +0100
@@ -386,6 +386,9 @@
/* Define if you want to include XIM support. */
#undef FEAT_XIM
+/* Define if you want to include XDG Base Directory support. */
+#undef FEAT_XDG_BASEDIR
+
/* Define if you want to include Hangul input support. */
#undef FEAT_HANGULIN
diff -r 10d35c8b50e3 src/configure.in
--- a/src/configure.in Mon Feb 24 03:32:00 2014 +0100
+++ b/src/configure.in Tue Mar 04 21:05:17 2014 +0100
@@ -1866,6 +1866,15 @@
AC_MSG_RESULT($enable_xim),
[enable_xim="auto"; AC_MSG_RESULT(defaulting to auto)])
+AC_MSG_CHECKING(--enable-xdg-basedir argument)
+AC_ARG_ENABLE(xdg-basedir,
+ [ --enable-xdg-basedir Include XDG Base Directory support.], ,
+ [enable_xdg_basedir="no"])
+AC_MSG_RESULT($enable_xdg_basedir)
+if test "$enable_xdg_basedir" = "yes"; then
+ AC_DEFINE(FEAT_XDG_BASEDIR)
+fi
+
AC_MSG_CHECKING(--enable-fontset argument)
AC_ARG_ENABLE(fontset,
[ --enable-fontset Include X fontset output support.], ,
diff -r 10d35c8b50e3 src/eval.c
--- a/src/eval.c Mon Feb 24 03:32:00 2014 +0100
+++ b/src/eval.c Tue Mar 04 21:05:17 2014 +0100
@@ -12579,6 +12579,9 @@
#ifdef FEAT_XIM
"xim",
#endif
+#ifdef FEAT_XDG_BASEDIR
+ "xdg_basedir",
+#endif
#ifdef FEAT_XFONTSET
"xfontset",
#endif
diff -r 10d35c8b50e3 src/misc1.c
--- a/src/misc1.c Mon Feb 24 03:32:00 2014 +0100
+++ b/src/misc1.c Tue Mar 04 21:05:17 2014 +0100
@@ -14,6 +14,13 @@
#include "vim.h"
#include "version.h"
+/* If XDG Base Directory support is enabled and Gtk GUI too,
+ * then we can use utility functions provided by Glib
+ */
+#if defined(FEAT_XDG_BASEDIR) && defined(FEAT_GUI_GTK)
+#include <glib.h>
+#endif
+
static char_u *vim_version_dir __ARGS((char_u *vimdir));
static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name));
#if defined(FEAT_CMDL_COMPL)
@@ -4138,9 +4145,65 @@
*dst = NUL;
}
+#ifdef FEAT_XDG_BASEDIR
+/* XDG environment variable identifier (<=> variable name) */
+typedef enum {
+ XDG_CACHE_HOME,
+ XDG_CONFIG_HOME,
+ XDG_DATA_HOME
+} XdgEnvId_T;
+
+/* XDG environment variable names (indexed by 'XdgEnvId_T' above) */
+static const char_u *xdg_env_name[] = {
+ "XDG_CACHE_HOME",
+ "XDG_CONFIG_HOME",
+ "XDG_DATA_HOME"
+};
+
+#ifndef FEAT_GUI_GTK
+/* No Gtk (Glib more exactly) XDG support function, use internal code instead */
+
+/*
+ * Return XDG environment variable value or "emulated" one.
+ */
+ char_u *
+vim_getxdg (id)
+ XdgEnvId_T id; /* XDG environment variable identifier */
+{
+ /* Default [unexpanded] values, indexed by 'id' */
+ static const char_u *def_value[] = {
+ /* XDG_CACHE_HOME */ "$HOME/.cache",
+ /* XDG_CONFIG_HOME */ "$HOME/.config",
+ /* XDG_DATA_HOME */ "$HOME/.local/share"
+ };
+ /* Cached values */
+ static char_u *env_value[] = { NULL, NULL, NULL };
+
+ char_u *dir;
+
+ if (env_value[id] == NULL) {
+ dir = mch_getenv (xdg_env_name[id]);
+
+ if ((dir != NULL) && (dir[0] != NUL))
+ /* Variable exists and isn't empty => can use it */
+ dir = vim_strsave (dir);
+ else {
+ /* Use expanded default value */
+ dir = alloc (MAXPATHL);
+ expand_env ((char_u*)def_value[id], dir, MAXPATHL);
+ }
+ env_value[id] = dir;
+ }
+ return env_value[id];
+}
+#endif /* !FEAT_GUI_GTK */
+#endif /* !FEAT_XDG_BASEDIR */
+
/*
* Vim's version of getenv().
* Special handling of $HOME, $VIM and $VIMRUNTIME.
+ * When XDG Base Directory support is enabled (FEAT_XDG_BASEDIR),
+ * there's also special handling of $XDG_*_HOME variables.
* Also does ACP to 'enc' conversion for Win32.
* "mustfree" is set to TRUE when returned is allocated, it must be
* initialized to FALSE by the caller.
@@ -4185,6 +4248,33 @@
return p;
}
+#ifdef FEAT_XDG_BASEDIR
+ /* Retrieve XDG environment variable (maybe virtual) value */
+ if (STRCMP (name, xdg_env_name[XDG_CACHE_HOME]) == 0) {
+#ifdef FEAT_GUI_GTK
+ return (char_u*) g_get_user_cache_dir ();
+#else
+ return vim_getxdg (XDG_CACHE_HOME);
+#endif
+ }
+
+ if (STRCMP (name, xdg_env_name[XDG_CONFIG_HOME]) == 0) {
+#ifdef FEAT_GUI_GTK
+ return (char_u*) g_get_user_config_dir ();
+#else
+ return vim_getxdg (XDG_CONFIG_HOME);
+#endif
+ }
+
+ if (STRCMP (name, xdg_env_name[XDG_DATA_HOME]) == 0) {
+#ifdef FEAT_GUI_GTK
+ return (char_u*) g_get_user_data_dir ();
+#else
+ return vim_getxdg (XDG_DATA_HOME);
+#endif
+ }
+#endif /* FEAT_XDG_BASEDIR */
+
vimruntime = (STRCMP(name, "VIMRUNTIME") == 0);
if (!vimruntime && STRCMP(name, "VIM") != 0)
return NULL;
diff -r 10d35c8b50e3 src/os_unix.h
--- a/src/os_unix.h Mon Feb 24 03:32:00 2014 +0100
+++ b/src/os_unix.h Tue Mar 04 21:05:17 2014 +0100
@@ -289,56 +289,64 @@
#endif
#ifndef USR_VIMRC_FILE
-# ifdef VMS
-# define USR_VIMRC_FILE "sys$login:.vimrc"
+# if defined(VMS)
+# define USR_VIMRC_FILE "sys$login:.vimrc"
+# elif defined(FEAT_XDG_BASEDIR)
+# define USR_VIMRC_FILE "$XDG_CONFIG_HOME/vim/vimrc"
# else
-# define USR_VIMRC_FILE "$HOME/.vimrc"
+# define USR_VIMRC_FILE "$HOME/.vimrc"
# endif
#endif
-
-#if !defined(USR_EXRC_FILE2)
-# ifdef OS2
-# define USR_VIMRC_FILE2 "$HOME/vimfiles/vimrc"
+#ifndef USR_EXRC_FILE2
+# if defined(OS2)
+# define USR_VIMRC_FILE2 "$HOME/vimfiles/vimrc"
+# elif defined(VMS)
+# define USR_VIMRC_FILE2 "sys$login:vimfiles:vimrc"
+# elif defined (FEAT_XDG_BASEDIR)
+# define USR_VIMRC_FILE2 "$HOME/.vimrc"
# else
-# ifdef VMS
-# define USR_VIMRC_FILE2 "sys$login:vimfiles:vimrc"
-# else
-# define USR_VIMRC_FILE2 "~/.vim/vimrc"
-# endif
+# define USR_VIMRC_FILE2 "~/.vim/vimrc"
# endif
#endif
-#if !defined(USR_VIMRC_FILE3) && defined(OS2)
-# define USR_VIMRC_FILE3 "$VIM/.vimrc"
-#endif
-#if !defined(USR_VIMRC_FILE3) && defined(VMS)
-# define USR_VIMRC_FILE3 "sys$login:_vimrc"
+#ifndef USR_VIMRC_FILE3
+# if defined(OS2)
+# define USR_VIMRC_FILE3 "$VIM/.vimrc"
+# elif defined(VMS)
+# define USR_VIMRC_FILE3 "sys$login:_vimrc"
+# elif defined(FEAT_XDG_BASEDIR)
+# define USR_VIMRC_FILE3 "~/.vim/vimrc"
+# endif
#endif
#ifndef USR_GVIMRC_FILE
-# ifdef VMS
-# define USR_GVIMRC_FILE "sys$login:.gvimrc"
+# if defined(VMS)
+# define USR_GVIMRC_FILE "sys$login:.gvimrc"
+# elif defined(FEAT_XDG_BASEDIR)
+# define USR_GVIMRC_FILE "$XDG_CONFIG_HOME/vim/gvimrc"
# else
-# define USR_GVIMRC_FILE "$HOME/.gvimrc"
+# define USR_GVIMRC_FILE "$HOME/.gvimrc"
# endif
#endif
#ifndef USR_GVIMRC_FILE2
-# ifdef OS2
-# define USR_GVIMRC_FILE2 "$HOME/vimfiles/gvimrc"
+# if defined(OS2)
+# define USR_GVIMRC_FILE2 "$HOME/vimfiles/gvimrc"
+# elif defined(VMS)
+# define USR_GVIMRC_FILE2 "sys$login:vimfiles:gvimrc"
+# elif defined(FEAT_XDG_BASEDIR)
+# define USR_GVIMRC_FILE2 "$HOME/.gvimrc"
# else
-# ifdef VMS
-# define USR_GVIMRC_FILE2 "sys$login:vimfiles:gvimrc"
-# else
-# define USR_GVIMRC_FILE2 "~/.vim/gvimrc"
-# endif
+# define USR_GVIMRC_FILE2 "~/.vim/gvimrc"
# endif
#endif
-#ifdef VMS
-# ifndef USR_GVIMRC_FILE3
-# define USR_GVIMRC_FILE3 "sys$login:_gvimrc"
+#ifndef USR_GVIMRC_FILE3
+# if defined(VMS)
+# define USR_GVIMRC_FILE3 "sys$login:_gvimrc"
+# elif defined(FEAT_XDG_BASEDIR)
+# define USR_GVIMRC_FILE3 "~/.vim/gvimrc"
# endif
#endif
@@ -348,8 +356,10 @@
#ifdef FEAT_VIMINFO
# ifndef VIMINFO_FILE
-# ifdef VMS
-# define VIMINFO_FILE "sys$login:.viminfo"
+# if defined(VMS)
+# define VIMINFO_FILE "sys$login:.viminfo"
+# elif defined(FEAT_XDG_BASEDIR)
+# define VIMINFO_FILE "$XDG_CACHE_HOME/vim/viminfo"
# else
# define VIMINFO_FILE "$HOME/.viminfo"
# endif
@@ -381,57 +391,60 @@
#endif
#ifndef DFLT_BDIR
-# ifdef OS2
+# if defined(OS2)
# define DFLT_BDIR ".,c:/tmp,~/tmp,~/"
+# elif defined(VMS)
+# define DFLT_BDIR "./,sys$login:,tmp:"
+# elif defined(FEAT_XDG_BASEDIR)
+# define DFLT_BDIR ".,$XDG_CACHE_HOME/vim,~/tmp,~/"
# else
-# ifdef VMS
-# define DFLT_BDIR "./,sys$login:,tmp:"
-# else
-# define DFLT_BDIR ".,~/tmp,~/" /* default for 'backupdir' */
-# endif
+# define DFLT_BDIR ".,~/tmp,~/" /* default for 'backupdir' */
# endif
#endif
#ifndef DFLT_DIR
-# ifdef OS2
+# if defined(OS2)
# define DFLT_DIR ".,~/tmp,c:/tmp,/tmp"
+# elif defined(VMS)
+# define DFLT_DIR "./,sys$login:,tmp:"
+# elif defined(FEAT_XDG_BASEDIR)
+# define DFLT_DIR ".,$XDG_CACHE_HOME/vim,~/tmp,/var/tmp,/tmp"
# else
-# ifdef VMS
-# define DFLT_DIR "./,sys$login:,tmp:"
-# else
-# define DFLT_DIR ".,~/tmp,/var/tmp,/tmp" /* default for 'directory' */
-# endif
+# define DFLT_DIR ".,~/tmp,/var/tmp,/tmp" /* default for 'directory' */
# endif
#endif
#ifndef DFLT_VDIR
-# ifdef OS2
+# if defined(OS2)
# define DFLT_VDIR "$VIM/vimfiles/view"
+# elif defined(VMS)
+# define DFLT_VDIR "sys$login:vimfiles/view"
+# elif defined(FEAT_XDG_BASEDIR)
+# define DFLT_VDIR "$XDG_CONFIG_HOME/vim/view"
# else
-# ifdef VMS
-# define DFLT_VDIR "sys$login:vimfiles/view"
-# else
-# define DFLT_VDIR "$HOME/.vim/view" /* default for 'viewdir' */
-# endif
+# define DFLT_VDIR "$HOME/.vim/view" /* default for 'viewdir' */
# endif
#endif
#define DFLT_ERRORFILE "errors.err"
-#ifdef OS2
-# define DFLT_RUNTIMEPATH "$HOME/vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/vimfiles/after"
+#ifndef RUNTIME_GLOBAL
+ #define RUNTIME_GLOBAL "$VIM/vimfiles"
+#endif
+
+#if defined(OS2)
+# define RUNTIME_USER "$HOME/vimfiles"
+#elif defined(VMS)
+# define RUNTIME_USER "sys$login:vimfiles"
+#elif defined(FEAT_XDG_BASEDIR)
+# define RUNTIME_USER "$XDG_CONFIG_HOME/vim"
#else
-# ifdef VMS
-# define DFLT_RUNTIMEPATH "sys$login:vimfiles,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,sys$login:vimfiles/after"
-# else
-# ifdef RUNTIME_GLOBAL
-# define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after"
-# else
-# define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
-# endif
-# endif
+# define RUNTIME_USER "~/.vim"
#endif
+#define DFLT_RUNTIMEPATH RUNTIME_USER "," RUNTIME_GLOBAL ",$VIMRUNTIME," \
+ RUNTIME_GLOBAL "/after," RUNTIME_USER "/after"
+
#ifdef OS2
/*
* Try several directories to put the temp files.
diff -r 10d35c8b50e3 src/version.c
--- a/src/version.c Mon Feb 24 03:32:00 2014 +0100
+++ b/src/version.c Tue Mar 04 21:05:17 2014 +0100
@@ -699,6 +699,11 @@
#else
"-xim",
#endif
+#ifdef FEAT_XDG_BASEDIR
+ "+xdg_basedir",
+#else
+ "-xdg_basedir",
+#endif
#if defined(UNIX) || defined(VMS)
# ifdef USE_XSMP_INTERACT
"+xsmp_interact",