sponsor Vim development Vim logo Vim Book Ad

AmbiCompletion : Ambiguous completion

 script karma  Rating 4/1, Downloaded by 887    Comments, bugs, improvements  Vim wiki

created by
Shuhei Kubota
script type
  This script provides an ambiguous completion functionality.

  A long function name, tired to type, a vague memory of spelling, ...
  Ambiguous completion supports you with similar words in your buffer.

  Your type does not need to match the beginning of answer word.
  "egining" -> "beginning"
  For those who are forgetful.

  This is a fork of the first version of Word Fuzzy Completion.
  adding middle-word-match, architectural changes(mainly no need +python), global candidates.


  1. Set completefunc to g:AmbiCompletion.

      :set completefunc=g:AmbiCompletion

      :inoremap <C-U>  <C-X><C-U>

  2. (optional) If you have globally useful dictionary, then

      :AmbiCompletionAddGlobal  my/favorite/dictfile
      :AmbiCompletionAddGlobal  my/favorite/another
      "this makes completion actions slow down


(A right hand side value is a default value.)

g:AmbiCompletion_cacheCheckpoint = 10

    cache-updating interval.
    The cache is updated when undo sequence progresses by this value.

g:AmbiCompletion_cacheShorteningFactors = {'0': 0.1, '100': 0.25, '500': 0.5, '1000': 0.75, '5000': 1}

    cache-updating factors. {'line-order': cache-updating factor, ...}
    In small size file, caches are updated frequently. In large size file,
    caches are updated less frequently.

g:AmbiCompletion_cacheScanRange = 0

    scan range by percent.
    If this value is in (0, 100], then this script APPENDS -x% lines to +x% lines
    by current position to cache, where x is g:AmbiCompletion_cacheScanRange.

    This option is prior to AmbiCompletion_cacheCheckpoint and

g:AmbiCompletion_cacheRetention = 0

    retain old cache while updating cache. 0 or 1
    If 1, all old words in cache are retained and are merged with new words.
    If 0, all old words are replaced with new words.


      updates the cache in a current buffer immediately.
  AmbiCompletionAddGlobal {filename}...

      adds words in {filename} into word candidates.
      Multiple {filename} are allowed.
install details
Put this plugin in your plugin directory(e.g. $VIMRUNTIME/plugin).
Then source it or restart VIM.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ambicompletion.vim 0.7 2016-07-31 7.0 Shuhei Kubota Added partial scan feature (g:AmbiCompletion_cacheScanRange) and cache retention feature (g:AmbiCompletion_cacheRetention).
ambicompletion.vim 0.6 2015-11-24 7.0 Shuhei Kubota Each-buffer cache of candidates & Global word completion.
ambicompletion.vim 0.5 2015-11-21 7.0 Shuhei Kubota More timely cache refreshing.
ambicompletion.vim 0.4 2015-02-13 7.0 Shuhei Kubota x10 faster!
more multibyte-completion accuracy
ambicompletion.vim 0.3 2015-02-05 7.0 Shuhei Kubota implemented a simple caching mechanism.
ambicompletion.vim 0.2b 2012-09-03 7.0 Shuhei Kubota fixed encoding handling in +python
ambicompletion.vim 0.2a 2012-08-05 7.0 Shuhei Kubota added encoding handling in +python.
added among-buffers collection by letting g:AmbiCompletion_allBuffers = 1.
ambicompletion.vim 0.1a 2012-05-05 7.3 Shuhei Kubota Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo