sponsor Vim development Vim logo Vim Book Ad

Gtags And Man Proto (GAMP) : Full function completion using Linux manual and GTags (not mandatory).

 script karma  Rating 68/24, Downloaded by 372    Comments, bugs, improvements  Vim wiki

created by
S S
 
script type
utility
 
description
GAMP is a very lightweight system completion for libc functions and virtually any other functions.

REQUIREMENTS
  Mandatory:
    * Linux-like OS with a shell and a manpage system
    * Vim 'laststatus' must be set to 2
  Optional:
    * GNU Global (its use can be disabled)

FEATURES
  * Perfect for C, C++ and theorically support other C syntax-like languages (PHP, Java)
  * 3 modes:
    * Complete function prototype in completion mode
    * Hint for function prototype in statusline mode
    * Do all of the above when using both modes
  * Take definition from all the function manpages from section 2 and 3
    ( system and library (including libc) calls )
  * Take definition of any function using GNU Global GTags system
  * If not using Global GTags, there is no dependency
  * Real-time updating and no maintenance required if using  gtags.vim  
    auto-update feature

USAGE EXAMPLE
In completion mode:
        printf ||                       /* "||" is the cursor */
    After pressing <Leader>gmc  becomes:
        print|f| ( {+const_char_pt_format+}, {+VA_Args+} )
    Use <C-j> to jump to next argument:
        printf ( ||, {+VA_Args+} )
        printf ( "GAMP mark: %d/10"||, {+VA_Args+} )
    And again:
        printf ( "GAMP mark: %d/10", || )
        printf ( "GAMP mark: %d/10", 10|| )

In statusline mode:
        printf (const char *format, ...)
     Is displayed on statusline.

NOTES
  * Functions taking function pointers as arguments are not yet fully supported
 
install details
Inside the GAMP.tar archive are two files that you have to put in the appropriate location of your vim folder (for me, it's  $HOME/.vim ).
You can do it using your graphical archive manager (like  file-roller ), or with the command-line with:
    $ tar -xvf  GAMP.tar
to extract the archive, and:
    $ cp  doc/gtags-and-man-proto.txt          $HOME/.vim/doc
    $ cp  plugin/gtags-and-man-proto.vim   $HOME/.vim/plugin
to copy the files.
 

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
GAMP.tar 0.5.9 2014-06-27 7.0 S S Bugfix: a mere typo, sorry for that.
GAMP.tar 0.5.9 2014-06-27 7.0 S S Bugfix: improved manual pages lookup for multi-line definition ( fwrite, etc... ) and function pointers ( __free_hook, etc... ).
If found, comments are now removed from prototypes when completing.
GAMP.tar 0.5.5 2014-06-23 7.0 S S Bugfix: g:GAMP_UnloadLoadedBuffer == 1 used to be problematic when function definition was located in the same file as the currently active file.
GAMP.tar 0.5.1 2014-06-22 7.0 S S Bugfix: improved grep matching of manual pages for ambiguous cases ( puts/fputs, etc... )
GAMP.tar 0.5.1 2014-05-22 7.0 S S * <Leader>gm mapping now available in all modes.
* New mapping   gmh   (Gtags and Man Hint) which shows hint of prototype function even when not in statusline mode.
GAMP.tar 0.5 2014-05-22 7.0 S S Initial upload
ip used for rating: 54.156.58.187

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.
   
SourceForge.net Logo