diff options
author | Luca Saccarola <github.e41mv@aleeas.com> | 2024-04-14 22:53:22 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-04-14 22:57:50 +0200 |
commit | c9df1fb35a1866901c32df37dd39c8b39dbdb64a (patch) | |
tree | 321271a5ea8e877d12cc359c658a8188f58553f7 /src/os_unix.h | |
parent | f9f5424d3e75bbdb35aa48fa6f9241d9479b35e8 (diff) |
patch 9.1.0327: No support for using $XDG_CONFIG_HOMEv9.1.0327
Problem: No support for using $XDG_CONFIG_HOME
Solution: optionally source $XDG_CONFIG_HOME/vim/vimrc
(Luca Saccarola)
fixes: #2034
closes: #14182
Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/os_unix.h')
-rw-r--r-- | src/os_unix.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/os_unix.h b/src/os_unix.h index 4c77e15862..37b0ba2e18 100644 --- a/src/os_unix.h +++ b/src/os_unix.h @@ -236,7 +236,7 @@ typedef struct dsc$descriptor DESC; # ifdef VMS # define USR_VIMRC_FILE "sys$login:.vimrc" # else -# define USR_VIMRC_FILE "$HOME/.vimrc" +# define USR_VIMRC_FILE "~/.vimrc" # endif #endif @@ -249,6 +249,12 @@ typedef struct dsc$descriptor DESC; # endif #endif +#ifndef XDG_VIMRC_FILE +# define XDG_VIMRC_FILE mch_getenv("XDG_CONFIG_HOME") \ + ? (char_u *)"$XDG_CONFIG_HOME/vim/vimrc" \ + : (char_u *)"~/.config/vim/vimrc" +#endif + #if !defined(USR_VIMRC_FILE3) && defined(VMS) # define USR_VIMRC_FILE3 "sys$login:_vimrc" #endif @@ -349,13 +355,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 |