vim-clang-format: clang-format is not found
If you check what is contained in the package clang-format-6.0
(dpkg -L clang-format-6.0
) you will find that it does not install clang-format
into the /usr/bin
directory. But you will find that it does install it to /usr/lib/llvm-6.0/bin
instead.
One possible solution would be to add /usr/lib/llvm-6.0/bin
to your PATH
variable. Under this path clang-format
is available. The command /usr/bin/clang-format-6.0
is just a symbolic link to it, so it should be equivalent to using clang-format-6.0
. Why the package maintainer decided to not link /usr/bin/clang-format
as well is not clear to me.
If you are unsure how to do that you may want to look it up here: https://help.ubuntu.com/community/EnvironmentVariables
Related videos on Youtube
Comments
-
KestrelW over 1 year
I installed
clang-format
on Ubuntu 18.04 LTS withsudo apt install clang-format
and the installation was successful. I can executeclang-format-6.0
now, but when I useClangFormat
in vim, it tells me that "clang-format is not found". How can I fix the problem?