The general idea definitely works with other languages but, simply by using C/C++, you benefit from lots of defaults being set for C: :help 'include'
, :help 'define'
, etc. even :help 'path'
itself. For other languages, you may need to set those yourself, which may or may not be an acceptable waste of your time. Moreover the differences in language design can make things way too complicated. PHP, for example, is insanely difficult to do right.
define
and include
are already set for Python by the built-in ftplugin, so all you need is to make sure that path
covers your (implied) needs.
Note that doing this with the :help FileType
event would make more sense:
autocmd FileType c,cpp setlocal path+=whatever
and doing it in a ftplugin would be even better:
" in after/ftplugin/c.vim
setlocal path+=/whatever
" in after/ftplugin/cpp.vim
setlocal path+=/whatever
" in after/ftplugin/python.vim
setlocal path+=/whatever
That said… if you need an IDE, get an IDE.