Default alignment option + ability to align at index 0. #24

merged 5 commits into from May 23, 2016

I add a couple of features that I wanted for commenting that others may find useful:

  1. an option to set the default alignment value used by commands which don't have a specific intended alignment. Using this I can specify how I want NERDCommenterToggle to align my comments.
  2. a new alignment value, 'start', which indicates that the comment characters should be inserted at index 0 (column 1) of the line. As a personal convention, when I'm temporarily commenting code out, I prefer my comment delimiters to be at the very start of the line so that I can quickly pick out what comments are temporary vs permanent.

In addition to updating the help file to document these new features, please also note one gotcha where using the 'start' alignment with g:NERDRemoveExtraSpaces can result in the undesired removal of spaces. I thought about adding some code to detect and warn the user in this situation, but decided against it at the time. Its something worth considering when decided whether these changes are worth merging in.


+1 -- I've been happily using this feature addition for awhile now, for the same personal convention expressed in point #2.









ervandew added some commits Feb 6, 2013
@ervandew ervandew add config support for default delims
if there are no configured delims for the current filetype, allow the
default delims to be defined by a global setting since c style comment
delims are not always the best defaults for everyone.
@ervandew ervandew only use g:NERDDefaultDelims if no filetype has been set 4f3d9c0


@arnuschky arnuschky pushed a commit to arnuschky/nerdcommenter that referenced this pull request Mar 30, 2014
Arne Brutschy Merging scrooloose#24 2788105



This I need. Thank you.

@tlapicka tlapicka added a commit to tlapicka/nerdcommenter that referenced this pull request Oct 2, 2015
@tlapicka tlapicka Výchozí zarovnání a výchozí delimiter
Merge remote-tracking branch 'ervandew/master' into ervandew-features

+1 exactly what would come handy for me


@scrooloose Why the on Earth this haven't been merged yet! You seem to be alive, judging by your activity on github. Maybe you would accept a little help with managing this code?


Fork notice: With the upstream project sitting stale after nearly 8 months since the last activity, 71 outstanding pull requests, no comments from the original developer, and dozens of developers duplicating efforts while scratching their own itches, I've decided to step in and run a fork for a while. Hopefully the original developer will eventually consider picking this plugin up again or adding more maintainers so that the user base doesn't end up fragmented, but for now I would invite anyone interested in the latest updates to consider installing from and contributing pull requests to my fork.

About this PR: I have merged this PR as is. Please consider installing the plugin from alerque/nerdcommenter for this and (so far) over two dozen other updates.

@alerque alerque merged commit 34e0115 into scrooloose:master May 23, 2016

Change of plans. Thanks to @scrooloose who has added me as a maintainer to this repo, I'll be going through and taking care of business here instead of in a fork.

Thanks for your contribution @purpleP!

@alerque alerque referenced this pull request in sietse/nerdcommenter May 24, 2016
sietse.brouwer Make <C-Space> produce left-aligned comments.
This is done in a really ugly way: this commit alters the 'Toggle'
dispatch block in the main dispatch function so that it calls the
function that produces left-aligned comments, rather than the one that
comments every line in isolation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment