Autocomplete c lang with vim

71 views
Skip to first unread message

M.R.P. zensky

unread,
Apr 17, 2021, 7:02:48 AM4/17/21
to v...@vim.org
Hello I am wondering vim has wonderfull simple autocomplete for. html css javascript to enable autocomplete you just enter one line of code , however what about other languages like c c++ javaa python. Is th a simple way to get autocomplete for vim without a plug in?

Tony Mechelynck

unread,
Apr 17, 2021, 7:44:39 AM4/17/21
to vim_use, Vim mailing list
On Sat, Apr 17, 2021 at 1:02 PM 'M.R.P. zensky' via vim_use
<vim...@googlegroups.com> wrote:
>
> Hello I am wondering vim has wonderfull simple autocomplete for. html css javascript to enable autocomplete you just enter one line of code , however what about other languages like c c++ javaa python. Is th a simple way to get autocomplete for vim without a plug in?

Completion needs fancier code for some languages than for others, and
the C filetype-plugin does much more than just defining how to do
completion. If you can find a "simple" one-line autocomplete for C C++
etc. in Vim which suits your needs, you're welcome to write it and use
it, for instance by means of an after-plugin
~/.vim/after/ftplugin/c.vim (on Windows replace /.vim/ by /vimfiles/)
setting the appropriate option to just that line, thus avoiding the
need for a completion plugin.

Bram uses C a lot: Vim itself is written in C. He is also the author
of the C ftplugin and of its (autoload) completion script. I suppose
that if it were possible to get a reasonably fancy C completion
function (suiting Bram's needs as an author of C code) by means of a
single line, it would already long be done, rather than invoking
$VIMRUNTIME/autoload/ccomplete.vim and the 236-line
ccomplete#Complete() function which it defines.

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages