commit:     5a5ef85723c7584cfe82afd2244ba8ec64bc60a9
Author:     D. Ben Knoble <ben.knoble+github <AT> gmail <DOT> com>
AuthorDate: Wed Nov  5 22:20:00 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 16 07:57:38 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a5ef857

app-editors/vim-core: set buffer options locally

Otherwise, they affect global settings and can bleed into other,
subsequently opened buffers without warning.

The fileencoding option is also set via a similar pattern, but it is
only buffer local, so avoid the :setlocal there (it would be harmless).

Signed-off-by: D. Ben Knoble <ben.knoble+github <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44504
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-editors/vim-core/files/vimrc-r8 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app-editors/vim-core/files/vimrc-r8 
b/app-editors/vim-core/files/vimrc-r8
index c770ab2ef3f6..150059c7e602 100644
--- a/app-editors/vim-core/files/vimrc-r8
+++ b/app-editors/vim-core/files/vimrc-r8
@@ -162,7 +162,7 @@ augroup gentoo
   " Better to emerge app-vim/gentoo-syntax, which provides full syntax,
   " filetype and indent settings for all things Gentoo.
   au BufRead,BufNewFile *.e{build,class} let is_bash=1|setfiletype sh
-  au BufRead,BufNewFile *.e{build,class} set ts=4 sw=4 noexpandtab
+  au BufRead,BufNewFile *.e{build,class} setl ts=4 sw=4 noexpandtab
 
   " When editing a file, always jump to the last cursor position
   autocmd BufReadPost *
@@ -174,7 +174,7 @@ augroup gentoo
 
   " When editing a crontab file, set backupcopy to yes rather than auto. See
   " :help crontab and bug #53437.
-  autocmd FileType crontab set backupcopy=yes
+  autocmd FileType crontab setl backupcopy=yes
 
   " If we previously detected that the default encoding is not UTF-8
   " (g:added_fenc_utf8), assume that a file with only ASCII characters (or no

Reply via email to