vim-autoformat / vim-autoformat

Provide easy code formatting in Vim by integrating existing code formatters.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

format .pc (proc)

v6cc opened this issue · comments

commented

I tried a lot vim format can't work on proc file(.pc), this can work.

but
:CurrentFormatter

Error detected while processing function 51_CurrentFormatter:
line 5:
E684: list index out of range: 0

Why is this so?
What format program does it use?

commented

I have ccl to format .c file, but this format result is different

What format program did you configure for proc?

commented

What format program did you configure for proc?

I never configure this , just write .c before and use ccl

I don't understand what you mean, and I don't understand the problem. Please describe exactly what you did, and what you expected to happen.

commented

I don't understand what you mean, and I don't understand the problem. Please describe exactly what you did, and what you expected to happen.

I installed vim-autoformat and not conifgure it .
Then open a .pc file and :Autoformat can work
but I don't know which is the Default formatprograms

I tried

:CurrentFormatter

but get a error

Error detected while processing function 51_CurrentFormatter:
line 5:
E684: list index out of range: 0

because .pc file like .c file , so I guess it use ccls, but if I change the filename a.pc to a.c,
format result not the same

so I want to know the Default formatprograms

Have you read the text at https://github.com/Chiel92/vim-autoformat#how-to-use? I also don't see ccls listed as any default format program at https://github.com/Chiel92/vim-autoformat#default-formatprograms. So this isn't gonna work without any custom configuration.

I would suggest to use clangformat or something. Or if you are required to use ccls, read the text below https://github.com/Chiel92/vim-autoformat#how-can-i-change-the-behaviour-of-formatters-or-add-one-myself.

The reason you would see some formatting happening when you rename to a.c is because vim falls back to indentation only when no format program can be found.

If you don't understand what's happening at some point, read the text at https://github.com/Chiel92/vim-autoformat#help-the-formatter-doesnt-work-as-expected.