Insert mode completion from buffers with the same filetype.
Vim script
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This is a mirror of

When editing multiple projects (e.g. Python and Java) concurrently, or even
when different types of files (like C source code, its Makefile, and the
corresponding HTML documentation) are open in Vim, the general insert-mode
completion i_CTRL-N becomes less useful. It searches for keywords in open
windows, listed buffers, and other sources as defined by the 'complete'
setting; there's no way to restrict the sources to consider only buffers that
have the same filetype as the current buffer, so a lot of unrelated cruft
clutters the list of completion matches.

This plugin offers an alternative completion that works like the general one,
but lists completion candidates only from buffers that have the same
'filetype' as the current buffer. When you're editing a Python file, you'll
only get matches from other open Python files. Switch to the Makefile and all
those inapplicable Python keywords won't be offered there.

This completion type was motivated by this Stack Overflow question:

- Check out the CompleteHelper.vim plugin page (vimscript #3914) for a full
  list of insert mode completions powered by it.

In insert mode, invoke the completion via CTRL-X =
You can then search forward and backward via CTRL-N / CTRL-P, as usual.

CTRL-X =                Find matches for words that start with the
                        keyword in front of the cursor, looking only into
                        buffers with the same 'filetype'.
                        Further use of CTRL-X = will copy the words following
                        the previous expansion.