0

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?

2 Answers 2

1

There are a number of extensions that do this well. See, e.g., Simple Alignment. Just select the characters you want to align.

betterAlign

You can bind the Align command to a keybinding if you want.

{
  "key": "alt+a",
  "command": "simple-alignment.align"
},
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for you solution. Will look into it!
1

you can place Multi Cursors.

Make sure you don't have Word Wrap enabled

  1. click on the first line
  2. Shift+Alt Click on the last line
  3. End - to go to the end of the line
  4. Type a number of spaces to make all lines larger than your comment column
  5. Home - go to start of line
  6. Use Arrow Right to move to your comment column
  7. Sift+End Delete - to remove extra spaces
  8. Type # comment
  9. Esc - to leave Multi Cursor

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.