sponsor Vim development Vim logo Vim Book Ad

AutoComplPop : Automatically opens popup menu for completions

 script karma  Rating 4547/1306, Downloaded by 79873  Comments, bugs, improvements  Vim wiki

created by
Takeshi NISHIDA
 
script type
utility
 
description
Repository:
  https://bitbucket.org/ns9tks/vim-autocomplpop/

Issues:
  http://bitbucket.org/ns9tks/vim-autocomplpop/issues/

Download latest(development) version
  https://bitbucket.org/ns9tks/vim-autocomplpop/get/tip.zip

==============================================================================
INTRODUCTION                                                *acp-introduction*

With this plugin, your vim comes to automatically opens popup menu for
completions when you enter characters or move the cursor in Insert mode. It
won't prevent you continuing entering characters.


==============================================================================
INSTALLATION                                                *acp-installation*

Put all files into your runtime directory. If you have the zip file, extract
it to your runtime directory.

You should place the files as follows:
>
        <your runtime directory>/plugin/acp.vim
        <your runtime directory>/doc/acp.txt
        ...
<
If you disgust to jumble up this plugin and other plugins in your runtime
directory, put the files into new directory and just add the directory path to
'runtimepath'. It's easy to uninstall the plugin.

And then update your help tags files to enable fuzzyfinder help. See
|add-local-help| for details.


==============================================================================
USAGE                                                              *acp-usage*

Once this plugin is installed, auto-popup is enabled at startup by default.

Which completion method is used depends on the text before the cursor. The
default behavior is as follows:

        kind      filetype    text before the cursor ~
        Keyword   *           two keyword characters
        Filename  *           a filename character + a path separator
                              + 0 or more filename character
        Omni      ruby        ".", "::" or non-word character + ":"
                              (|+ruby| required.)
        Omni      python      "." (|+python| required.)
        Omni      xml         "<", "</" or ("<" + non-">" characters + " ")
        Omni      html/xhtml  "<", "</" or ("<" + non-">" characters + " ")
        Omni      css         (":", ";", "{", "^", "@", or "!")
                              + 0 or 1 space

Also, you can make user-defined completion and snipMate's trigger completion
(|acp-snipMate|) auto-popup if the options are set.

These behavior are customizable.

                                                                *acp-snipMate*
snipMate's Trigger Completion ~

snipMate's trigger completion enables you to complete a snippet trigger
provided by snipMate plugin
(http://www.vim.org/scripts/script.php?script_id=2540) and expand it.


To enable auto-popup for this completion, add following function to
plugin/snipMate.vim:
>
  fun! GetSnipsInCurrentScope()
    let snips = {}
    for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
      call extend(snips, get(s:snippets, scope, {}), 'keep')
      call extend(snips, get(s:multi_snips, scope, {}), 'keep')
    endfor
    return snips
  endf
<
And set |g:acp_behaviorSnipmateLength| option to 1.

There is the restriction on this auto-popup, that the word before cursor must
consist only of uppercase characters.

                                                               *acp-perl-omni*
Perl Omni-Completion ~

AutoComplPop supports perl-completion.vim
(http://www.vim.org/scripts/script.php?script_id=2852).

To enable auto-popup for this completion, set |g:acp_behaviorPerlOmniLength|
option to 0 or more.


==============================================================================
 
install details
 

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
vim-autocomplpop.zip 2.14.1 2009-12-12 7.0 Takeshi NISHIDA - Changed the way of auto-popup for avoiding an issue about filename completion.
- Fixed a bug that popup menu was opened twice when auto-popup was done.
vim-autocomplpop.zip 2.14 2009-11-15 7.0 Takeshi NISHIDA - Added the support for perl-completion.vim.
vim-autocomplpop.zip 2.13 2009-11-14 7.0 Takeshi NISHIDA - Changed to sort snipMate's triggers.
- Fixed a bug that a wasted character was inserted after snipMate's trigger
  completion.
vim-autocomplpop.zip 2.12.1 2009-11-12 7.0 Takeshi NISHIDA - Changed to avoid a strange behavior with Microsoft IME.
vim-autocomplpop.zip 2.12 2009-11-11 7.0 Takeshi NISHIDA - Added g:acp_behaviorKeywordIgnores option.
- Added g:acp_behaviorUserDefinedMeets option and removed
  g:acp_behaviorUserDefinedPattern.
- Changed to do auto-popup only when a buffer is modified.
- Changed the structure of g:acp_behavior option.
- Changed to reflect a change of behavior options (named g:acp_behavior*)
  any time it is done.
- Fixed a bug that completions after omni completions or snipMate's trigger
  completion were never attempted when no candidate for the former
  completions was found.
vim-autocomplpop.zip 2.11.1 2009-10-27 7.0 Takeshi NISHIDA - Fixed a bug that a snipMate's trigger could not be expanded when it was
  completed.
vim-autocomplpop.zip 2.11 2009-10-23 7.0 Takeshi NISHIDA - Implemented experimental feature which is snipMate's trigger completion.
vim-autocomplpop.zip 2.10 2009-10-22 7.0 Takeshi NISHIDA - Improved the response by changing not to attempt any completion when
  keyword characters are entered after a word which has been found that it
  has no completion candidate at the last attempt of completions.
- Improved the response by changing to close popup menu when <BS> was
  pressed and the text before the cursor would not match with the pattern of
  current behavior.
vim-autocomplpop.zip 2.9 2009-10-17 7.0 Takeshi NISHIDA - Changed default behavior to support XML omni completion.
- Changed default value of g:acp_behaviorKeywordCommand option.
  The option with "\<C-p>" cause a problem which inserts a match without
  <CR> when 'dictionary' has been set and keyword completion is done.
- Changed to show error message when incompatible with a installed vim.
vim-autocomplpop.zip 2.8.1 2009-09-15 7.0 Takeshi NISHIDA - Fixed a bug which inserted a selected match to the next line when
  auto-wrapping (enabled with 'formatoptions') was performed.
vim-autocomplpop.zip 2.8 2009-09-14 7.0 Takeshi NISHIDA - Added g:acp_behaviorUserDefinedFunction option and
  g:acp_behaviorUserDefinedPattern option for users who want to make custom
  completion auto-popup.
- Fixed a bug that setting 'spell' on a new buffer made typing go crazy.
vim-autocomplpop.zip 2.7 2009-09-13 7.0 Takeshi NISHIDA - Changed naming conventions for filenames, functions, commands, and options
  and thus renamed them.
- Added g:acp_behaviorKeywordCommand option. If you prefer the previous
  behavior for keyword completion, set this option "\<C-n>".
- Changed default value of g:acp_ignorecaseOption option.
                                                                              
The following were done by Ingo Karkat:
                                                                              
- ENH: Added support for setting a user-provided 'completefunc' during the
  completion, configurable via g:acp_behavior.
- BUG: When the configured completion is <C-p> or <C-x><C-p>, the command to
  restore the original text (in on_popup_post()) must be reverted, too.
- BUG: When using a custom completion function (<C-x><C-u>) that also uses
  an s:...() function name, the s:GetSidPrefix() function dynamically
  determines the wrong SID. Now calling s:DetermineSidPrefix() once during
  sourcing and caching the value in s:SID.
- BUG: Should not use custom defined <C-X><C-...> completion mappings. Now
  consistently using unmapped completion commands everywhere. (Beforehand,
  s:PopupFeeder.feed() used mappings via feedkeys(..., 'm'), but
  s:PopupFeeder.on_popup_post() did not due to its invocation via
  :map-expr.)
autocomplpop.vim 2.6 2008-10-12 7.0 Takeshi NISHIDA - Improved the behavior of omni completion for HTML/XHTML.
autocomplpop.vim 2.5 2008-06-17 7.0 Takeshi NISHIDA - Added some options to customize behavior easily:
    g:AutoComplPop_BehaviorKeywordLength
    g:AutoComplPop_BehaviorFileLength
    g:AutoComplPop_BehaviorRubyOmniMethodLength
    g:AutoComplPop_BehaviorRubyOmniSymbolLength
    g:AutoComplPop_BehaviorPythonOmniLength
    g:AutoComplPop_BehaviorHtmlOmniLength
    g:AutoComplPop_BehaviorCssOmniPropertyLength
    g:AutoComplPop_BehaviorCssOmniValueLength
autocomplpop.vim 2.4 2008-05-07 7.0 Takeshi NISHIDA - Added g:AutoComplPop_MappingDriven option.
autocomplpop.vim 2.3.1 2008-03-31 7.0 Takeshi NISHIDA - Changed to set 'lazyredraw' while a popup menu is visible to avoid
  flickering.
- Changed a behavior for CSS.
- Added support for GetLatestVimScripts.
autocomplpop.vim 2.3 2008-03-29 7.0 Takeshi NISHIDA - Added a behavior for Python to support omni completion.
- Added a behavior for CSS to support omni completion.
autocomplpop.vim 2.2 2008-03-21 7.0 Takeshi NISHIDA - Changed not to work when 'paste' option is set.
- Fixed AutoComplPopEnable command and AutoComplPopDisable command to
  map/unmap "i" and "R".
autocomplpop.vim 2.1 2008-03-20 7.0 Takeshi NISHIDA - Fixed the problem caused by "." command in Normal mode.
- Changed to map "i" and "R" to feed completion command after starting
  Insert mode.
- Avoided the problem caused by Windows IME.
autocomplpop.vim 2.0 2008-03-18 7.0 Takeshi NISHIDA - Changed to use CursorMovedI event to feed a completion command instead
  of key mapping. Now the auto-popup is triggered by moving the cursor.
- Changed to feed completion command after starting Insert mode.
- Removed g:AutoComplPop_MapList option.
autocomplpop.vim 1.7 2008-03-03 7.0 Takeshi NISHIDA - Added behaviors for HTML/XHTML. Now supports the omni completion for
  HTML/XHTML.
- Changed not to show expressions for CTRL-R =.
- Changed not to set 'nolazyredraw' while a popup menu is visible.
autocomplpop.vim 1.6.1 2008-02-12 7.0 Takeshi NISHIDA - Changed not to trigger the filename competion by a text which has
  multi-byte characters.
autocomplpop.vim 1.6 2008-02-01 7.0 Takeshi NISHIDA - Redesigned g:AutoComplPop_Behavior option.
- Changed default value of g:AutoComplPop_CompleteOption option.
- Changed default value of g:AutoComplPop_MapList option.
autocomplpop.vim 1.5 2007-12-26 7.0 Takeshi NISHIDA - Implemented continuous-completion for the filename completion. And
  added new option to g:AutoComplPop_Behavior.
autocomplpop.vim 1.4 2007-12-09 7.0 Takeshi NISHIDA - Fixed the bug that the auto-popup was not suspended in fuzzyfinder.
- Fixed the bug that an error has occurred with Ruby-omni-completion
  unless Ruby interface.
autocomplpop.vim 1.3 2007-11-17 7.0 Takeshi NISHIDA - Supported Ruby-omni-completion by default.
- Supported filename completion by default.
- Added g:AutoComplPop_Behavior option.
- Added g:AutoComplPop_CompleteoptPreview option.
- Removed g:AutoComplPop_MinLength option.
- Removed g:AutoComplPop_MaxLength option.
- Removed g:AutoComplPop_PopupCmd option.
autocomplpop.vim 1.2 2007-11-11 7.0 Takeshi NISHIDA - Fixed bugs related to 'completeopt'.
autocomplpop.vim 1.1 2007-11-09 7.0 Takeshi NISHIDA - Added g:AutoComplPop_IgnoreCaseOption option.
- Added g:AutoComplPop_NotEnableAtStartup option.
- Removed g:AutoComplPop_LoadAndEnable option.
autocomplpop.vim 1.0 2007-08-08 7.0 Takeshi NISHIDA g:AutoComplPop_LoadAndEnable option for a startup activation is added.
AutoComplPopLock command and AutoComplPopUnlock command are added to suspend and resume.
'completeopt' and 'complete' options are changed temporarily while completing by this script.
autocomplpop.vim 0.4 2007-05-13 7.0 Takeshi NISHIDA The first match are selected when the popup menu is Opened. You can insert the first match with CTRL-Y.
autocomplpop.vim 0.3 2007-05-09 7.0 Takeshi NISHIDA Fixed the problem that the original text is not restored if 'longest' is not set in 'completeopt'. Now the plugin works whether or not 'longest' is set in 'completeopt', and also 'menuone'.
autocomplpop.vim 0.2 2007-05-09 7.0 Takeshi NISHIDA When completion matches are not found, insert CTRL-E to stop completion.
Clear the echo area.
Fixed the problem in case of dividing words by symbols, popup menu is not opened.
autocomplpop.vim 0.1 2007-05-02 7.0 Takeshi NISHIDA Initial upload
ip used for rating: 142.132.191.50

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.
   
Vim at Github