Selection block comment

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

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"? )

====
http://community.slickedit.com/index.php?topic=696.0


ABAP中SELECTION-SCREEN用法

SAP-ABAP SELECT-SCREEN 的几个用法   实例1: SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN POSITIO...
  • wanglei880526
  • wanglei880526
  • 2013年08月31日 10:02
  • 6724

Toggle Block Selection Mode(块选择模式开关)

快捷键:Alf+Shift+A Toggle Block Selection Mode(块选择模式开关) 用法: 首先用快捷键或者toolbar打开选择模式,会出现一个十字,表明块选...
  • cn_wk
  • cn_wk
  • 2015年10月29日 00:21
  • 806

eclipse的Toggle Block Selection Mode功能---列模式

快捷键:Alf+Shift+A Toggle Block Selection Mode(块选择模式开关) 用法: 首先用快捷键或者toolbar打开选择模式,会出现一个十字,表明块选择模式已开启...
  • imxiangzi
  • imxiangzi
  • 2015年07月30日 23:19
  • 1608

Toggle Block Selection Mode

快捷键:Alf+Shift+A Toggle Block Selection Mode(块选择模式开关) 用法: 首先用快捷键或者toolbar打开选择模式,会出现一个十字,表明块选...
  • u012142059
  • u012142059
  • 2014年02月20日 11:15
  • 2026

慢慢适配Xcode8.0+

多余的logs 1 From Xcode menu open: Product > Scheme > Edit Scheme 2 On your Environment Variab...
  • u014470305
  • u014470305
  • 2017年12月16日 12:49
  • 76

注释与反注释Comment/Uncomment selected code in Visual C++

看了younker的Comment/Uncomment selected code in Visual C++   一文后,深有收获。http://www.csdn.net/develop/read_...
  • levin_zhang
  • levin_zhang
  • 2001年11月14日 12:03
  • 604

eclipse下修改xml显示的字体大小和编码大小

eclipse 修改.xml和代码的大小wiondow--preferences--general--appearance--colors and fonts--java--java editor t...
  • aipeiever
  • aipeiever
  • 2012年11月09日 08:51
  • 1220

comment/uncomment lines in Vim

To comment out blocks in vim: press Esc (to leave editing or other mode)hit ctrl+v (visual block ...
  • matrixyy
  • matrixyy
  • 2016年08月22日 05:44
  • 552

python coding style guide 的快速落地实践

机器和人各有所长,如coding style检查这种可自动化的工作理应交给机器去完成,故发此文帮助你在几分钟内实现coding style的自动检查。...
  • gaoyingju
  • gaoyingju
  • 2016年01月02日 21:37
  • 2835

Android eclipse的Toggle Block Selection Mode功能

今天无意中发现了Toggle Block Selection Mode功能,其用途就是文本编辑器支持块选择模式。何为块选择模式呢,就是类似于ultraedit的列模式。似乎这个功能在eclipse3....
  • Vivian8725118
  • Vivian8725118
  • 2014年11月21日 14:22
  • 1242
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Selection block comment
举报原因:
原因补充:

(最多只允许输入30个字)