[cfe-dev] Slightly improved clang-format vim integration

Tobias Grosser tobias at grosser.es
Mon Sep 16 09:04:04 PDT 2013


On 09/16/2013 05:17 PM, Sean Silva wrote:
> What version of vim are you using? There seem to be a number of things that
> don't work for me (I'm on Ubuntu Linux):
>
> - `:help python-special-path` isn't available

This feature is only available in higher patch levels of vim 7.3

> - `vim.vars` doesn't exist
> - Putting the file in `~/.vim/pythonx` doesn't seem to work (`ImportError:
> No module named clang_format`)

This feature is only available in higher patch levels of vim 7.3

> Overall, I think that being able to configure the formatting behavior from
> e.g. `autocmd FileType` is a win, but this patch doesn't seem to work for
> me.

Steffen, I believe the idea of your patch is great. Unfortunately it has 
from my point two issues:

1) You rely on features of very recent vim versions

As this is not a complicated plugin, there seems no reason to drop 
support for older vim versions.

2) You require python in the .vimrc file

I would prefer to not require python in the .vimrc, but have the plugin 
report an error when it is called without python support.

I believe you can solve both problems by creating a very slim dummy 
plugin, that is in charge of loading the python module and interacts 
with vim.

Cheers,
Tobias




More information about the cfe-dev mailing list