欢迎各位兄弟 发布技术文章
这里的技术是共享的
# vi aaa.txt
报错
E1187: Failed to source defaults.vim
Press ENTER or type command to continue
这个报错很烦人,但是浪费精力不用处理吧,,
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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 ... Hi, for me it works until Version 8.2.2879-1.fc34. Version 8.2.2932-1.fc34 got this bug for me, too. I see that the most recent Version (8.2.2956-1.fc34) throws this error too. 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. FYI the error is harmless, but annoying - you get into 'vi' after you press any key. 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. 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. 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 . Pushed into rawhide for now, thought building it blocked - so the correct status is MODIFIED. *** Bug 1970721 has been marked as a duplicate of this bug. *** FEDORA-2021-e31e9c85c7 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-e31e9c85c7 FEDORA-2021-9aac6c044c has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-9aac6c044c It works now. I am deeply impressed how friendly and fast you did this. Thanks a lot. 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. 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. (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! Seriously, no sarcasm. 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. tks 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. 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 :) 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. |
来自 https://bugzilla.redhat.com/show_bug.cgi?id=1969936
我看到最新版本(8.2.2956-1.fc34)也抛出了这个错误。
仅供参考,该错误是无害的,但很烦人 - 按任意键后您会进入“vi”。
暂时推入生皮,认为构建它被阻止 - 所以正确的状态是 MODIFIED。
现在可以了。你这样做的友好和快速给我留下了深刻的印象。非常感谢。
说真的,没有讽刺。
tks