Source Insight 4 使用 quicker.em


一、SI4 安装quicker.em

Source Insight有很多宏可以用,这里介绍的宏是quicker.em这个宏,它是华为的一个员工写的,很实用。

  1. 安装quicker.em宏

    (1) 打开base这个工程Project->Open Project,选择base工程,即可打开;

    (2) 将宏文件quicker.em添加到该base工程中;

    (3) 设置宏的快捷方式:Options->Key Assignments,找到Marco:AutoExpand,添加快捷键即可,一般推介用Ctrl+Enter组合键。

  2. HeaderFileCreate,这个宏功能用于自动创建一个.c文件的头文件。

    (1) 创建自定义快捷菜单Options->Menu Assignments,选择Macro:HeaderFileCreate这一项,将它添加到右边Menu项的Work下,然后点Insert插入,点OK即可。

    (2) 打开该.c文件,在work栏就能看到我们刚才添加的自定义快捷菜单HeaderFileCreate,点击它,就自动生产头文件了。

二、quicker.em 代码

quicker.em 源码链接,提取码:5wto

链接:https://pan.baidu.com/s/10vPoYO9V5BGort67Gd21wA
提取码:5wto

三、quicker.em 使用说明

在文件空白处输入 quicker.em 支持的命令,按下 Ctrl+Enter 即可。
如:输入help ,按下 Ctrl+Enter 显示 quicker.em 支持的命令如下:

 *====== List Quicker supports commands ========*
 *----------------------------------------------*
 *
 *  /*             auto fill comment according to standard C format
 *  //             auto fill comment according to standard C format
 *  {              auto add right curly bace
 *
 *  name           auto record author's name
 *  if             auto insert if condition statements template
 *  ef             auto insert else if condition statements template
 *  ife            auto insert if/else condition statements template
 *  ifs            auto insert if/else if/else condition statements template
 *  else/ei        auto insert else statements template
 *
 *  switch/sw      auto insert switch/case statements template
 *  case/ca        auto insert case/break statements template
 *
 *  for            auto insert for loop statements template
 *  fo             auto insert for loop statements template
 *  while/wh       auto insert while loop statements template
 *  do             auto insert do/while loop statements template
 *
 *  func/fu        auto insert function header description template
 *  file/fi        auto insert file header description template
 *  hi             auto insert new history record in history comment
 *  struct/st      auto insert typedef struct statements template
 *  enum/en        auto insert typedef enum statements template
 *
 *  ap             auto insert problem number and description comment
 *
 *  pn             set problem number used by below command
 *
 *  ab             auto insert add begin description for assigned PN comment
 *  ae             auto insert add end description for assigned PN comment
 *  db             auto insert delete begin description for assigned PN comment
 *  de             auto insert delete end description for assigned PN comment
 *  mb             auto insert modify begin description for assigned PN comment
 *  me             auto insert modify end description for assigned PN comment
 *  abg            auto insert add begin and end description for assigned PN comment
 *  mbg            auto insert modify begin and end description for assigned PN comment
 *  dbg            auto insert delete begin and end description for assigned PN comment
 *
 *  hd             auto create .h header file for current .c file
 *  hdn            auto create new .h header file for current .c file
 *
 *  key            list Source Insight default shortcut keys
 *  cmd/help       list Quicker supports commands just this showed
 *
 *  #if            auto insert #if statements template
 *  #ifd/#ifdef    auto insert #ifdef statements template
 *  #ifn/#ifndef   auto insert #inndef statements template
 *
 *  cpp            auto insert extern C statements template
 *  tab            auto expand tab to assigned spaces
 *
 *----------------------------------------------*
 *======= End Quicker supports commands ========*

如:输入file (创建文件说明),按下 Ctrl+Enter 显示如下:

/******************************************************************************
*  
*  版权所有(c)2019-2099,XXX公司
*  
*******************************************************************************
*  
*  文件名称:XXX.c
*  版 本 号:V1.0
*  作    者:XXX
*  生成日期:202177*  
*  功能描述:XXX
*  
*  修改历史:
*         1. 日    期:202177*            作    者:XXX
*            修改内容:创建文件
*  
******************************************************************************/

/*----------------------------------------------*
 *  标准库头文件                                  *
 *----------------------------------------------*/
#include <xxx.h>

/*----------------------------------------------*
 *  非标准库头文件                                *
 *----------------------------------------------*/
#include "xxx.h"

/*----------------------------------------------*
 *  宏定义                                       *
 *----------------------------------------------*/

/*----------------------------------------------*
 *  数据类型定义                                  *
 *----------------------------------------------*/

/*----------------------------------------------*
 *  常量定义                                     *
 *----------------------------------------------*/

/*----------------------------------------------*
 *  全局变量定义                                  *
 *----------------------------------------------*/

/*----------------------------------------------*
 *  函数声明                                     *
 *----------------------------------------------*/

/*----------------------------------------------*
 *  函数实现                                     *
 *----------------------------------------------*/

说明:中文模式下需设置字体等宽,否则中文显示格式比较乱

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值