admin管理员组文章数量:1406312
I have tried looking this up but I only find answers related to getting the toggle command to work at all, not about the specific issue I have.
I was previously using Notepad++. For Python, when I would toggle the comment of two lines simultaneously, I would get the following behaviour:
# Line 1
Line 2
After toggle:
Line 1
# Line 2
Future toggles alternate between the two states above.
I have not found a way to do this in VS Code (Ctrl + / ). The behaviour I see is
# Line 1
Line 2
After toggle:
# # Line 1
# Line 2
Toggle again:
# Line 1
Line 2
The behaviour of Notepad++ is quite useful, but I can't find any discussion of it or how to get VSCode to behave similarly. The VSCode way is not useless, but the Notepad++ version is much more useful as I can always just use a comment command if I want to simply add a comment and not swap which lines are commented.
Does anyone know how I can replicate the Notepad++ behaviour in VSCode?
I have tried looking this up but I only find answers related to getting the toggle command to work at all, not about the specific issue I have.
I was previously using Notepad++. For Python, when I would toggle the comment of two lines simultaneously, I would get the following behaviour:
# Line 1
Line 2
After toggle:
Line 1
# Line 2
Future toggles alternate between the two states above.
I have not found a way to do this in VS Code (Ctrl + / ). The behaviour I see is
# Line 1
Line 2
After toggle:
# # Line 1
# Line 2
Toggle again:
# Line 1
Line 2
The behaviour of Notepad++ is quite useful, but I can't find any discussion of it or how to get VSCode to behave similarly. The VSCode way is not useless, but the Notepad++ version is much more useful as I can always just use a comment command if I want to simply add a comment and not swap which lines are commented.
Does anyone know how I can replicate the Notepad++ behaviour in VSCode?
Share Improve this question asked Mar 5 at 21:58 2ndQuantized2ndQuantized 1725 bronze badges2 Answers
Reset to default 2Shift+ Alt+ I
then Ctrl + /
.
You can bind them using extension multi-command
Sometime back I wrote an extension specifically designed to do just what your are asking:
Toggle Line Comments.
Once you install the extension the default keybinding is Ctrl/Cmd+Alt+/
本文标签:
版权声明:本文标题:python - VS Code Comment Toggle Behaviour Unexpected: Adds and removes comments, does not swap comments - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745005478a2637235.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论