一、删除(实为剪切一行,类似VS的ctrl+l):

ctrl+u

 

二、注释、消去注释的实现

    主要使用SI提供的宏函数来实现,将下面的宏函数另存为MulLinesComments.em文件 :

  1. macro MultiLineComment()
  2. {
  3.     hwnd = GetCurrentWnd()
  4.     selection = GetWndSel(hwnd)
  5.     LnFirst =GetWndSelLnFirst(hwnd) //取首行行号
  6.     LnLast =GetWndSelLnLast(hwnd) //取末行行号
  7.     hbuf = GetCurrentBuf()
  8.     if(GetBufLine(hbuf, 0) =="//magic-number:tph85666031"){
  9.         stop
  10.     }
  11.     Ln = Lnfirst
  12.     buf = GetBufLine(hbuf, Ln)
  13.     len = strlen(buf)
  14.     while(Ln <= Lnlast) {
  15.         buf = GetBufLine(hbuf, Ln) //取Ln对应的行
  16.         if(buf ==""){ //跳过空行
  17.             Ln = Ln + 1
  18.             continue
  19.         }
  20.         if(StrMid(buf, 0, 1) == "/"){ //需要取消注释,防止只有单字符的行
  21.             if(StrMid(buf, 1, 2) == "/"){
  22.                 PutBufLine(hbuf, Ln, StrMid(buf, 2, Strlen(buf)))
  23.             }
  24.         }
  25.         if(StrMid(buf,0,1) !="/"){ //需要添加注释
  26.             PutBufLine(hbuf, Ln, Cat("//", buf))
  27.         }
  28.         Ln = Ln + 1
  29.     }
  30.     SetWndSel(hwnd, selection)
  31. }


直接拷贝MulLinesComments.em文件到Base的目录

SI删除及注释快捷键实现

 

project->open project,切换到base工程:

SI删除及注释快捷键实现

找到"MultLineComment",点击“Assign New Key...”,在弹出方框后,按下CTRL /,即可以完成热键与宏的关联。

SI删除及注释快捷键实现

SI删除及注释快捷键实现

 

切换到其它的工程,选中代码,按一下CTRL+/给代码批量注释;再按一下就可以消去注释。

SI删除及注释快捷键实现

 

参考文章:

http://www.cnblogs.com/dongzhiquan/archive/2013/03/04/2943448.html

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2022-01-04
  • 2021-12-22
  • 2021-11-19
猜你喜欢
  • 2022-12-23
  • 2021-12-16
  • 2021-12-10
  • 2022-02-09
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案