feat(exrc): stop searching in parent directories by unsetting 'exrc'

Problem:
No way for a user to limit 'exrc' search in parent directories (compare
editorconfig.root).

Solution:
A configuration file can unset 'exrc', disabling the search for its
parent directories.
This commit is contained in:
Yochem van Rosmalen
2025-05-19 16:18:03 +02:00
parent dc6fc11b87
commit 8d397fa458
6 changed files with 46 additions and 29 deletions

View File

@@ -123,6 +123,7 @@ DEFAULTS
• 'statusline' default is exposed as a statusline expression (previously it
was implemented as an internal C routine).
• Project-local configuration ('exrc') is also loaded from parent directories.
Unset 'exrc' to stop further search.
DIAGNOSTICS

View File

@@ -2416,6 +2416,9 @@ A jump table for the options with a short description can be found at |Q_op|.
directories (ordered upwards), if the files are in the |trust| list.
Use |:trust| to manage trusted files. See also |vim.secure.read()|.
Unset 'exrc' to stop further searching of 'exrc' files in parent
directories, similar to |editorconfig.root|.
Compare 'exrc' to |editorconfig|:
- 'exrc' can execute any code; editorconfig only specifies settings.
- 'exrc' is Nvim-specific; editorconfig works in other editors.