欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

cygwin E1187: Failed to source defaults.vim 有大用


# vi aaa.txt

报错

E1187: Failed to source defaults.vim

Press ENTER or type command to continue

这个报错很烦人,但是浪费精力不用处理吧,,



错误 1969936 -无法获取 defaults.vim

关键词                            

状态                            关闭勘误表                            
别名:                            没有任何                            
产品:                            软呢帽                            
零件:                            vim                              



版本:                            34                            
硬件:                            未指定                            
操作系统:                            未指定                            
未指定                            
未指定                            
目标里程碑:                            ---                            
受让人:                            卡斯滕                            
质量保证联系人:                            Fedora Extras 质量保证                            


网址:                            

白板:                            

                           1970721 查看错误列表                            
取决于:                            1970330                            
块:                            

树视图+                            取决于阻塞                            

报告:                            2021-06-09 13:43 UTC 由卡格尼                            
修改的:                            2022-07-11 08:26 UTC(历史                            
7 位用户 (显示)                            
固定版本:                            vim-8.2.2956-2.fc34 vim-8.2.2956-2.fc33                            
文件类型:                             如果需要文档,请设置一个值                            
文档文本:                             
克隆:                            
环境:                            
最后关闭:                            2021-06-16 01:03:59 UTC                            
类型:                            漏洞                            



               
附件                            (使用条款)                            

           

描述卡格尼 2021-06-09 13:43:24 UTC                        
问题描述:

$ vi /tmp/x
E1187: 无法获取 defaults.vim
按 ENTER 或键入命令继续
$ ls -d ~/.vi*
ls: 无法访问'/home/cagney/.vi*': 没有这样的文件或目录
$ 打印环境 | grep 六
$ 打印环境 | grep -e VI -e 编辑器

所选组件的版本号(如果适用):

$ rpm -qif /usr/bin/vi
名称:vim-minimal
时代:2
版本:8.2.2932
发布:1.fc34
架构:x86_64
安装日期:2021 年 6 月 7 日星期一上午 10:19:03

重现性如何:

110%,烦恼程度额外增加 10%

解决方法:

$ sudo dnf 安装 vim-minimal-2:8.2.2637-1.fc34
$ vi /tmp/x
...一切恢复正常...

                   
评论 1马库斯·特伯 2021-06-10 05:52:43 UTC                        
你好,

对我来说,它一直有效到版本 8.2.2879-1.fc34。

版本 8.2.2932-1.fc34 也为我解决了这个错误。

                   
评论 2马库斯·特伯 2021-06-10 05:54:49 UTC                        
我看到最新版本(8.2.2956-1.fc34)也抛出了这个错误。

                   
评论 3兹德内克·多纳尔 2021-06-10 06:03:09 UTC                        
嗨,卡格尼和马库斯,

感谢您报告问题!

其实我发现了两个问题:

1) vi 生成您报告的错误 - 这是因为上游在未加载 defaults.vim 时添加了此错误(补丁级别 2905),这不是 vi 的设计,因为 defaults.vim 仅在 vim-common 中提供,这是vim增强的依赖。

2) /etc/virc 在 'vi' 的情况下根本不加载


我会进一步研究这个问题。

                   
评论 4兹德内克·多纳尔 2021-06-10 06:04:52 UTC                        
仅供参考,该错误是无害的,但很烦人 - 按任意键后您会进入“vi”。

                   
评论 5兹德内克·多纳尔 2021-06-10 07:32:13 UTC                        
实际上,我收回了 2) - /etc/virc 被读取:

第3162章

这部分代码报错:

第3169章 /*
3170 * 尝试从以下位置读取初始化命令:
3171 * - 环境变量 VIMINIT
3172 * - 用户 vimrc 文件(s:.vimrc 用于 Amiga,~/.vimrc 否则)
3173 * - 第二个用户 vimrc 文件 ($VIM/.vimrc for Dos)
第3174章
3175 * - 用户 exrc 文件(s:.exrc 用于 Amiga,~/.exrc 否则)
3176 * - 第二个用户 exrc 文件 ($VIM/.exrc for Dos)
3177 * 使用第一个存在的,忽略其余的。
3178 */
第3179章
第3180章
第3181章
第3182章
.
.
.
第3202章
第3203章
3204 // 当没有找到 .vimrc 文件时:源 defaults.vim。
第3205章
3206 空)== 失败)
第3207章
第3208章

这意味着如果没有用户的 .vimrc/.exrc 文件,则会尝试加载 defaults.vim。

但是,一旦您调用“vi --clean”,就会发生同样的错误。

我也会尝试用 vim-minimal 发送 defaults.vim - 我需要再次更改 vim-common 和 vim-minimal 之间的冲突。

                   
评论 6兹德内克·多纳尔 2021-06-10 08:50:35 UTC                        
如果有人想为 vim-minimal 关闭 defaults.vim,你可以添加:

让 skip_defaults_vim = 1

进入 /etc/virc 或你的个人 ~/.virc。

                   
评论 7兹德内克·多纳尔 2021-06-10 09:26:17 UTC                        
对不起,重建在生皮中被阻止了。Vim 在新的 Python3.10 中开始失败。

我也会调查一下 - 在这里报告https://bugzilla.redhat.com/show_bug.cgi?id=1970330

                   
评论 8兹德内克·多纳尔 2021-06-10 11:52:00 UTC                        
暂时推入生皮,认为构建它被阻止 - 所以正确的状态是 MODIFIED。

                   
评论 9兹德内克·多纳尔 2021-06-11 04:46:12 UTC                        
***错误 1970721已被标记为此错误的副本。***

                   
评论 10Fedora 更新系统 2021-06-14 14:16:58 UTC                        
FEDORA-2021-e31e9c85c7 已作为 Fedora 34 的更新提交。https://bodhi.fedoraproject.org/updates/FEDORA-2021-e31e9c85c7

                   
评论 11Fedora 更新系统 2021-06-14 14:32:47 UTC                        
FEDORA-2021-9aac6c044c 已作为 Fedora 33 的更新提交。https://bodhi.fedoraproject.org/updates/FEDORA-2021-9aac6c044c

                   
评论 12马库斯·特伯 2021-06-14 19:11:50 UTC                        
现在可以了。你这样做的友好和快速给我留下了深刻的印象。非常感谢。

                   
评论 13Fedora 更新系统 2021-06-15 01:08:38 UTC                        
FEDORA-2021-e31e9c85c7 已被推送到 Fedora 34 测试存储库。
很快您就可以使用以下命令安装更新:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-e31e9c85c7`
您可以在此处提供有关此更新的反馈:https ://bodhi.fedoraproject.org/updates/FEDORA-2021-e31e9c85c7
有关如何测试更新的更多信息,
另请参阅https://fedoraproject.org/wiki/QA:Updates_Testing 。

                   
评论 14Fedora 更新系统 2021-06-15 01:53:45 UTC                        
FEDORA-2021-9aac6c044c 已被推送到 Fedora 33 测试存储库。
很快您就可以使用以下命令安装更新:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-9aac6c044c`
您可以在此处提供有关此更新的反馈:https ://bodhi.fedoraproject.org/updates/FEDORA-2021-9aac6c044c
有关如何测试更新的更多信息,
另请参阅https://fedoraproject.org/wiki/QA:Updates_Testing 。

                   
评论 15兹德内克·多纳尔 2021-06-15 04:29:06 UTC                        
(从评论 #12回复 Markus Teuber )
 > 现在可以使用了。你这样做的友好和快速给我留下了深刻的印象。
> 非常感谢。

没问题,不客气——我只希望你不是讽刺:)。

感谢您报告问题!

                   
评论 16马库斯·特伯 2021-06-15 04:48:13 UTC                        
说真的,没有讽刺。

                   
评论 17Fedora 更新系统 2021-06-16 01:03:59 UTC                        
FEDORA-2021-e31e9c85c7 已被推送到 Fedora 34 稳定存储库。
如果问题仍然存在,请在此错误报告中记录。

                   
评论 18卡格尼 2021-06-17 17:23:18 UTC                        
tks

                   
评论 19Fedora 更新系统 2021-06-23 01:13:39 UTC                        
FEDORA-2021-9aac6c044c 已被推送到 Fedora 33 稳定存储库。
如果问题仍然存在,请在此错误报告中记录。

                   
评论 20约翰·鲁克斯图尔 2022-06-30 14:06:07 UTC                        
你好,
我认为一种解决方法可以使用,直到将气泡修复到所有...
触摸 ~/.exrc
换句话说,如果 vim 甚至可以读取一个空的 .exrc,那么它就不会抱怨。
如果我误解了什么,请告诉我:)

                   
评论 21兹德内克·多纳尔 2022-07-11 08:26:23 UTC                        
你好,约翰,

修复程序现在应该在 Fedora 中使用一年 - 你仍然得到错误吗?

我简单检查了 F36 并没有显示错误,因为 defaults.vim 现在由 vim-data 子包提供,其中包含所有 Vim 版本(vi/vim/gvim)所需的文件,这解决了大多数人的问题。

但可以肯定的是,你的方式也行得通,虽然它需要用户干预,我在包装过程中无法模仿。

                   
Bug 1969936 Failed to source defaults.vim

Keywords:

Status:CLOSED ERRATA                            
Alias:                            None
Product:                            Fedora
Component:                            vim                              



Version:                            34                            
Hardware:                            Unspecified
OS:                            Unspecified
unspecified
unspecified
Target Milestone:                            ---                            
Assignee:                            Karsten                            
QA Contact:                            Fedora Extras Quality Assurance                            


URL:                            

Whiteboard:                            

:1970721 (view as bug list)
Depends On:                            1970330                            
Blocks:                            

TreeView+depends on / blocked                            

Reported:                            2021-06-09 13:43 UTC by cagney                            
Modified:                            2022-07-11 08:26 UTC (History)
7 users (show)                            
Fixed In Version:                            vim-8.2.2956-2.fc34 vim-8.2.2956-2.fc33
Doc Type:                             If docs needed, set a value                            
Doc Text:                             
Clone Of:                            
Environment:                            
Last Closed:                            2021-06-16 01:03:59 UTC
Type:                            Bug



               
Attachments(Terms of Use)                            

           

Descriptioncagney 2021-06-09 13:43:24 UTC                        
Description of problem:

$ vi /tmp/x
E1187: Failed to source defaults.vim
Press ENTER or type command to continue
$ ls -d ~/.vi*
ls: cannot access '/home/cagney/.vi*': No such file or directory
$ printenv | grep VI
$ printenv | grep -e VI -e EDITOR

Version-Release number of selected component (if applicable):

$ rpm -qif /usr/bin/vi
Name        : vim-minimal
Epoch       : 2
Version     : 8.2.2932
Release     : 1.fc34
Architecture: x86_64
Install Date: Mon 07 Jun 2021 10:19:03 AM

How reproducible:

110%, extra 10% for annoyance level

Workaround:

$ sudo dnf install vim-minimal-2:8.2.2637-1.fc34
$ vi /tmp/x
... everything back to normal ...

                   
Comment 1Markus Teuber 2021-06-10 05:52:43 UTC                        
Hi,

for me it works until Version 8.2.2879-1.fc34.

Version 8.2.2932-1.fc34 got this bug for me, too.

                   
Comment 2Markus Teuber 2021-06-10 05:54:49 UTC                        
I see that the most recent Version (8.2.2956-1.fc34) throws this error too.

                   
Comment 3Zdenek Dohnal 2021-06-10 06:03:09 UTC                        
Hi cagney and Markus,

thank you for reporting the issue!

Actually I found out two issues:

1) vi generates the error you reported - it is because upstream added this error once defaults.vim isn't loaded (patchlevel 2905), which isn't by design in case vi, because defaults.vim is shipped only in vim-common, which is dependency of vim-enhanced.

2) /etc/virc isn't loaded at all in case of 'vi'


I'll look into this issue further.

                   
Comment 4Zdenek Dohnal 2021-06-10 06:04:52 UTC                        
FYI the error is harmless, but annoying - you get into 'vi' after you press any key.

                   
Comment 5Zdenek Dohnal 2021-06-10 07:32:13 UTC                        
Actually, I take back the 2) - /etc/virc is read by:

3162		(void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE, NULL);

The error is reported by this part of code:

3169         /*
3170          * Try to read initialization commands from the following places:
3171          * - environment variable VIMINIT
3172          * - user vimrc file (s:.vimrc for Amiga, ~/.vimrc otherwise)
3173          * - second user vimrc file ($VIM/.vimrc for Dos)
3174          * - environment variable EXINIT
3175          * - user exrc file (s:.exrc for Amiga, ~/.exrc otherwise)
3176          * - second user exrc file ($VIM/.exrc for Dos)
3177          * The first that exists is used, the rest is ignored.
3178          */
3179         if (process_env((char_u *)"VIMINIT", TRUE) != OK)
3180         {
3181             if (do_source((char_u *)USR_VIMRC_FILE, TRUE,
3182                                                       DOSO_VIMRC, NULL) == FAIL
.
.
.
3202                 && !has_dash_c_arg)
3203             {
3204                 // When no .vimrc file was found: source defaults.vim.
3205                 if (do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE,
3206                                                                  NULL) == FAIL)
3207                     emsg(e_failed_to_source_defaults);
3208             }

which means defaults.vim is tried to be loaded if there is no user's .vimrc/.exrc files.

But the same error happens once you call 'vi --clean'.

I'll try to ship defaults.vim with vim-minimal too - I will need to change Conflicts between vim-common and vim-minimal again.

                   
Comment 6Zdenek Dohnal 2021-06-10 08:50:35 UTC                        
If anyone wants to turn off defaults.vim for vim-minimal, you can add:

let skip_defaults_vim = 1

into /etc/virc or into your personal ~/.virc.

                   
Comment 7Zdenek Dohnal 2021-06-10 09:26:17 UTC                        
Sorry, the rebuild is blocked in rawhide. Vim started to fail with new Python3.10.

I'll look into that too - reported here https://bugzilla.redhat.com/show_bug.cgi?id=1970330 .

                   
Comment 8Zdenek Dohnal 2021-06-10 11:52:00 UTC                        
Pushed into rawhide for now, thought building it blocked - so the correct status is MODIFIED.

                   
Comment 9Zdenek Dohnal 2021-06-11 04:46:12 UTC                        
*** Bug 1970721 has been marked as a duplicate of this bug. ***

                   
Comment 10Fedora Update System 2021-06-14 14:16:58 UTC                        
FEDORA-2021-e31e9c85c7 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-e31e9c85c7

                   
Comment 11Fedora Update System 2021-06-14 14:32:47 UTC                        
FEDORA-2021-9aac6c044c has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-9aac6c044c

                   
Comment 12Markus Teuber 2021-06-14 19:11:50 UTC                        
It works now. I am deeply impressed how friendly and fast you did this. Thanks a lot.

                   
Comment 13Fedora Update System 2021-06-15 01:08:38 UTC                        
FEDORA-2021-e31e9c85c7 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-e31e9c85c7`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-e31e9c85c7

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

                   
Comment 14Fedora Update System 2021-06-15 01:53:45 UTC                        
FEDORA-2021-9aac6c044c has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-9aac6c044c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-9aac6c044c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

                   
Comment 15Zdenek Dohnal 2021-06-15 04:29:06 UTC                        
(In reply to Markus Teuber from comment #12)
> It works now. I am deeply impressed how friendly and fast you did this.
> Thanks a lot.

No problem, you're welcome - I can just hope you didn't mean it as a sarcasm :) .

Thank you for reporting the issue!

                   
Comment 16Markus Teuber 2021-06-15 04:48:13 UTC                        
Seriously, no sarcasm.

                   
Comment 17Fedora Update System 2021-06-16 01:03:59 UTC                        
FEDORA-2021-e31e9c85c7 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

                   
Comment 18cagney 2021-06-17 17:23:18 UTC                        
tks

                   
Comment 19Fedora Update System 2021-06-23 01:13:39 UTC                        
FEDORA-2021-9aac6c044c has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

                   
Comment 20John Ruckstuhl 2022-06-30 14:06:07 UTC                        
Hi,
I think a workaround to use until fix bubbles down to all ...
touch ~/.exrc
In other words, if vim is able to read even an empty .exrc, then it won't complain.
If I'm misunderstanding something, pls let me know :)

                   
Comment 21Zdenek Dohnal 2022-07-11 08:26:23 UTC                        
Hi John,

the fix should be in Fedora for a year right now - do you still get the error?

I've briefly checked F36 and the error is not shown, because defaults.vim is now provided by vim-data subpackage, which contains files needed by all Vim versions (vi/vim/gvim), which solves the issue for most people.

But sure, your way works as well, although it requires user intervention, which I cannot imitate during packaging.

                   


NoteYou need to log in before you can comment on or make changes to this bug.


来自  https://bugzilla.redhat.com/show_bug.cgi?id=1969936


普通分类: