Closed xuhdev closed 12 years ago
This won't work very well. If you have a .hxx file, then a .cpp file will be created if there is no match (i.e. you don't have a .cxx file). These should be separate rules - i.e. one for .cxx, one for .C, etc...
What about this one?
au BufEnter *.h,*.hpp call s:SetVariables('cpp,cxx,C,c', 'reg:/include/src/,reg:/include.*/src/,ifrel:|/include/|../src|')
au BufEnter *.hxx call s:SetVariables('cxx,c,C,cpp', 'reg:/include/src/,reg:/include.*/src/,ifrel:|/include/|../src|')
au BufEnter *.H call s:SetVariables('C,c,cpp,cxx', 'reg:/include/src/,reg:/include.*/src/,ifrel:|/include/|../src|')
au BufEnter *.c,*.cpp call s:SetVariables('h,H,hpp,hxx', 'reg:/src/include/,reg:|src|include/**|,ifrel:|/src/|../include|')
au BufEnter *.cxx call s:SetVariables('hxx,h,H,hpp', 'reg:/src/include/,reg:|src|include/**|,ifrel:|/src/|../include|')
au BufEnter *.C call s:SetVariables('H,h,hpp,hxx', 'reg:/src/include/,reg:|src|include/**|,ifrel:|/src/|../include|')
If you let me make some modifications, I'll pull this in.
Essentially, what I'd do is:
That's it. What you've got above is far to "mix and match" kind of stuff, that doesn't help anyone really code to any internal standard. I think this tool should help people keep their standards, out of the box. If they want to do something "weird" then they can customize after that.
OK. That would be fine
Ok, I'm going to close this merge request and just submit it as a new change.
A suggestion:
cxx maps to hxx, h h maps to cpp, cxx, c
Since many people use h
and cxx
instead of cpp
.
I disagree. I think cxx is the devil - stupid extension - and after 18 years of C++ development, I have /never/ encountered in a real project. cxx is out. cpp is the most common extension by far... in general, I follow the Boost conventions as law in most cases.
Add the support of .hpp, .hxx, .H, .cxx, *.C. They are all commonly used.