nerdcommenter icon indicating copy to clipboard operation
nerdcommenter copied to clipboard

Option to specify number of spaces to prepend appended comment with

Open shammellee opened this issue 7 years ago • 6 comments

I prefer my appended comments to start 2 spaces after the line. Any way to do this?

int * get_codes()
{
  static int codes[6] = {24, 38, 43, 87, 42, 54};  // Nuclear codes

  return codes;
}

shammellee avatar Mar 30 '18 00:03 shammellee

Personally I think that's silly, but of course you can do whatever you like with your own code. Check out the source code starting about line 44.

let s:spaceStr = '  '

alerque avatar Jun 19 '18 10:06 alerque

It is not silly, for python, pep8 recommend at least two spaces before inline comment.

zgpio avatar Aug 22 '18 00:08 zgpio

Well I think PEP8 is silly, but that's my prerogative to think. Like I said you're free to do whatever, I won't stop you from using this plugin to produce 5 spaces before comments if that's what you want. There is a provision in the code to change this behavior by setting a variable in your vim configuration file. So happy PEP8ing to you all, and may your editor windows always be at least 256 characters wide ;-)

alerque avatar Aug 22 '18 07:08 alerque

Modify s:spaceStr can not solve this problem, it means two spaces before delimiters, not after. Custom delimiters is not a good idea, how can I solve this problem gracefully.

zgpio avatar Aug 28 '18 07:08 zgpio

Correct, this is getting applied after not before the delimiter. An additional options is required for this case.

alerque avatar Aug 28 '18 09:08 alerque

Thanks a lot.

zgpio avatar Aug 28 '18 11:08 zgpio