ttagcomplete : Context-sensitive tags-based completion and code skeletons
| script karma
Downloaded by 843
Comments, bugs, improvements
script versions (upload new version)
|In theory, this plugin provides a framework for context-sensitive
tags-based completion and code skeletons (requires tSkeleton vimscript
#1160). I.e. the completion function checks the context and filters the
available tags accordingly. You should thus get only those tags included
in the list that are actually useful in a given context (eg because the
are valid methods of a certain class).
In practice, the context sensitivity is currently only implemented for
Java and requires a tags file for the JDK sources to be created (see the
notes on |tlib#tag#Retrieve()| for details). It also makes certain
assumption about how variable declarations look like, e.g. the
class/type name should be in the same line as the variable name; class
names start with an upper-case letter etc.
Limitation: you have to type g:ttagecho_min_chars = 1 chars before
completion is allowed.
It shouldn't be too difficult to adapt this for other statically typed
languages with formal variable declarations. As the source code isn't
actually parsed or anything, there is little chance to use this
efficiently with dynamically typed languages like ruby where the
type/class is only known at run-time.
|Edit the vba file and type: >
See :help vimball for details. If you have difficulties or use vim 7.0,
please make sure, you have the current version of vimball (vimscript
This script requires tlib (vimscript #1863) to be installed.
For code skeletons, you also need tSkeletons (vimscript #1160).
Suggested setup for java (best set in ~/vimfiles/after/ftplugin/java.vim): >
" See notes on |tlib#tag#Retrieve()|.
let b:tlib_tags_extra = $JAVA_HOME .'/tags0'
" Call |ttagcomplete#On()| and set 'omnifunc'.
" For code skeletons, use this:
if exists('g:loaded_tskeleton') && g:loaded_tskeleton >= 402
noremap <buffer> <c-x><c-g> :call ttagcomplete#CompleteSkeletons('m')<cr>
inoremap <buffer> <c-x><c-g> <c-\><c-o>:call ttagcomplete#CompleteSkeletons('m')<cr>
Also available via git
Click on the package to download.
ip used for rating: 188.8.131.52