I need to hide some comments which cannot be collapsed in some cases. What is the best practice to do it?
Asked
Active
Viewed 219 times
1 Answers
0
There are some methods. But I prefer is using these two, since they are manageable:
Hide Selection command using shortcut keys: Simply select your code either it's comment or working code and the just press:
Ctrl+M, Ctrl+H -> to hide (this simply collapse your selected section and make small box preview)
Ctrl+M, Ctrl+U -> to uhide
Try using region:
#region region_name//your stuff#endregion
anil shrestha
- 1,183
- 8
- 23
-
Consider mentioning _which_ keyboard shortcut you are using. Not everyone has the defaults for **Edit.Hide Selection** – MickyD May 26 '21 at 08:15
-
@MickyD It's a windows OS configuration key. – anil shrestha May 26 '21 at 09:24
-
Hope you don't mind but I have edited your answer. But yes, `Ctrl+M, Ctrl+H` is only recognised by Visual Studio as far as I am aware and interpreted as the default keyboard assignment for **Edit.Hide Selection**. Visual Studio also allows you to re-define the keyboard shortcut for it and many other commands. – MickyD May 26 '21 at 10:33