sponsor Vim development Vim logo Vim Book Ad

CamelCaseComplete : Insert mode completion that expands CamelCaseWords and underscore_words.

 script karma  Rating 16/4, Downloaded by 323    Comments, bugs, improvements  Vim wiki

created by
Ingo Karkat
 
script type
utility
 
description
DESCRIPTION
This plugin offers a keyword completion that is limited to identifiers which
adhere to either CamelCase ("anIdentifier") or underscore_notation
("an_identifier") naming conventions. This often results in a single (or very
few) matches and thus allows quick completion of function, class and variable
names.
The list of completion candidates can be restricted by triggering completion
on all or some of the initial letters of each word fragment; e.g. "vlcn" would
expand to "veryLongClassName" and "verbose_latitude_correction_numeric".
Non-alphabetic keyword characters can be thrown in, too, to both widen the
search to word fragments joined by the keywords (e.g. "joined#words") and to
narrow down the number of CamelCase and underscore_word matches.

SEE ALSO
- camelcasemotion (vimscript #1905) provides special motions ,w ,b and ,e
  through CamelCaseWords and underscore_notation and corresponding text
  objects.
- Loosely based on and similar to the "Custom keyword completion" from
  http://vim.wikia.com/wiki/Custom_keyword_completion
- Check out the CompleteHelper.vim plugin page (vimscript #3914) for a full
  list of insert mode completions powered by it.

USAGE
In insert mode, type some or all first letters of the desired CamelCaseWord or
underscore_word, then invoke the completion via CTRL-X CTRL-C.
You can then search forward and backward via CTRL-N / CTRL-P, as usual.

CTRL-X CTRL-C           Find matches for CamelCaseWords and underscore_words
                        whose individual word fragments begin with the typed
                        letters in front of the cursor.
 
install details
INSTALLATION
This script is packaged as a vimball. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vmb.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the :UseVimball command.
    vim CamelCaseComplete*.vmb.gz
    :so %
To uninstall, use the :RmVimball command.

DEPENDENCIES
- Requires Vim 7.1 or higher.
- Requires the CompleteHelper.vim plugin (vimscript #3914).

CONFIGURATION
For a permanent configuration, put the following commands into your vimrc:

Analoguous to the 'complete' option, you can specify which buffers will be
scanned for completion candidates. Currently, '.' (current buffer), 'w'
(buffers from other windows), and 'b' (other listed buffers) are supported.
    let g:CamelCaseComplete_complete = '.,w,b'
The global setting can be overridden for a particular buffer
(b:CamelCaseComplete_complete).

To disable the removal of the (mostly useless) completion base when there
are no matches:
    let g:CamelCaseComplete_FindStartMark = ''

You can disable the fallback to a case-insensitive search when the completion
base only contains lowercase letters. Then, (together with 'noignorecase'),
the case of the first CamelWord fragment and all underscore_word fragments
must always match exactly:
    let g:CamelCaseComplete_CaseInsensitiveFallback = 0

If you want to use a different mapping, map your keys to the
<Plug>(CamelCaseComplete) mapping target _before_ sourcing the script (e.g.
in your vimrc):
    imap <C-x><C-c> <Plug>(CamelCaseComplete)<Plug>(CamelCasePostComplete)
 

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
CamelCaseComplete-1.01.vmb.gz 1.01 2013-12-19 7.0 Ingo Karkat - Factor out CamelCaseComplete#BuildRegexp() for re-use by the new InnerFragmentComplete.vim plugin.
- Add value "b" (other listed buffers) to the plugin's 'complete' option offered by CompleteHelper.vim 1.20.
CamelCaseComplete.vba.gz 1.00 2012-02-01 7.0 Ingo Karkat Initial upload
ip used for rating: 54.161.181.49

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