Chained completion that works the way you want!
Find a file
lifepillar 5000155b63 Update Readme.md
Signed-off-by: lifepillar <lifepillar@noreply.codeberg.org>
2026-03-11 18:18:32 +01:00
autoload Use vimcomplete#Complete omnifucn in Vim filetypes if available. 2025-10-15 20:54:48 +02:00
doc Do not map Tab and S-Tab for Neovim. 2025-03-30 09:47:32 +02:00
plugin Do not map Tab and S-Tab for Neovim. 2025-03-30 09:47:32 +02:00
test Fix scoped completion tests. 2025-09-28 13:40:30 +02:00
LICENSE Update copyright notice. 2021-09-01 08:57:51 +02:00
Readme.md Update Readme.md 2026-03-11 18:18:32 +01:00
troubleshooting_vimrc.vim Set packpath to Vim runtime in troubleshooting vimrc 2025-04-05 15:08:07 +02:00

We're coming down to the ground

There's no better place to go

(Peter Gabriel)

What is it?

MUcomplete is a minimalist autocompletion plugin for Vim.

MUcomplete is an implementation of chained (fallback) completion, whereby several completion methods are attempted one after another until a result is returned.

Under the hood, MUcomplete does nothing more than typing some completion mappings for you, either when you press <tab>/<s-tab> or automatically while you are typing. You choose which completion methods to use and in which order, and MUcomplete does the rest. It does no caching, no asynchronous computation, no intelligent guessing. It just makes use of core Vim features.

MUcomplete brings Vim completion down to earth again.

Getting Started

MUcomplete requires Vim 7.2 compiled with +insert_expand and +menu. Automatic completion is available in Vim 7.4.143 or later, although Vim 8.0.0283 is recommended. MUcomplete is developed and tested on Vim 9.

Installation does not require anything special.

Mandatory Vim settings:

  set completeopt+=menuone

Optional Vim settings:

Starting with Vim 9.1.1178, Vim supports fuzzy completion by adding fuzzy to completeopt, so if you want fuzzy matching, set:

  set completeopt+=fuzzy

Other recommended settings:

  set shortmess+=c   " Shut off completion messages
  set belloff+=ctrlg " Add only if Vim beeps during completion

No other configuration is needed. Just start pressing <tab> or <s-tab> to complete a word. For autocompletion, see the next section.

Vim 9.1 has improved its support for both manual and automatic completion. To make the most out of MUcomplete, make sure to get familiar with Vim's built-in features, in particular:

:help ins-completion
:help 'completeopt'
:help 'complete'
:help 'autocomplete'

Autocompletion

NOTE: Vim 9.1.1590 has added an 'autocomplete' option. If you set autocomplete on, you need not—and must not—enable MUcomplete autocompletion, and you may ignore this section.

To get completion suggestions automatically as you type (with Vim 7.4.775 or later), you must add either noselect or noinsert to completeopt:

  set completeopt+=noselect

or

  set completeopt+=noinsert

Automatic completion can be activated at any time with :MUcompleteOn and disabled with :MUcompleteOff, or toggled with :MUcompleteToggle. To make automatic completion available at startup, add the following to your vimrc:

g:mucomplete#enable_auto_at_startup = 1

If autocompletion looks a little overzealous to you, you may set:

let g:mucomplete#completion_delay = 1

Then, MUcomplete will kick in only when you pause typing. The delay can be adjusted, of course: see :help mucomplete-customization.

Completion Chains

By default, MUcomplete attempts:

  1. path completion, if the text in front of the cursor looks like a path;
  2. omni-completion, if enabled in the current buffer;
  3. buffer keyword completion;
  4. dictionary completion, if a dictionary is set for the current buffer;
  5. spelling completion, if 'spell' is on and 'spelllang' is set;

in this order. This is called a completion chain and it is the core concept of MUcomplete operation. At the first successful attempt, the pop-up menu shows the results. When the pop-up menu is visible, you may cycle back and forth through the completion chain and try different completion methods by pressing <c-h> and <c-j>, respectively. In other words, <c-h> and <c-j> mean: “cancel the current menu and try completing the text I originally typed in a different way”. See below for an example.

Different completion chains can be defined for each filetype or at the buffer level. They can also be scoped by syntax groups. MUcomplete is fully customizable. See :help mucomplete.txt for detailed documentation.

Note: MUcomplete maps <tab> and <s-tab> to act as manual completion triggers by default. It also changes how <c-j> and <c-h> work when the pop-up menu is visible (and only in that situation). You may override MUcomplete's defaults, of course, or prevent MUcomplete to define any mappings at all. Read the documentation for options and for hints about making MUcomplete work with plugins having conflicting mappings.

Semantic Completion and Language Server Protocol (LSP) Support

MUcomplete offers no explicit support for “intellisense”/semantic completion or for LSP. For that, you need to install suitable plugins. However, as long as those other plugins expose their functionality through omnifunc or complete's F option (in Vim 9.1.1409 or later), MUcomplete should work just fine with them.

Compatibility

See :help mucomplete-compatibility.

Troubleshooting

See :help mucomplete-troubleshooting.