Closed bfrg closed 6 years ago
So one thing to note is that ftplugin/cpp.vim
loads all the c
filetype plugins, which means that a filetype of cpp
will load both c_apathy.vim
and cpp_apathy.vim
. That means we can ditch the duplicate parts in cpp_apathy.vim
, and it might mean we want to handle the path change a bit differently?
You're right about the duplicates. So how would you handle the path change?
Now that I've thought about it, I think the least worst way would be an if &filetype ==# 'cpp' ... else
conditional for the unique parts.
The preprocessor lists additional system include paths for C++ (check with
cpp -v -x c++
, as opposed tocpp -v -x c
). So a new file forcpp
filetypes should be added.I renamed the old
g:cpp_path
tog:c_path
inc_apathy.vim
(I thought the prefix resembles the filetype).g:cpp_path
holds now all system include paths for filetypecpp
.I know it's quite confusing. There's the command
cpp
(the C preprocessor) and there's the filetypecpp
.