Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Not available. codefmt doesn't have a default formatter for this buffer. #16

Closed
kosich opened this issue Jan 26, 2015 · 14 comments · Fixed by #17
Closed

Error: Not available. codefmt doesn't have a default formatter for this buffer. #16

kosich opened this issue Jan 26, 2015 · 14 comments · Fixed by #17

Comments

@kosich
Copy link

kosich commented Jan 26, 2015

The announcement claims this plugin supports cpp & js natively.
so after installing with vundle ( as provided in the readme file )
when I try to :FormatCode on .cpp or .js files I get following error:
Not available. codefmt doesn't have a default formatter for this buffer.

What I am missing? Should one use VAM or install any additional plugins? Thanks in advance.

@fowles
Copy link
Contributor

fowles commented Jan 26, 2015

Can you post a link to your .vimrc?

@kosich
Copy link
Author

kosich commented Jan 26, 2015

@fowles
Copy link
Contributor

fowles commented Jan 26, 2015

Did you remember to run :BundleUpdate?

@fowles
Copy link
Contributor

fowles commented Jan 26, 2015

Also do you have clang-format installed?

@kosich
Copy link
Author

kosich commented Jan 26, 2015

Ye, updated.
this one?

@fowles
Copy link
Contributor

fowles commented Jan 26, 2015

No, http://clang.llvm.org/docs/ClangFormat.html

Try typing :FormatCode clang-format in vim. That should print the setup instructions if it doesn't like the formatter that you have.

@dbarnett
Copy link
Contributor

If typing clang-format --version on the command line doesn't work, then codefmt won't be able to use it without more configuration. We should give more detailed setup instructions in the codefmt help and possibly change that message to point to more details.

@fowles
Copy link
Contributor

fowles commented Jan 26, 2015

I am in process fixing the error message

@kosich
Copy link
Author

kosich commented Jan 26, 2015

as @fowles pointed, I haven't had clang-format at all: now downloading/installing it. Will report on successful resolving. Thanks!

@dbarnett , ye, would be nice to add that to readme~~, cz there are dumb guys like me, you know~~ =)

@kosich
Copy link
Author

kosich commented Jan 26, 2015

Though :FormatCode clang-format gave proper error:
Formatter "clang-format" is not available. Setup instructions: Install clang-format from http://clang.llvm.org/docs/ClangFormat.html and configure the clang_format_executable flag

@kosich
Copy link
Author

kosich commented Jan 26, 2015

Installed successfully. But since I'm no good in VimL, couldn't figure out how to properly set up the clang_format_executable option. So I had to use Glaive:
Glaive codefmt clang_format_executable='/usr/bin/clang-format-3.5'

Thanks, @fowles !

Guys, could you provide more detailed install/setup instructions in the README ?

@kosich kosich closed this as completed Jan 26, 2015
@dbarnett
Copy link
Contributor

But since I'm no good in VimL, couldn't figure out how to properly set up the clang_format_executable option. So I had to use Glaive

Glaive is the way to properly set up clang_format_executable. Did you get the impression from somewhere there was a better way? Just wondering if we need to do more to clarify that point.

@kosich
Copy link
Author

kosich commented Jan 27, 2015

Hey, sorry for the late reply...

Did you get the impression from somewhere there was a better way?

If you mean installation guide, then just make it clear in the readme, that:

  1. This plugin requires a tool, like clang-format to work
  2. By default it uses clang-format, which should be available via that alias

And

  1. If you haven't got clang-format, you may download it from here
  2. configure Glaive codefmt clang_format_executable='/usr/bin/clang-format-3.5'

( just humanize that, cz I'm kinda sleepy atm )

Also, everyone would be glad to see that clang-format is configurable globally and locally:
http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Anyways, thanks for the replies and the plugin!

@dbarnett
Copy link
Contributor

K, #21 is adding friendly explanations for how each formatter works into vroom files. I probably want to sprinkle some quick pointers in the README and help files and point people to those vroom files for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants