Make NERD Commenter prepend before spaces

138 views Asked by At

Is there a way to put the comment character at the very beginning of the line, before any spaces, e.g., instead of having comments inserted like this

// if (b != 0)
   // if (a > b) 
      // cout << a << endl;

it should be like this

// if (b != 0)
//    if (a > b) 
//       cout << a << endl;

The only things I see in the doc are NERDSpaceDelims and NERDRemoveExtraSpaces, which I've tried toggling and don't seem to help this issue.

1

There are 1 answers

0
dlmeetei On

If you would like to use vanilla vim, Here we go

Select the block using C-v, followed by any navigation key, in your case j. Then I. This will take you insert mode.

Now we can use any key to insert, for your particular example, \\. Finalize it by Esc.

We should have commented block now.