context_complete.vim : Context sensitive word completion
| script karma
Downloaded by 1495
Comments, bugs, improvements
script versions (upload new version)
|The focus of this script is to provide context-sensitive word completion - taking advantage of the popular ctags utility and Vim's built-in perl features.
Suppose you have an instance of an object (o), and you've typed:
While you are still in insert mode, press CTRL-J, and this script will then look up the first member of that object that starts with "set_" and complete it for you, like this:
o.set_range(integer max, integer min)
If this isn't the completion that you want, then press CTRL-J again for the next member that starts with "set_":
and again for the next one:
If you've gone too far then you can go back with CTRL-K. After each completion you are left in insert mode - so you can just continue typing when you've found the one you want.
The object can also be replaced with a struct, class, 'this', or 'super'.
Completions can also be made after the open parentheses to complete the list of parameters:
Or after the function:
Pressing CTRL-S will skip through the function parameters, visually selecting each in turn - useful for filling in the parameters after completing a function.
|Unpack the tar file into ~/.vim. Then from any vim window type :helptags ~/.vim/doc. You can read the installation details at :help context_complete-setup|
Click on the package to download.
ip used for rating: 188.8.131.52
- context completion continues after a function (var.getObject().<c-j>)
- search pattern and keywords are configurable
- added a new mapping to highlight parameter items in turn
- added a tag cache file for mega-fast searching.
- *much* more.
||- completes 'this.<c-q>'
- completes 'super.<c-q>'
- object type guessing is smarter - limits tag choises to members of the current object.
- more bug fixes and documentation.
||- implemented a basic understanding of class inheritance.
- tag searching is now *much* faster - uses binary searching whenever possible.
- function parameter completions are given when asked after "(". e.g.: util.do_suff(<c-q>
- completion suggestions are now sorted.
||- static members are completed: i.e. ClassName::<c-q>
- C structs are now understood and treated like classes
- local variable definition detection is much better... it uses more of vim's built-in features. (yay!)
- more bug fixes. Finding the definition of a local variable is much more solid.