summaryrefslogtreecommitdiffstats
path: root/src/os_unix.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 02:10:58 +0000
commitbee19c22d569e54513a9c591441c7f411811dc81 (patch)
treeb990d2df9fddb8194bfe49e9205005a0d952bc1f /src/os_unix.h
parentAdding upstream version 2:9.1.0199. (diff)
downloadvim-bee19c22d569e54513a9c591441c7f411811dc81.tar.xz
vim-bee19c22d569e54513a9c591441c7f411811dc81.zip
Adding upstream version 2:9.1.0374.upstream/2%9.1.0374
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/os_unix.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/os_unix.h b/src/os_unix.h
index 4c77e15..6efd8ce 100644
--- a/src/os_unix.h
+++ b/src/os_unix.h
@@ -249,6 +249,12 @@ typedef struct dsc$descriptor DESC;
# endif
#endif
+#ifndef XDG_VIMRC_FILE
+# define XDG_VIMRC_FILE (mch_getenv("XDG_CONFIG_HOME") \
+ ? "$XDG_CONFIG_HOME/vim/vimrc" \
+ : "~/.config/vim/vimrc")
+#endif
+
#if !defined(USR_VIMRC_FILE3) && defined(VMS)
# define USR_VIMRC_FILE3 "sys$login:_vimrc"
#endif
@@ -273,6 +279,12 @@ typedef struct dsc$descriptor DESC;
# ifndef USR_GVIMRC_FILE3
# define USR_GVIMRC_FILE3 "sys$login:_gvimrc"
# endif
+#else
+# ifndef USR_GVIMRC_FILE3
+# define USR_GVIMRC_FILE3 (mch_getenv("XDG_CONFIG_HOME") \
+ ? "$XDG_CONFIG_HOME/vim/gvimrc" \
+ : "~/.config/vim/gvimrc")
+# endif
#endif
#ifndef VIM_DEFAULTS_FILE
@@ -349,13 +361,19 @@ typedef struct dsc$descriptor DESC;
# ifdef RUNTIME_GLOBAL
# ifdef RUNTIME_GLOBAL_AFTER
# define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER ",~/.vim/after"
+# define XDG_RUNTIMEPATH "$XDG_CONFIG_HOME/vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER "/after,$XDG_CONFIG_HOME/vim/after"
+# define XDG_RUNTIMEPATH_FB "~/.config/vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER "/after,~/.config/vim/after"
# define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER
# else
# define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after"
+# define XDG_RUNTIMEPATH "$XDG_CONFIG_HOME/vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,$XDG_CONFIG_HOME/vim/after"
+# define XDG_RUNTIMEPATH_FB "~/.config/vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.config/vim/after"
# define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after"
# endif
# else
# define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
+# define XDG_RUNTIMEPATH "$XDG_CONFIG_HOME/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$XDG_CONFIG_HOME/vim/after"
+# define XDG_RUNTIMEPATH_FB "~/.config/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.config/vim/after"
# define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"
# endif
# endif