funprototypes.vim


Ⅰ. 插件描述

automatic insert function prototypes in your code

Ⅱ. 基本信息

创建日期:  2011-02-20
使用用户:  4
Github星:  1
插件作者:  Hong Wu

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/funprototypes-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/funprototypes-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/funprototypes-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/funprototypes.vim

Ⅳ. 文档说明

Introdution:
   This script is only for C language. You just press the key which you mapped
   can automatic insert/replace the all funtions' prototypes in your source code.
Preview:

    #include<stdio.h>

   // The  four lines below are automatic added by funprototypes.vim!
    /"    
                   funtion prototypes                 *"            
    */"        
    void fun_1();                                              
    
    void
    fun_1(){
        printf("Hello, VIM!n");
    }
    
    int main()
    {
       fun_1();
       return 0;
    }

Configure:
   1. let g:fun_prototypes_static_first = 0

      if g:fun_prototypes_static_first is 0, then the static functions will
      insert before the global funtions. <default is 0>

   2. let g:fun_prototypes_skip_fun_list=["main"]

      This list contains the functions which you don't want funprototypes.vim to add.
      eg:
         int main(){}  //skip
         int _main(){} //doesn't skip
      
   3. let g:fun_prototypes_static_fun_start_list=["static"]

      This list contains the functions which are defined as static/LOCAL functions.

   4. let g:fun_prototypes_header = /"
      let g:fun_prototypes_body   = "               funtion prototypes                 *"
      let g:fun_prototypes_footer = */"

      These three lines will insert before first function define. If you only
      want single line, should define like below:
      eg:
      let g:fun_prototypes_header = ""
      let g:fun_prototypes_body   = "/funtion prototypes/"
      let g:fun_prototypes_footer = ""
      Attention:If these three lines have already inserted in source code, the functions' prototypes will insert after these three lines!
Usage:
    Copy this file to ~/.vim/plugin or to /vimfiles/plugins/ (on win32)
    
    Add the key map (default is <leader>fd) in your .vimrc or _vimrc (on win32)
    default:
      nnoremap <silent> <leader>fd :call FunProto()<CR>

添加新评论