sponsor Vim development Vim logo Vim Book Ad

echofunc.vim : Echo the function declaration in the command line for C/C++.

 script karma  Rating 275/111, Downloaded by 24282  Comments, bugs, improvements  Vim wiki

created by
Ming Bai
 
script type
utility
 
description
Get the latest version from github:
https://github.com/mbbill/echofunc
                  
File:         echofunc.vim                                            
Brief:        Echo the function declaration in                        
               the command line for C/C++, as well                    
               as other languages that ctags                          
               supports.                                              
Authors:      Ming Bai <mbbill AT gmail DOT com>,                    
               Wu Yongwei <wuyongwei AT gmail DOT com>                                                          
                                                                      
Install:      1. Put echofunc.vim to /plugin directory.              
               2. Use the command below to create tags                
                  file including the language and                      
                  signature fields.                                    
                    ctags -R --fields=+lS .                            
                                                                      
Usage:        When you type '(' after a function name                
               in insert mode, the function declaration                
               will be displayed in the command line                  
               automatically. Then you may use Alt+- and              
               Alt+= (configurable via EchoFuncKeyPrev                
               and EchoFuncKeyNext) to cycle between                  
               function declarations (if exists).                      
                                                                      
               Another feature is to provide a balloon tip            
               when the mouse cursor hovers a function name,          
               macro name, etc. This works with when                  
               +balloon_eval is compiled in.                          
                                                                      
               Because the message line often cleared by              
               some other plugins (e.g. ominicomplete), an            
               other choice is to show message in status line.        
               First, add  %{EchoFuncGetStatusLine()}  to              
               your 'statusline' option.                              
               Second, add the following line to your vimrc            
               let g:EchoFuncShowOnStatus = 1                          
               to avoid echoing function name in message line.        
                                                                      
Options:      g:EchoFuncLangsDict                                    
                 Dictionary to map the Vim file types to              
                 tags languages that should be used. You do            
                 not need to touch it in most cases.                  
                                                                      
               g:EchoFuncLangsUsed                                    
                 File types to enable echofunc, in case you            
                 do not want to use EchoFunc on all file              
                 types supported. Example:                            
                   let g:EchoFuncLangsUsed = ["java","cpp"]            
                                                                      
               g:EchoFuncMaxBalloonDeclarations                        
                 Maximum lines to display in balloon declarations.    
                                                                      
               g:EchoFuncKeyNext                                      
                 Key to echo the next function.                        
                                                                      
               g:EchoFuncKeyPrev                                      
                 Key to echo the previous function.                    
                                                                      
               g:EchoFuncShowOnStatus                                  
                 Show function name on status line. NOTE,              
                 you should manually add %{EchoFuncGetStatusLine()}    
                 to your 'statusline' option.                          
                                                                      
               g:EchoFuncAutoStartBalloonDeclaration                  
                 Automatically start balloon declaration if not 0.    
                                                                      
               g:EchoFuncPathMappingEnabled                            
               g:EchoFuncPathMapping                                  
                 The new feature added by Zhao Cai provides ability    
                 to shorten file path in some specific directory. e.g.
                 /home/username/veryveryvery/long/file/path/blabla    
                 could be showed as                                    
                 ~/veryveryvery/long/file/path/blabla                  
                 If you want to disable this feature, add              
                 let g:EchoFuncPathMappingEnabled = 0                  
                 to your vimrc. It's enabled by default.              
                 To add more mappings in g:EchoFuncPathMapping, search
                 this script and you will know how to do it.          
                                                                      
                                                                      
Thanks:       edyfox                                                  
               minux                                                  
               Zhao Cai                                                



Screenshots:
https://sites.google.com/site/mbbill/echofunc_demo1.png
https://sites.google.com/site/mbbill/echofunc_demo2.png
http://sites.google.com/site/mbbill/echofunc.PNG
 
install details
1. Put echofunc.vim to /plugin directory.
2. Use the command below to create tags
   file including the language and
   signature fields.
     ctags -R --fields=+lS .
 

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
echofunc.vim 2.0 2012-02-04 7.0 Ming Bai Set and restore cpoptions to make sure line continuation works
echofunc.vim 1.23 2011-06-22 7.0 Ming Bai Accumulated changes:
- Improve support for C++;
- Add new option to show function name on status line;
- Add new option to enable/disable autostart of balloon declaration.
echofunc.vim 1.19 2009-05-01 7.0 Ming Bai Fix compatibility issues with Ctrl-v I and some other plugins.
echofunc.vim 1.18 2007-12-26 7.0 Ming Bai Work around a problem that matchparen is not in effect.
echofunc.vim 1.17 2007-11-26 7.0 Ming Bai Fix a key mapping conflict with omni-completion (thanks to Edward L. Fox and Ben Schmidt).
echofunc.vim 1.16 2007-11-07 7.0 Ming Bai - Make the keys for Next-Function and Previous-Function configurable.
- Make small enhancements.
echofunc.vim 1.14 2007-11-02 7.0 Ming Bai Use the tags language field, when it is available, to avoid irrelevant matches.
echofunc.vim 1.12 2007-11-01 7.0 Ming Bai Add some language-specific support;
Improve the support for languages whose tags do not include a `signature'.
echofunc.vim 1.11 2007-10-28 7.0 Ming Bai - Display more information about variables, macros, classes, structs, etc.;
- Ensure no leading spaces are ever displayed;
- Compress contiguous space characters to a single SPACE;
- Add new control variable for the maximum number of balloon declarations.
echofunc.vim 1.10 2007-10-21 7.0 Ming Bai Fix a typo that can prevent member functions from being correctly echoed.
echofunc.vim 1.9 2007-10-16 7.0 Ming Bai Make both the function echo and the balloon tip support C++ destructors and operator redefinitions.
echofunc.vim 1.8 2007-10-06 7.0 Ming Bai - Bug fix: not all functions are shown.
- Bug fix: some operations take very long.
- Improvement: ")" will finish the function echoing.
- Improvement: new global variable EchoFuncTagsLanguages to control in which file types echofunc will be automatically enabled.
- Improvement: Automatic enabling works also on new files.
echofunc.vim 1.6 2007-08-08 7.0 Ming Bai Check file type when starting echo function name or pop a balloon.
echofunc.vim 1.4 2007-07-31 7.0 Ming Bai Bug fix
echofunc.vim 1.3 2007-07-23 7.0 Ming Bai Bug fix.
echofunc.vim 1.2 2007-06-09 7.0 Ming Bai It now support popping out a balloon to show the declaration of the functions and class members under GVim
echofunc.vim 1.1 2006-12-21 7.0 Ming Bai Initial upload
ip used for rating: 142.132.191.50

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