Commenting code in Notepad++

I'm using Notepad++ as an editor to write programs in Python. It might sound daft but I looked around in the editor and could not find any means (not the manual way but something like in Emacs) to do a block comment in my code.

Since so many language settings are supported in Notepad++, I'm curious to find a way to block comment code.


CTRL+Q Block comment/uncomment.

More Notepad++ keyboard shortcuts.


Try the following shortcut:

Ctrl+K.


This link was exactly what I was searching for .

Let me summarize the answers for others' benefit ( for python and notepad++ )

1) Ctrl+K on multiple lines (ie selected region) allows you to block comment .

Also note that pressing the combination multiple times allows you to add multiple "#"s (sometimes I use that while testing to differentiate from other comments)

2) Ctrl+Shift+K (on the commented region) allows you to perform block uncomment

3) Ctrl+Shift+K on an uncommented selected region does not comment it

4) Ctrl+Q allows you to block comment/uncomment in a toggled mode (meaning, you cannot add multiple '#'s like in 1) )

Hope this helps another wandering soul.

Question - how would you develop a hack of keyboard combinations to comment/uncomment if there were no shortcuts? Just curious. I've no clue hence asking.

链接地址: http://www.djcxy.com/p/20228.html

上一篇: 为什么Python没有多行注释?

下一篇: 在Notepad ++中评论代码