Vim autoformat error

531 Views Asked by At

After I updated my vim plugins, I am having trouble with the vim autoformat plugin (https://github.com/Chiel92/vim-autoformat).

When I run :Autoformat, I get an error:

For 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

For 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

I have the formatters installed through the apt package manager, which means that according to the autoformat documentation, should mean that the plugin detects them automatically.

I have tried reinstalling the plugin, it did not help.

2

There are 2 best solutions below

1
On

I had the same problem this week on a Debian machine.

After deleting the vim-autoformat folder from ~/.vim/bundles (installed with Vundle) and installing it again (:PluginInstall) everything worked as expected again.

1
On

vim-autoformat detects plugins automatically if they are installed properly. In the case where you don't want to get errors on display and 'Press ENTER or type command to continue' just type :silent Autoformat.