aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorGhjuvan Lacambre <code@lacamb.re>2023-02-16 13:15:02 +0100
committerGitHub <noreply@github.com>2023-02-16 04:15:02 -0800
commitd34c64e342dfba9248d1055e702d02620a1b31a8 (patch)
treea685ef816f1621092ec82ea17d22fbd3a8c03957 /runtime
parent631775c05d257e5e61af31d20d9fd5be2dba82c2 (diff)
downloadrneovim-d34c64e342dfba9248d1055e702d02620a1b31a8.tar.gz
rneovim-d34c64e342dfba9248d1055e702d02620a1b31a8.tar.bz2
rneovim-d34c64e342dfba9248d1055e702d02620a1b31a8.zip
feat: $NVIM_APPNAME #22128
This commit implements the ability to control all of the XDG paths Neovim should use. This is done by setting an environment variable named NVIM_APPNAME. For example, setting $NVIM_APPNAME makes Neovim look for its configuration directory in $XDG_CONFIG_HOME/$NVIM_APPNAME instead of $XDG_CONFIG_HOME/nvim. If NVIM_APPNAME is not set or is an empty string, "nvim" will be used as default. The usecase for this feature is to enable an easy way to switch from configuration to configuration. One might argue that the various $XDG environment variables can already be used for this usecase. However, setting $XDG environment variables also affects tools spawned by Neovim. For example, while setting $XDG_CONFIG_HOME will enable Neovim to use a different configuration directory, it will also prevent Git from finding its "default" configuration. Closes https://github.com/neovim/neovim/issues/21691
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/news.txt4
-rw-r--r--runtime/doc/starting.txt12
2 files changed, 16 insertions, 0 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 2afb22bb43..ae21bc47ca 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -55,6 +55,10 @@ NEW FEATURES *news-features*
The following new APIs or features were added.
+• A new environment variable named NVIM_APPNAME enables configuring the
+ directories where Neovim should find its configuration and state files. See
+ `:help $NVIM_APPNAME` .
+
• |nvim_open_win()| now accepts a relative `mouse` option to open a floating win
relative to the mouse. Note that the mouse doesn't update frequently without
setting `vim.o.mousemoveevent = true`
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 5e0718c3bb..67a88913fb 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1385,6 +1385,18 @@ STATE DIRECTORY (DEFAULT) ~
Note: Throughout the user manual these defaults are used as placeholders, e.g.
"~/.config" is understood to mean "$XDG_CONFIG_HOME or ~/.config".
+NVIM_APPNAME *$NVIM_APPNAME*
+The XDG directories used by Nvim can be further configured by setting the
+`$NVIM_APPNAME` environment variable. This variable controls the directory
+Neovim will look for (and auto-create) in the various XDG parent directories.
+For example, setting `$NVIM_APPNAME` to "neovim" before running Neovim will
+result in Neovim looking for configuration files in `$XDG_CONFIG_HOME/neovim`
+instead of `$XDG_CONFIG_HOME/nvim`.
+
+Note: Similarly to the $XDG environment variables, when
+`$XDG_CONFIG_HOME/nvim` is mentionned, it should be understood as
+`$XDG_CONFIG_HOME/$NVIM_APPNAME`.
+
LOG FILE *$NVIM_LOG_FILE* *E5430*
Besides 'debug' and 'verbose', Nvim keeps a general log file for internal
debugging, plugins and RPC clients. >