【问题标题】:Vim autoformat errorVim 自动格式化错误
【发布时间】:2016-02-09 08:49:35
【问题描述】:

更新我的 vim 插件后,我遇到了 vim 自动格式化插件 (https://github.com/Chiel92/vim-autoformat) 的问题。

当我运行 :Autoformat 时,我得到一个错误:

对于html:

Definition in 'g:formatdef_htmlbeautify' was unsuccessful.
Definition in 'g:formatdef_tidy_html' was unsuccessful.
No format definitions were successful.
Press ENTER or type command to continue

对于 C/c++:

Definition in 'g:formatdef_clangformat' was unsuccessful.
Definition in 'g:formatdef_astyle_c' was unsuccessful.
No format definitions were successful.
Press ENTER or type command to continue

我通过 apt 包管理器安装了格式化程序,这意味着根据 autoformat 文档,应该意味着插件会自动检测它们。

我尝试重新安装插件,但没有帮助。

【问题讨论】:

标签: vim autoformat


【解决方案1】:

vim-autoformat 自动检测插件是否安装正确。 如果您不想显示错误并“按 ENTER 或键入命令继续”,只需键入 :silent Autoformat

【讨论】:

  • 静音没有帮助。它没有格式化我的代码 - 它只是给出了我描述的错误消息。格式化程序通过 apt 包管理器安装。
【解决方案2】:

本周我在 Debian 机器上遇到了同样的问题。

~/.vim/bundles(与Vundle 一起安装)中删除vim-autoformat 文件夹并再次安装它(:PluginInstall)后,一切都再次按预期工作。

【讨论】:

  • 谢谢。这为我修好了。奇怪的是,当问题第一次出现时重新安装并没有解决它。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-08-17
  • 2017-10-07
  • 1970-01-01
  • 1970-01-01
  • 2011-04-12
  • 2012-06-13
相关资源
最近更新 更多