aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-03-06 04:04:25 +0100
committerGitHub <noreply@github.com>2017-03-06 04:04:25 +0100
commit483e8257e5a28893bcd1de089715f82798d0f93a (patch)
tree6ce5bde550febda5ee22dab6989f7f71c4f6ce0c
parente5be3aaaefe75bd5ba1d0ac98bf1d9622e649adb (diff)
downloadrneovim-483e8257e5a28893bcd1de089715f82798d0f93a.tar.gz
rneovim-483e8257e5a28893bcd1de089715f82798d0f93a.tar.bz2
rneovim-483e8257e5a28893bcd1de089715f82798d0f93a.zip
vim_getenv: $VIMRUNTIME fallback: ../share/nvim/runtime (#6223)
Do this on all systems, so that portable builds work everywhere. This allows us to ship archives with this folder structure: bin/nvim share/nvim/runtime then ./bin/nvim works without the user needing to explicitly set VIMRUNTIME.
-rw-r--r--runtime/doc/starting.txt9
-rw-r--r--src/nvim/os/env.c4
2 files changed, 3 insertions, 10 deletions
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 9284aaea58..2c024d3c75 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -657,15 +657,10 @@ is the order used to find the value of $VIMRUNTIME:
3. If "$VIM/runtime" exists, it is used.
4. The value of $VIM is used. This is for backwards compatibility with older
versions.
-5. When the 'helpfile' option is set and doesn't contain a '$', its value is
+5. If "../share/nvim/runtime" exists relative to |v:progpath|, it is used.
+6. When the 'helpfile' option is set and doesn't contain a '$', its value is
used, with "doc/help.txt" removed from the end.
-For Unix, when there is a compiled-in default for $VIMRUNTIME (check the
-output of ":version"), steps 2, 3 and 4 are skipped, and the compiled-in
-default is used after step 5. This means that the compiled-in default
-overrules the value of $VIM. This is useful if $VIM is "/etc" and the runtime
-files are in "/usr/share/vim/vim54".
-
Once Vim has done this once, it will set the $VIMRUNTIME environment variable.
To change it later, use a ":let" command like this: >
:let $VIMRUNTIME = "/home/piet/vim/vim54"
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 1697d5edb2..a73d753e46 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -615,8 +615,7 @@ char *vim_getenv(const char *name)
vim_path = (char *)p_hf;
}
-#ifdef WIN32
- // Find runtime path relative to the nvim binary i.e. ../share/runtime
+ // Find runtime path relative to the nvim binary: ../share/nvim/runtime
if (vim_path == NULL) {
char exe_name[MAXPATHL];
size_t exe_name_len = MAXPATHL;
@@ -633,7 +632,6 @@ char *vim_getenv(const char *name)
}
}
}
-#endif
if (vim_path != NULL) {
// remove the file name