sponsor Vim development Vim logo Vim Book Ad

current-func-info.vim : Get current function name

 script karma  Rating 6/9, Downloaded by 2849  Comments, bugs, improvements  Vim wiki

created by
tyru
 
script type
utility
 
description
Supported languages: C, Perl, Ruby, Python, PHP, Vim script
Repository: http://github.com/tyru/current-func-info.vim


current-func-info shows current function's name to statusline, tabline,
anywhere.
|cfi#get_func_name()| to get function's name.


cfi#load() *cfi#load()*
Load "autoload/cfi.vim" and "plugin/cfi.vim".

cfi#get_func_name([{filetype}]) *cfi#get_func_name()*
Returns function's name.
If {filetype} is omitted, current 'filetype' is used instead.
Include this expression to |'statusline'| or |'tabline'| and so on.

cfi#format({fmt}, {default}) *cfi#format()*
Returns formatted string. >
    let &statusline = '%{cfi#format("[%s()]", "no function")}'
< This returns "no function" if cfi#get_func_name() returns empty string.
Or returns "[func()]" if cfi#get_func_name() returns "func".

cfi#create_finder({filetype}) *cfi#create_finder()*
Returns Dictionary of instance for finder.

To create finder, implement |s:finder.find()| or
implement |s:finder.get_func_name()|, |s:finder.find_begin()|,
|s:finder.find_end()|.

(TODO: Write more descriptions)

See ftplugin/*.vim for the details.

cfi#supported_filetype({filetype}) *cfi#supported_filetype()*
Return boolean value if {filetype} is supported.
 
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
cfi.zip 0.0.5 2010-12-25 7.0 tyru - Fix the flickering of c ftplugin
- Add variables g:cfi_disable, g:loaded_cfi_ftplugin_{lang}.
cfi.zip 0.0.4 2010-09-06 7.0 tyru Include PHP support. Thanks Chris Ruzin.
cfi.zip 0.0.3 2010-09-02 7.0 tyru Fix bug: Ruby ftplugin did not work.
cfi.zip 0.0.2 2010-08-21 7.0 tyru - Implement cfi#format()
- Implement Python support
cfi.zip 0.0.1 2010-08-13 7.0 tyru - Fixed bug of ftplugin/vim/cfi.vim: couldn't get the name of last function in a file.
cfi.zip 0.0.0 2010-08-13 7.0 tyru Initial upload
ip used for rating: 3.138.141.202

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