diff options
author | Rory Nesbitt <ranesbitt@live.co.uk> | 2023-09-27 18:09:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-27 10:09:55 -0700 |
commit | a66b0fdfaa35715c832b98b8941cc5673505e0c2 (patch) | |
tree | c61ba5de9fcbcccb9209657cbe3013a0881a385d /runtime | |
parent | bfdec5b0e71991ebc0a8ad7c12d39f7a9cc56f07 (diff) | |
download | rneovim-a66b0fdfaa35715c832b98b8941cc5673505e0c2.tar.gz rneovim-a66b0fdfaa35715c832b98b8941cc5673505e0c2.tar.bz2 rneovim-a66b0fdfaa35715c832b98b8941cc5673505e0c2.zip |
feat: NVIM_APPNAME supports relative paths #25233
Problem:
NVIM_APPNAME does not allow path separators in the name, so relative
paths can't be used:
NVIM_APPNAME="neovim-configs/first-config" nvim
NVIM_APPNAME="neovim-configs/second-config" nvim
Solution:
Let NVIM_APPNAME be a relative path. Absolute paths are not supported.
fix #23056
fix #24966
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/news.txt | 2 | ||||
-rw-r--r-- | runtime/doc/starting.txt | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 05a2d35f9a..ff0ccfb08f 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -169,6 +169,8 @@ The following new APIs and features were added. • |vim.lsp.util.locations_to_items()| sets the `user_data` of each item to the original LSP `Location` or `LocationLink`. +• |$NVIM_APPNAME| can be set to a relative path instead of only a name. + ============================================================================== CHANGED FEATURES *news-changed* diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 17d5b4668d..d38712b067 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1366,6 +1366,9 @@ The $XDG_CONFIG_HOME, $XDG_DATA_HOME, $XDG_RUNTIME_DIR, $XDG_STATE_HOME, $XDG_CACHE_HOME, $XDG_CONFIG_DIRS and $XDG_DATA_DIRS environment variables are used if defined, else default values (listed below) are used. +Throughout the help pages these defaults are used as placeholders, e.g. +"~/.config" is understood to mean "$XDG_CONFIG_HOME or ~/.config". + CONFIG DIRECTORY (DEFAULT) ~ *$XDG_CONFIG_HOME* Nvim: stdpath("config") Unix: ~/.config ~/.config/nvim @@ -1392,10 +1395,12 @@ CACHE DIRECTORY (DEFAULT) ~ Windows: ~/AppData/Local/Temp ~/AppData/Local/Temp/nvim-data LOG FILE (DEFAULT) ~ - `$NVIM_LOG_FILE` Nvim: stdpath("log") + `$NVIM_LOG_FILE` Nvim: stdpath("log")/log Unix: ~/.local/state/nvim ~/.local/state/nvim/log Windows: ~/AppData/Local/nvim-data ~/AppData/Local/nvim-data/log +Note that stdpath("log") is currently an alias for stdpath("state"). + ADDITIONAL CONFIGS DIRECTORY (DEFAULT) ~ *$XDG_CONFIG_DIRS* Nvim: stdpath("config_dirs") Unix: /etc/xdg/ /etc/xdg/nvim @@ -1407,18 +1412,14 @@ ADDITIONAL DATA DIRECTORY (DEFAULT) ~ /usr/share /usr/share/nvim Windows: Not applicable Not applicable -Note: Throughout the help pages these defaults are used as placeholders, e.g. -"~/.config" is understood to mean "$XDG_CONFIG_HOME or ~/.config". - -Note: The log file directory is controlled by `$XDG_STATE_HOME`. - NVIM_APPNAME *$NVIM_APPNAME* The standard directories can be further configured by the `$NVIM_APPNAME` environment variable. This variable controls the sub-directory that Nvim will read from (and auto-create) in each of the base directories. For example, setting `$NVIM_APPNAME` to "foo" before starting will cause Nvim to look for configuration files in `$XDG_CONFIG_HOME/foo` instead of -`$XDG_CONFIG_HOME/nvim`. +`$XDG_CONFIG_HOME/nvim`. `$NVIM_APPNAME` must be a name, such as "foo", or a +relative path, such as "foo/bar". One use-case for $NVIM_APPNAME is to "isolate" Nvim applications. Alternatively, for true isolation, on Linux you can use cgroups namespaces: > |