CamelCaseComplete : Insert mode completion that expands CamelCaseWords and underscore_words.
| script karma
Downloaded by 346
Comments, bugs, improvements
script versions (upload new version)
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
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.
- camelcasemotion (vimscript #1905) provides special motions ,w ,b and ,e
through CamelCaseWords and underscore_notation and corresponding text
- Loosely based on and similar to the "Custom keyword completion" from
- Check out the CompleteHelper.vim plugin page (vimscript #3914) for a full
list of insert mode completions powered by it.
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.
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.
To uninstall, use the :RmVimball command.
- Requires Vim 7.1 or higher.
- Requires the CompleteHelper.vim plugin (vimscript #3914).
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
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)
Click on the package to download.
ip used for rating: 220.127.116.11