Selection block comment

转载 2012年03月27日 11:48:32

It strikes me as somewhat odd the decision to not provide quick access to the possibility of commenting a block of selected code. There's not even an option for this anywhere. I dealt with the problem by defining a new Surround With entry.

Just perhaps suggesting that you consider the possibility of making this option readily available at top level on the right-click menu.

Selecting a block of code and commenting it seems to me such a common thing, it would be great if access to it was almost mechanical.

I just retested this.  Surround with can be configured to create a block comment.  You may just have just gotten confused by the meaning of the "Surround with" checkbox on the aliases dialog, or you did not realize that surround with was configured through aliases in the first place.  Unfortunately, it is't blatantly obvious.

To create a block comment surround with alias.

1) Go to Tools > Options > File Extension Setup...
2) Select the file extension to customize, for example, "c" for C/C++
3) Switch to the General tab, and click on "Aliases..."
4) Check the "Surround with" check box to customize surround aliases
5) Click "New...", type in the name for the comment alias
6) Fill in the following for the comment text.
%\m sur_text%
7) Click OK when done

Of course, a more direct way to configure block comments is to go to "Document" > "Comment Setup...", and configure your block and line comment preferences.  Then you can use "Document" > "Comment Block" or "Comment Line" to comment out a block you have selected.

Let us know what works best for you.

In this case you should consider to use the mentioned BlockComment.e module.
Load it 'Macro->Load Module' and add the BlockComment command to your context menu / shortcut.

This command toggles between comment / uncomment the current selection or curr. line if nth. is selected.
You may easily adopt it to support more/other file extensions.
@HS2 --
( %\m sur_text% )
@Mario -- The commands are "box" for block comments, and "comment" for line comments.
(晕!I really don't like the way these guys doing things. Why not call it "block comment"? )




  • 2011年09月01日 15:14
  • 2KB
  • 下载



#pragma comment()的使用

  • 2012年08月12日 17:19
  • 32KB
  • 下载


  • 2011年11月21日 13:25
  • 2KB
  • 下载

comment on的重要意义

在db2和oracle的使用中经常会用到comment,但是今天突然发现自己还不理解到底为什么要使用comment,平时没有感觉出来使用comment有什么实际的作用啊? 于是搜索了一下,发现这篇文...
  • 2011年12月23日 23:19
  • 7101

P2P匿名论坛 Key-Comment (快评) Beta.24

  • 2011年11月24日 13:58
  • 1.28MB
  • 下载



MySQL 添加注释(comment)

在MySQL数据库中, 字段或列的注释是用属性comment来添加。创建新表的脚本中, 可在字段定义脚本中添加comment属性来添加注释。示例代码如下:create table test( ...
  • znyyjk
  • znyyjk
  • 2016年10月01日 19:18
  • 23660

看到同事写的程序,#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" ) 所理解的

摘自:, 如有侵权,请及时告知。 众所周知,控制台应用程序一般都会显示一个控制台...
您举报文章:Selection block comment