Source Insight的配置与使用

         Source Insight是一个面向项目开发的程序编辑器和代码浏览器,它拥有内置的对C/C++, C#和Java等程序的分析。能分析源代码并在工作的同时动态维护它自己的符号数据库,并自动显示有用的上下文信息。

         而拥有一个好的IDE配置,会使代码编写更加舒适、快捷,进而提高开发效率。截止目前,Source Insight已经推出了4.x版本,下面以source insight4.x为例进行配置说明(以下为个人喜好配置,供大家参考)。

安装请参考:https://blog.csdn.net/fangye945a/article/details/84996658

安装完成后,对其进行如下简单配置:

一、设置字体、行号及高亮显示

Source Insight4.0 通过鼠标+滚轮可以快速调整字体大小。 

二、将背景设置为护眼色(R:199 G:237 B:204)。 

三、设置默认编码为UTF8(根据团队统一规范设置)。 

四、utils.em自定义配置的使用。

source insight能够通过配置Base工程下的*.em文件,实现自己想要的功能,并配置自定义快捷键进行使用。下面添加如下三种快捷键来协助我们的代码编写:

1、添加行注释快捷键

在许多IDE中(eclipse、Qtcreator等),选中目标行后,按下ctrl+/快捷方式,即可为选中的行进行 “//” 注释或取消注释。打开Base工程中的utils.em文件,在最前面添加如下代码并保存。

//添加双斜杠注释  /*   */
macro MultiLineComment()    
{
 
	hwnd = GetCurrentWnd()   
	selection = GetWndSel(hwnd)   
	LnFirst = GetWndSelLnFirst(hwnd) //取首行行号
	LnLast = GetWndSelLnLast(hwnd)   //取末行行号
	hbuf = GetCurrentBuf()    
	if(GetBufLine(hbuf, 0) == "//magic-number:tph85666031"){   
   		stop   
	}   
 
	Ln = Lnfirst   
	buf = GetBufLine(hbuf, Ln)   
	len = strlen(buf)   
	while(Ln <= Lnlast) {   
		buf = GetBufLine(hbuf, Ln)  //取Ln对应的行
		if(buf == ""){                    //跳过空行
			Ln = Ln + 1   
			continue   
		}   
		if(StrMid(buf, 0, 1) == "/") {       //需要取消注释,防止只有单字符的行
			if(StrMid(buf, 1, 2) == "/"){   
				PutBufLine(hbuf, Ln, StrMid(buf, 2, Strlen(buf)))   
 			}   
 
		}   
 
		if(StrMid(buf,0,1) != "/"){          //需要添加注释
      		PutBufLine(hbuf, Ln, Cat("//", buf))   
   		}   
  		Ln = Ln + 1   
	}   
	SetWndSel(hwnd, selection)   
}

在菜单栏中选择Options -> Key Assignments,输入Macro,找到MultiLineComment函数,点击Assign New Key..,设置快捷键后点击OK即可。

 

2、添加块注释快捷键

在C/C++中,除了//可以注释外,/* */也能够注释。其功能代码如下所示,通常将快捷键设置为ctrl+shift+/ 

//注释选中行/* */
macro CommentSelStr()  
{  
    hwnd=GetCurrentWnd()
    lnFirst=GetWndSelLnFirst(hwnd)  
    lnLast=GetWndSelLnLast(hwnd)  
    hbuf=GetCurrentBuf()  
    
    Ln = Lnfirst   
    buf = GetBufLine(hbuf, Ln) 
	if(buff==""||Strlen(buf)==0)
	{
	}
	else
	{
		if(StrMid(buf, 0, 1) == "/") 
		{       //需要取消注释,防止只有单字符的行
			if(StrMid(buf, 1, 2) == "*")
			{   
				PutBufLine(hbuf, Ln, StrMid(buf, 2, Strlen(buf)))   
	 		}
	 		else
	 		{
				str=cat("/*",buf)
				PutBufLine (hbuf, ln, str)
			}   
		} 
		else
		{
			str=cat("/*",buf)
			PutBufLine (hbuf, ln, str)
		}
		ln=lnLast
		buf=GetBufLine(hbuf, Ln)
		len_s=strlen(buf)
		if(StrMid(buf, strlen(buf)-1, strlen(buf)) == "/")
		{
			if(StrMid(buf, strlen(buf)-2, strlen(buf)-1) == "*")
			{
				PutBufLine(hbuf, Ln, StrMid(buf, 0, Strlen(buf)-2))
			}
			else
			{
				str=cat(buf,"*/")
				PutBufLine (hbuf, ln, str)
			}
		}
		else
		{
			str=cat(buf,"*/")
			PutBufLine (hbuf, ln, str)
		} 
    }
} 

3、添加自动扩展功能快捷键

由于快捷方式过多难以记忆,大佬们发明了AutoExpand函数,一个涵盖了诸多功能的函数,通过快捷方式触发后,能够自动根据上下文的字符来决定要触发的功能,通常我们将AutoExpand的快捷方式设置为ctrl+Enter。

首先,需要下载一个带有AutoExpand函数功能的.em文件。可自行上网搜索,或者下载如下链接文件,听说是华为大佬写的,亲测还是比较好用的,下载地址为:https://download.csdn.net/download/ace_fei/4224495

如果没积分下载可以留言,我发给你。

主要需要修改的地方就是InsertFileHeader 函数了,毕竟每个人的公司名还是不一样的,还有一些信息个人觉得比较多余(可能是自己还没到那个层次吧...),对这个函数进行修改后,基本上就能够使用了,至于怎么改,就看自己喜好了。

 修改完后,将该文件复制到安装目录,并将其添加到Base工程下,设置快捷键后即可使用了。

用法说明:

快捷键设置完了,可是要怎么用呢,AutoExpand功能再牛逼不会用也是白搭。于是有人想到给他加个帮助函数

函数实现为:

macro ShowHelp(hbuf, ln)
{
    var i
    
    i = 0
    
    DelBufLine(hbuf, ln)
    
    InsBufLine(hbuf, ln + i, "/*==============================================*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *====== List Quicker supports commands ========*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *----------------------------------------------*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  /*             auto fill comment according to standard C format")       
    i = i+1
    InsBufLine(hbuf, ln + i, " *  //             auto fill comment according to standard C format")       
    i = i+1
    InsBufLine(hbuf, ln + i, " *  {              auto add right curly bace")       
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  name           auto record author's name")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  if             auto insert if condition statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  ef             auto insert else if condition statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  ife            auto insert if/else condition statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  ifs            auto insert if/else if/else condition statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  else/ei        auto insert else statements template")       
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  switch         auto insert switch/case statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  case/ca        auto insert case/break statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  for            auto insert for loop statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  fo             auto insert for loop statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  while/wh       auto insert while loop statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  do             auto insert do/while loop statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  func/fu        auto insert function header description template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  file/fi        auto insert file header description template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  hi             auto insert new history record in history comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  struct/st      auto insert typedef struct statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  enum/en        auto insert typedef enum statements template")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  ap             auto insert problem number and description comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *  pn             set problem number used by below command")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *  ab             auto insert add begin description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  ae             auto insert add end description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  db             auto insert delete begin description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  de             auto insert delete end description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  mb             auto insert modify begin description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  me             auto insert modify end description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  abg            auto insert add begin and end description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  mbg            auto insert modify begin and end description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  dbg            auto insert delete begin and end description for assigned PN comment")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  hd             auto create .h header file for current .c file")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  hdn            auto create new .h header file for current .c file")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  key            list Source Insight default shortcut keys")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  cmd/help       list Quicker supports commands just this showed")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  #if            auto insert #if statements template")       
    i = i+1
    InsBufLine(hbuf, ln + i, " *  #ifd/#ifdef    auto insert #ifdef statements template")       
    i = i+1
    InsBufLine(hbuf, ln + i, " *  #ifn/#ifndef   auto insert #inndef statements template")       
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  cpp            auto insert extern C statements template")       
    i = i+1
    InsBufLine(hbuf, ln + i, " *  tab            auto expand tab to assigned spaces")
    i = i+1

    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *----------------------------------------------*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *======= End Quicker supports commands ========*")    
    i = i+1
    InsBufLine(hbuf, ln + i, " *==============================================*/")
    
}

快捷键忘了咋办,每次打开菜单一个个查太麻烦了。于是又添加了一个显示SourceInsight默认快捷键的命令。

函数实现为:

macro ShowShortKey(hbuf, ln)
{
    var i
    
    i = 0
    
    DelBufLine(hbuf, ln)
    
    InsBufLine(hbuf, ln + i, "/*==============================================*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *== List Source Insight default shortcut keys =*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *----------------------------------------------*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Macro: AutoExpand                         :  Ctrl+Enter, Shift+Enter")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Macro: ComentCPPtoC                       :  Alt+C     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Macro: Review_Add_Comment                 :  F11       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Custom Cmd: SI-PC-LINT                    :  Alt+Z     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Search: Incremental Search...             :  F12       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Search: Replace Files...                  :  Ctrl+Shift+H      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Search: Search Backward                   :  F3        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Search: Search Backward for Selection     :  Shift+F3  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Search: Search Files...                   :  Ctrl+Shift+F      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Search: Search Forward                    :  F4        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Search: Search Forward for Selection      :  Shift+F4  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Search: Search...                         :  Ctrl+F    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Symbol: Browse Local File Symbols...      :  F8        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Symbol: Browse Project Symbols...         :  F7, Alt+G ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Symbol: Jump To Base Type                 :  Alt+0     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Symbol: Jump To Definition                :  Ctrl+=, Ctrl+L Click (select), Ctrl+Double L Click        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Symbol: Lookup References...              :  Ctrl+/    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Symbol: Symbol Info...                    :  Alt+/, Ctrl+R Click (select)      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *  View: Highlight Word                      :  Shift+F8  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  View: Symbol Window                       :  Alt+F8    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Windows: Close Window                     :  Alt+F6, Ctrl+F4   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Windows: Last Window                      :  Ctrl+Tab, Ctrl+Shift+Tab  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Windows: New Window                       :  Alt+F5    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Windows: Select Next Window               :  F2, Shift+F2, Ctrl+F6     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Windows: Select Previous Window           :  Shift+F1  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Windows: Tile Two Windows                 :  F6        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Windows: Zoom Window                      :  Alt+F10, Ctrl+F10 ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Navigation: Activate Symbol Window        :  Alt+L     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Beginning Of Selection        :  Ctrl+Alt+[        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Block Down                    :  Ctrl+Shift+]      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Block Up                      :  Ctrl+Shift+[      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Bookmark...                   :  Ctrl+M    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Bottom Of File                :  Ctrl+End, Ctrl+(KeyPad) End       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: End Of Selection              :  Ctrl+Alt+]        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Function Down                 :  (KeyPad) +        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Function Up                   :  (KeyPad) -        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Navigation: Go Back                       :  Alt+,, Thumb 1 Click      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Go Back Toggle                :  Alt+M     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Go Forward                    :  Alt+., Thumb 2 Click      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Go To Line...                 :  F5, Ctrl+G        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Go To Next Change             :  Alt+(KeyPad) +    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Go To Next Link               :  Shift+F9, Ctrl+Shift+L    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Go To Previous Change         :  Alt+(KeyPad) -    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Navigation: Jump To Link                  :  Ctrl+L    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Jump To Match                 :  Alt+]     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Make Column Selection         :  Alt+L Click       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Paren Left                    :  Ctrl+9    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Paren Right                   :  Ctrl+0    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Edit: Back Tab                            :  Shift+Tab ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Complete Symbol                     :  Ctrl+E    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Copy                                :  Ctrl+C, L+R Click ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Copy Line                           :  Ctrl+K    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Copy Line Right                     :  Ctrl+Shift+K      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Copy To Clip...                     :  Ctrl+Del  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Cut                                 :  Ctrl+X, Shift+Del ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Cut Line                            :  Ctrl+U    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Cut Line Right                      :  Ctrl+;    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Cut To Clip...                      :  Ctrl+Shift+X      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Cut Word                            :  Ctrl+,    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Edit: Indent Left                         :  F9        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Indent Right                        :  F10       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Insert Line                         :  Ctrl+I    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Insert Line Before Next             :  Ctrl+Space        ")
//    i = i+1
//    InsBufLine(hbuf, ln + i, " *  Edit: Insert New Line                     :  Ctrl+Enter        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Join Lines                          :  Ctrl+J    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Paste                               :  Ctrl+V, Shift+Ins ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Paste From Clip...                  :  Ctrl+Ins  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Paste Line                          :  Ctrl+P    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Edit: Play Recording                      :  Ctrl+F3   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Redo                                :  Ctrl+Y    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Renumber...                         :  Ctrl+R    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Repeat Typing                       :  Ctrl+\    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Replace...                          :  Ctrl+H    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Simple Tab                          :  Ctrl+Alt+Tab      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Smart Rename...                     :  Ctrl+'    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Start Recording                     :  Ctrl+F1   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Stop Recording                      :  Ctrl+F2   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Edit: Undo                                :  Ctrl+Z, Alt+BackSpace     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *  File: Close                               :  Ctrl+W    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: Close All                           :  Ctrl+Shift+W      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: New                                 :  Ctrl+N    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: Next File...                        :  Ctrl+Shift+N      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: Open...                             :  Ctrl+O    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: Reload File                         :  Ctrl+Shift+O      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: Save                                :  Ctrl+S    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: Save All                            :  Ctrl+A    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: Save As...                          :  Ctrl+Shift+S      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  File: Show File Status                    :  Shift+F10 ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Help: Help...                             :  F1        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Help: SDK Help...                         :  Alt+F1    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *  Application: Draft View                   :  Alt+F12   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Application: Exit                         :  Alt+F4    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Application: Redraw Screen                :  Ctrl+Alt+Space    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Navigation: Scroll Half Page Down         :  Ctrl+PgDn, Ctrl+(KeyPad) PgDn, (KeyPad) * ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Scroll Half Page Up           :  Ctrl+PgUp, Ctrl+(KeyPad) PgUp, (KeyPad) / ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Scroll Left                   :  Alt+Left  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Scroll Line Down              :  Alt+Down  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Scroll Line Up                :  Alt+Up    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Scroll Right                  :  Alt+Right ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Block                  :  Ctrl+-    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Char Left              :  Shift+Left        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Char Right             :  Shift+Right       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Line                   :  Shift+F6  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Line Down              :  Shift+Down        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Line Up                :  Shift+Up  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Match                  :  Alt+=     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Page Down              :  Shift+PgDn, Shift+(KeyPad) PgDn   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Page Up                :  Shift+PgUp, Shift+(KeyPad) PgUp   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1

    InsBufLine(hbuf, ln + i, " *  Navigation: Select Sentence               :  Shift+F7, Ctrl+.  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select To                     :  Shift+L Click     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select To End Of File         :  Ctrl+Shift+End    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select To End Of Line         :  Shift+End ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select To Start Of Line       :  Shift+Home        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select To Top Of File         :  Ctrl+Shift+Home   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Word                   :  Shift+F5  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Word Left              :  Ctrl+Shift+Left   ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Select Word Right             :  Ctrl+Shift+Right  ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Selection History...          :  Ctrl+Shift+M      ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Top Of File                   :  Ctrl+Home, Ctrl+(KeyPad) Home     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Top Of Window                 :  (KeyPad) Home     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Word Left                     :  Ctrl+Left ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Navigation: Word Right                    :  Ctrl+Right        ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *  Options: Document Options...              :  Alt+T     ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Options: Sort Symbol Window               :  Alt+F7    ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *  Project: Add File...                      :  Alt+Shift+A       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Project: Close Project                    :  Alt+Shift+W       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Project: New Project...                   :  Alt+Shift+N       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Project: Open Project...                  :  Alt+Shift+P       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Project: Remove File...                   :  Alt+Shift+R       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *  Project: Synchronize Files...             :  Alt+Shift+S       ")
    i = i+1
    InsBufLine(hbuf, ln + i, " *")              
    i = i+1
    
    InsBufLine(hbuf, ln + i, " *----------------------------------------------*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *== End Source Insight default shortcut keys ==*")
    i = i+1
    InsBufLine(hbuf, ln + i, " *==============================================*/")
    
}

最后就是使用switch、for 等快捷命令的时候,会产生多个#号供coder快速编写代码,如下所示:

输入sw后,按下ctrl+Enter,即可触发switch快捷功能,输入需要创建的case个数,即可自动生成代码结构。

确认后source insight便自动生成了如下代码,“#” 代表我们要输入代码的地方,可以通过再次触发AutoExpand的快捷键(ctrl+Enter)在“#”号间跳转,提高编码效率

其他常用的功能参考help或者cmd命令给出的提示即可,如下图所示:

 

个人utils.em文件配置下载地址: https://download.csdn.net/download/fangye945a/11377690

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值