gpt4 book ai didi

vim - Vim启动错误(表达式无效)Debian

转载 作者:行者123 更新时间:2023-12-03 21:06:25 34 4
gpt4 key购买 nike

我在设置Vim时遇到问题。首先,在启动Vim时遇到很多错误,我得到了这些错误:

Error detected while processing /home/lee/.vimrc:
line 5:
E492: Not an editor command: generate helptags for everything in 'runtimepath'
Error detected while processing /home/lee/.vim/plugin/fuf.vim:
line 13:
***** L9 library must be installed! *****
Error detected while processing /home/lee/.vim/plugin/refactor.vim:
line 45:
E492: Not an editor command: ^M
line 53:
E492: Not an editor command: ^M
line 55:
E15: Invalid expression: ["auto", "const", "double", "float", "int", "short", "struct", "unsigned", "break", "continue", "else", "for", "long", "signed", "switch", "void", "case", "default", "enum", "goto", "register", "sizeof", "typedef", "volatile", "char", "do", "extern", "if", "return", "static", "union", "while", "asm", "dynamic_cast", "namespace", "reinterpret_cast", "try", "bool", "explicit", "new", "static_cast", "typeid", "catch", "false", "operator", "template", "typename", "class", "friend", "private", "this", "using", "const_cast", "inline", "public", "throw", "virtual", "delete", "mutable", "protected", "true", "wchar_t", "size_t"]^M
line 56:
E492: Not an editor command: ^M
line 58:
E15: Invalid expression: '\<\h\w*\>'^M
line 59:
E15: Invalid expression: '\s*[*&]*\s*'^M
line 60:
E121: Undefined variable: s:IdentifierPattern
E15: Invalid expression: s:IdentifierPattern . s:TypePostfixPattern^M
line 62:
E121: Undefined variable: s:TypeElementPattern
E15: Invalid expression: '\%(' . s:TypeElementPattern . '\%(' . s:TemplateParameterPattern . s:TypePostfixPattern . '\)*' . s:TypePostfixPattern . '\)\+'^M
line 64:
E15: Invalid expression: '\%(\s\+\n*\s*\|\n\+\|\s*\n*\s\+\)'^M
line 65:
E121: Undefined variable: s:TypeIdentifierPattern
E15: Invalid expression: s:TypeIdentifierPattern . s:MissableSeperatorPattern . s:IdentifierPattern . '\%\(\[\d*\]\)*'^M
line 66:
E121: Undefined variable: s:TypeIdentifierPattern
E15: Invalid expression: '^\s*\%(' . s:TypeIdentifierPattern . s:SeperatorPattern. '\|' . s:IdentifierPattern . '::\)\+' ^M
line 67:
E121: Undefined variable: s:VariableDeclarationPattern
E15: Invalid expression: '(' . s:MissableSeperatorPattern . '\%(' . s:VariableDeclarationPattern . '\%(\s*,' . s:MissableSeperatorPattern . s:VariableDeclarationPattern . '\)*\)*\s*)'^M
line 68:
E121: Undefined variable: s:FunctionPerfixPattern
E15: Invalid expression: s:FunctionPerfixPattern . s:MissableSeperatorPattern . s:IdentifierPattern . s:MissableSeperatorPattern . s:ParameterListPattern . '[^(){;]*'^M
line 69:
E121: Undefined variable: s:FunctionPattern
E15: Invalid expression: s:FunctionPattern . s:MissableSeperatorPattern . '\%(;\)\@='^M
line 70:
E121: Undefined variable: s:FunctionPattern
E15: Invalid expression: s:FunctionPattern . s:MissableSeperatorPattern . '\%({\)\@='^M
line 71:
E492: Not an editor command: ^M
line 72:
E488: Trailing characters
line 114:
E492: Not an editor command: ^M
line 115:
E488: Trailing characters
line 182:
E492: Not an editor command: ^M
line 183:
E488: Trailing characters
line 220:
E492: Not an editor command: ^M
line 221:
E488: Trailing characters
line 240:
E492: Not an editor command: ^M
line 241:
E488: Trailing characters
line 285:
E492: Not an editor command: ^M
line 286:
E488: Trailing characters
line 359:
E492: Not an editor command: ^M
line 360:
E488: Trailing characters
line 372:
E492: Not an editor command: ^M
line 374:
E488: Trailing characters
line 411:
E492: Not an editor command: ^M
line 412:
E488: Trailing characters
line 424:
E492: Not an editor command: ^M
line 425:
E488: Trailing characters
line 432:
E492: Not an editor command: ^M
line 433:
E488: Trailing characters
Press ENTER or type command to continue


另外,当我尝试运行 :helptags ~/.vim/doc时,它根本不会加载。它只是显示一个空白的编辑器屏幕。

非常感谢您的帮助,我已经在网络上搜索了解决方案,但一直无法解决。我真的很想开始使用Vim。谢谢!

编辑:我添加了我的.vimrc

set nocompatible
call pathogen#infect()
execute pathogen#infect()
call pathogen#helptags()
generate helptags for everything in 'runtimepath'
syntax on
filetype plugin indent on

最佳答案

天啊!我看到几个问题:

E492: Not an editor command: generate helptags for everything in 'runtimepath'


您必须在某处以 generate helptags ...开头的行(您的 ~/.vimrc?);它应该是一个注释:在该行之前添加 "



***** L9 library must be installed! *****


FuzzyFinder插件需要另一个插件。您可以在 L9 - Vim-script library上获得它。



Error detected while processing /home/lee/.vim/plugin/refactor.vim:
line 45:
E492: Not an editor command: ^M


这是由在Linux上使用Windows风格的CR-LF行尾的Vimscript文件引起的。在Vim中打开相应的文件,然后通过将其转换为Unix样式的结尾

:w ++ff=unix




希望您在这些之后能开始看到光线。链接到完整的Vim配置将有助于进一步诊断。如果您是Vim的新手,建议您从精简的 .vimrc开始,并随着您变得更加精通并确定需求而逐步添加插件。

关于vim - Vim启动错误(表达式无效)Debian,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21902754/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com