Hello I want to create a comment section right next to all my code lines for documentation purposes. I have over 1000 lines of code and I don't want to place all the #
by myself.
The result I want to achieve:
code() # comment
code() # comment
code() # comment
code() # comment
Is there a way to do this automaticly?
CodePudding user response:
you can place Multi Cursors.
Make sure you don't have Word Wrap
enabled
- click on the first line
- Shift Alt Click on the last line
- End - to go to the end of the line
- Type a number of spaces to make all lines larger than your comment column
- Home - go to start of line
- Use Arrow Right to move to your comment column
- Sift End Delete - to remove extra spaces
- Type
# comment
- Esc - to leave Multi Cursor
CodePudding user response:
There are a number of extensions that do this well. See, e.g.,
You can bind the Align
command to a keybinding if you want.
{
"key": "alt a",
"command": "simple-alignment.align"
},